Sunday, December 9, 2018

Hide Related Items on the Shopping Cart Page

This workaround is the most convenient solution if there are lots of related items added on the shopping cart tab. Instead of manually deleting all related items on the shopping cart tab, the user can just add a custom tag to hide the related items. And if the user wants to display the related items back to the shopping cart page, the user can just remove the tag substitution without adding all related items back to the shopping cart tab.

Here are the steps to hide all related items on the shopping cart page:

1. Create a custom tag

a. Navigate to Setup> Site Builder > Tags> New
b. Enter the tag name all in capital letters and with no spaces (e.g. HIDERELATEDITEMSCART)
c. Default Value field should be empty
d. Click on Save

Apply the custom code to the shopping cart tab

a. Navigate to Lists> Web Site> Tabs
b. Edit the Shopping Cart tab
c. Click on the Tag Substitution subtab
d. Select the tag created on Step 1 above
e. Paste the following as the Substitution Value:

<script language='javascript'>
document.getElementById('handle_cartRelatedItems').style.display = 'none';
document.write(" ");

f. Click on Add
g. Click on Save

3. Add the custom tag to the footer theme

a. Navigate to Setup> Site Builder> Themes
b. Edit the theme that is being used in the web site
c. Click on the Body subtab
d. Look for the Footer Template
e. At the top of its content, call the custom tag you created in Step 1 above, and surround the tag with angle brackets (e.g. [HIDERELATEDITEMSCART])
f. Click on Save

For multiple websites, this workaround only affects the website of the shopping cart tab that the user modified.


No comments:

Post a Comment