What are Reorder Landing Pages?
How do I create a Reorder Landing Page?
Removing all items from the Reorder Landing Page cart
Step 1: Locate the correct file to edit
From your Shopify Admin access your theme files, specifically the theme.liquid file. Alternatively, if you have a specific Rebuy file in your theme files that is running Rebuy code, you can choose that file instead.
Theme.liquid
Locate the closing body tag, it will look like this </body> you can use cmd + f or control + f to open a search box to help you find the closing body tag.
Note: It's possible to have more than one closing body tag, in such a case you'll want to use the last one, that will be the main body tag for the whole page.
Rebuy theme file
Use the theme files search bar to locate any Rebuy files that may exist within your theme.
Step 2: Add code to that file.
Copy and paste the code shown below either above the closing body tag </body> if using your theme.liquid file.
Or at the top of the Rebuy file if using that instead.
Theme.liquid
Rebuy file
Copy this code
/* clear reorder LP Cart */
<script>
document.addEventListener('rebuy:reorderLandingPage.ready', function(){
if(Rebuy.ReorderLandingPage){
console.log('clearing cart')
Rebuy.Cart.clearCart()
}
});
</script>
Removing specific items from the Reorder Landing Page cart
Repeat Step 1 above to locate the necessary file.
The code shown below will remove all free items from the Reorder LP cart. Place this code as shown above in Step 2.
<script>
document.addEventListener('rebuy:reorderLandingPage.ready', function(){
if(Rebuy.ReorderLandingPage){
Rebuy.Cart.cart.items.forEach(item => {
if (item.final_price === 0) {
Rebuy.Cart.removeItem(item)
}
})
}
});
</script>
Customizations
If you'd like to remove other specific items from the Reorder Landing Page cart simply adjust the code above to target those items instead of targeting free items.