Scenario
For Site Builder web stores, a relative URL can be used to implement a clear cart functionality to remove all items on the shopping cart. This can be applied as a href link or a button depending on the preference of the user or be placed wherever on the web store.
Solution
- Button:
<input type="button" onclick=clearButton() value="Clear Cart Button"/>
<script>function clearButton(){window.location = "/app/site/backend/emptycart.nl" }
</script>
- Link:
<a href="/app/site/backend/emptycart.nl">Empty Shopping Cart</a>
- Redirect:
<a href="/app/site/backend/emptycart.nl?c={acct#}&redirect=RedirectURL.com">
Empty Shopping Cart</a>
For standard Site Builder webstores, link/button can be applied by customizing the web store theme:
- Navigate to Commerce > Site Builder > Themes
- Edit or Customize a theme
- Go to the Body tab
- Go to the Logo and tabs template field
- Paste the link or button code after NLCRUMBTRAIL tag
- Click Save