Skip to main content
All CollectionsSmart CartAdvanced SettingsFunctionality
How To Split Test The Rebuy Smart Cart
How To Split Test The Rebuy Smart Cart

In all situations for split testing the Rebuy Smart Cart you will want to make sure its enabled and in preview mode.

Strauss Van Wagenen avatar
Written by Strauss Van Wagenen
Updated over 4 months ago

For Developers only

Split Testing With a Cart Page

Split testing the Rebuy Smart Cart with a Cart Page is an easy process, simply run the following JS below anytime you want the Smart Cart to be active instead of the Cart Page.

var SmartCart = window.Rebuy.SmartCart; 

// Disable preview mode
SmartCart.settings.preview_mode = false;

// Initialize Smart Cart
SmartCart.init();

Split Testing With a Cart Drawer

For split testing with a Cart Drawer a few more steps are necessary, start by running the following JS anytime you want the Rebuy Smart Cart to show instead of your Cart Drawer .

var SmartCart = window.Rebuy.SmartCart; 

// Disable preview mode
SmartCart.settings.preview_mode = false;

// Initialize Smart Cart
SmartCart.init();

// Add Class To HTML element to hide current drawer
$('html').addClass('hide-drawer');

Next you will need to add the CSS to your stores theme or your Rebuy theme to hide your cart drawer when the HTML element has the class 'hide-drawer' -- here is an example of what that might look like.

// #CartDrawer might be different for your theme 

.hide-drawer #CartDrawer {
display: none !important;
}

Use the .hide-drawer selector as the base selector for hiding any elements or disabling any CSS related to your drawer, feel free to reach out to our support team if you need help with this step.

ADDITIONAL METHODS YOUR THEME MIGHT NEED

//Open Smart Cart 
Rebuy.SmartCart.show()

//Hide Smart Cart
Rebuy.SmartCart.hide();

If you have any questions, reach out to support!


โ€‹

Did this answer your question?