Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- if (typeof(Ecwid) == 'object') {
- Ecwid.OnAPILoaded.add(function() {
- // Redirect address. Change it to the URL of page where you want to redirect your customers.
- // You can use absolute or relative addresses, e.g. 'index.html', 'http://google.com'
- var continueShoppingRedirect = "http://google.com";
- // Continue shopping buttons CSS selectors
- // (you can remove the ones that you don't want to change behavior for)
- var buttons = [
- 'button.ecwid-productBrowser-cart-continueShoppingButton', // Cart page
- 'div.ecwid-productBrowser-cart-emptyCartPanel button.gwt-Button', // Empty cart page
- 'button.ecwid-ContinueShoppingButton-Invoice', // Order confirmation page
- 'div.ecwid-productBrowser-search-ContinueShoppingButtonContainer button.gwt-Button', // Search results page
- 'div.ecwid-Account-ContinueShoppingButtonContainer button.gwt-Button' // 'My account' pages
- ];
- // Pages (Ecwid.Page.type) where buttons should be customized
- var pages = [
- 'CART',
- 'SEARCH',
- 'ORDER_CONFIRMATION',
- 'ACCOUNT_SETTINGS',
- 'ORDERS',
- 'ADDRESS_BOOK'
- ];
- Ecwid.OnPageLoaded.add(function(page) {
- if (jQuery.inArray(page.type, pages) >= 0) {
- var buttonObject = jQuery(buttons.join()).filter(":not('.clone'):visible");
- if (buttonObject.length) {
- buttonObject.clone().addClass('clone').appendTo(buttonObject.parent()).click(function() {
- location.href = continueShoppingRedirect;
- });
- // Remove the original button
- buttonObject.remove();
- }
- }
- if (page.type == 'CART') {
- jQuery('.ecwid-productBrowser-cart-clearBagButton').click(function() {
- var buttonObject = jQuery(buttons.join()).filter(":not('.clone'):visible");
- if (buttonObject.length) {
- buttonObject.clone().addClass('clone').appendTo(buttonObject.parent()).click(function() {
- location.href = continueShoppingRedirect;
- });
- // Remove the original button
- buttonObject.remove();
- }
- });
- }
- });
- });
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement