The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
 
 
Thread Tools Display Modes
  #1  
Old 05-28-2014, 09:05 AM
Scott Gohl's Avatar
Scott Gohl is offline
 
Join Date: Dec 2012
Posts: 4
Default

The 'Continue Shopping' JavaScript redirect is malfunctioning...


Hello,

I am using the JavaScript snippet provided by ECWID to redirect the 'Continue Shopping' button. Everything works pretty well with one exception.

If I go to the shopping cart (with an item already in it) and use the 'Clear Bag' button the screen, as expected, refreshes with a message that 'Your Shopping Bag is Empty'.

If I then click on the 'Continue Shopping' button from this page I am redirected to the ECWID product browser and not my custom URL.

If I use the back button and return to the 'Shopping Bag is Empty' page and again click on the 'Continue Shopping' button the behavior changes and I am now redirected to my custom URL.

Does anybody know why this is happening and how to correct it?

Thanks!

David
  #2  
Old 06-03-2014, 02:15 PM
The Little Shop of Chocs's Avatar
The Little Shop of Chocs The Little Shop of Chocs is offline
 
Join Date: Mar 2014
Posts: 9
Default Redirect to own page after clearing shopping bag

Hello

I'm having the same problem as these people*–
http://www.ecwid.com/forums/showthread.php?t=28032
http://www.ecwid.com/forums/showthread.php?t=22919

I have used this code – http://kb.ecwid.com/w/page/67024231/... – to redirect my shopping cart buttons back to the front page of the website.

Here is the website – http://www.pualv.com/carousel/

The code works fine except for the 'continue shopping' button that appears on the 'your shopping bag is empty' page immediately after emptying the shopping bag (in this case it defaults to the two main categories).

If I navigate away from the page and then click the 'shopping bag' to bring it up again, the button then works as it should.

The javascript does not add the 'clone' class to the button on first loading the page after emptying the shopping bag but it is added on subsequent visits to this page.

Could you please tell me how to fix this so that 'continue shopping' button always goes back to the front page? Thanks.

(This is a duplicate of a thread http://www.ecwid.com/forums/showthread.php?t=28036 which is prob in the wrong category)
  #3  
Old 06-04-2014, 07:00 AM
Maya's Avatar
Maya Maya is offline
Ecwid Team
 
Join Date: Feb 2010
Location: Ecwid headquarter
Posts: 5,876
Default

Quote:
Originally Posted by Scott Gohl View Post
Hello,

I am using the JavaScript snippet provided by ECWID to redirect the 'Continue Shopping' button. Everything works pretty well with one exception.

If I go to the shopping cart (with an item already in it) and use the 'Clear Bag' button the screen, as expected, refreshes with a message that 'Your Shopping Bag is Empty'.

If I then click on the 'Continue Shopping' button from this page I am redirected to the ECWID product browser and not my custom URL.

If I use the back button and return to the 'Shopping Bag is Empty' page and again click on the 'Continue Shopping' button the behavior changes and I am now redirected to my custom URL.

Does anybody know why this is happening and how to correct it?

Thanks!

David
Hello David,

I will be glad to help you with this script. Could you send me the link to your store, where this problem can be reproduced?

I look forward to your reply.
__________________
Maya N., Ecwid Team

------------------
Welcome to our new Help Center!
  #4  
Old 06-10-2014, 10:49 AM
The Little Shop of Chocs's Avatar
The Little Shop of Chocs The Little Shop of Chocs is offline
 
Join Date: Mar 2014
Posts: 9
Default Redirect to own page after clearing shopping bag

Hello

I'm having the same problem as these people*–
http://www.ecwid.com/forums/showthread.php?t=28032
http://www.ecwid.com/forums/showthread.php?t=22919

I have used this code – http://kb.ecwid.com/w/page/67024231/... – to redirect my shopping cart buttons back to the front page of the website.

Here is the website – http://www.pualv.com/carousel/

The code works fine except for the 'continue shopping' button that appears on the 'your shopping bag is empty' page immediately after emptying the shopping bag. Clicking this takes you to the ecwid categories page and not the home page as I would like it to do.

If I navigate away from the page and then click the 'shopping bag' to bring it up again, the button then works as it should.

My understanding of the code is that a replacement button is made with the correct link (with the the class 'clone' added to it) and the original button removed. However, it does not do this when the page is first loaded after emptying the shopping bag. It is added on subsequent visits to this page.

I don't use the category page at all –*I want everything to go back to the homepage. It's only a minor thing but anyone emptying their shopping bag and then clicking 'continue shopping' is now effectively breaking the website.

Could you please tell me how to fix this so that 'continue shopping' button always goes back to the front page? Thanks.
  #5  
Old 06-12-2014, 12:09 PM
The Little Shop of Chocs's Avatar
The Little Shop of Chocs The Little Shop of Chocs is offline
 
Join Date: Mar 2014
Posts: 9
Default

I think what's happening is that when you click 'empty bag' the 'continue shopping' content is loaded into the page by javascript. A new page is not loaded. The ecwid code to force the redirect only works when a new page is loaded, so the redirect is not forced when you click 'continue shopping' in this instance. However it does work when the page is reloaded because then the ecwid code is triggered and the redirect is then added to the button...
  #6  
Old 06-13-2014, 09:17 AM
The Little Shop of Chocs's Avatar
The Little Shop of Chocs The Little Shop of Chocs is offline
 
Join Date: Mar 2014
Posts: 9
Default

I have a solution. It's not pretty.

Add this jQuery to your shop.php page

Quote:
var continueShoppingRedirect = "name_of_redirect_page";

var checkContents = setInterval(function(){

if ($(".gwt-Button").length > 0){ // Check if element has been found

$(this).click(function() {
location.href = continueShoppingRedirect;
});

}

},250);
This checks for the presence of the button every 250 milliseconds. When it appears, it adds the link.

Sometimes the categories did appear before the redirect happened so I added this to the css

.ecwid-productBrowser-CategoryPage {
display:none;
}

but I'm not using the category page anywhere so it doesn't matter if it doesn't appear at all.

A shorter interval might have helped. If you have a better way of doing it please let me know.
The Following User Says Thank You to The Little Shop of Chocs For This Useful Post:
Rick G (07-15-2014)
  #7  
Old 05-27-2015, 07:18 AM
jovier mark's Avatar
jovier mark jovier mark is offline
Junior Member
 
Join Date: May 2015
Posts: 1
Default javascript redirect

Check this one.....Javascript Redirect

Hope this will help you

Mark
 
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Tags
cart, continue shopping, javascript, redirect, shopping bag

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:03 PM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.