continue shopping button - redirection not workig

  • Posts: 28
  • Thank you received: 0
13 years 8 months ago #11353

And the next problem ... maybe I have bad karma or so :unsure:

I want the customer to be redirected to the product category page after clicking on the "continue shopping" button. Because I only have one category I don't need this workaround with editing a file that I found searching this forum. The "Continue shopping button's URL" field on the "checkout" tab should do that too. But it seems this isn't working, nothing happens after clicking the button (except of closing the popup notice) no matter what URL I insert in this field.

The button is also displayed if the URL field is empty, according to a post here in the forum the button should only be displayed IF there is a URL to redirect ...

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 8 months ago #11357

The continue button option is for the continue button on the checkout. For the continue button in the popup notice, it only closes the popup.

Please Log in or Create an account to join the conversation.

  • Posts: 28
  • Thank you received: 0
13 years 8 months ago #11363

I see ... on the checkout the button works and redirects the user to whatever URL I set. ^^

But I need a redirection for the button in the popup. There is no sense in this button if it's only closing the popup. It's quite uncomfortable for the user to first click on the back button in the browser or clicking in the menu to go back to the category after putting a product in the cart.

Edit: Let the user go back threw the back button in the browser is bad for another reason too: the cart module isn't updated and therefore the user won't see the product in the cart

Last edit: 13 years 8 months ago by RemoteC.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 8 months ago #11364

In that case, you can edit the file notice of the view checkout via the menu Display->Views and change the code:

echo $this->cartClass->displayButton(JText::_('CONTINUE_SHOPPING'),'continue_shopping',$this->params,'','try{	window.top.document.getElementById(\'sbox-window\').close(); }catch(err){ window.top.SqueezeBox.close(); } return false;','id="hikashop_add_to_cart_continue_button"');

to:
echo $this->cartClass->displayButton(JText::_('CONTINUE_SHOPPING'),'continue_shopping',$this->params,'','window.top.location.href=\''.JRoute::_($this->config->get('continue_shopping')).'\'; return false;','id="hikashop_add_to_cart_continue_button"');

Last edit: 13 years 8 months ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 28
  • Thank you received: 0
13 years 8 months ago #11368

Thanks but your code isn't working. I tried to figure out why but I don't know. Maybe there is a problem with the whole quotation marks and escaping them?!

This code works:

$this->cartClass->displayButton(JText::_('CONTINUE_SHOPPING'),'continue_shopping',$this->params,'','window.top.location.href=\'index.php?option=com_hikashop&view=product&layout=listing&Itemid=111\'; return false;','id="hikashop_add_to_cart_continue_button"');

But honestly: This isn't a very nice solution, your approach is ways better ;)

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 8 months ago #11370

I used double quotes so you don't need to escape them inside simple quotes strings. I've changed my code so that it uses simplde quotes with escaping but that should make no difference.

Please Log in or Create an account to join the conversation.

  • Posts: 234
  • Thank you received: 4
11 years 10 months ago #84537

Hello, perhaps a very basic question but I would like the Continue Shopping button to just be a back button.

Thanks
Iain

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #84663

Hi,

You can edit the view "Checkout / step" in HikaShop > Display > Views, and at the end of the file, you can replace

echo $this->cart->displayButton(JText::_('CONTINUE_SHOPPING'),'continue_shopping',$this->params,JRoute::_($this->continueShopping),'window.location=\''.JRoute::_($this->continueShopping).'\';return false;','id="hikashop_checkout_shopping_button"');
By the code for your return button.

Please Log in or Create an account to join the conversation.

  • Posts: 234
  • Thank you received: 4
11 years 10 months ago #84674

Thank you for that but I can't get the code to do anything, I have tried history.back() or history.back(-1) but nothing works. I have also tried to change the code so that it uses the code of RemoteC and get it to move to a different page. But nothing.

Any help would be very much appreciated.

Iain

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #84717

Instead of the code given, try to use this one:

?><a href="javascript:history.back()">Your button</a><?php

The following user(s) said Thank You: mad-q

Please Log in or Create an account to join the conversation.

  • Posts: 234
  • Thank you received: 4
11 years 10 months ago #84806

Thank you for that, found what was wrong, the code is in Checkout > Notice and changed

<?php echo $this->cartClass->displayButton(JText::_('CONTINUE_SHOPPING'),'continue_shopping',$this->params,'','try{ window.top.document.getElementById(\'sbox-window\').close(); }catch(err){ window.top.SqueezeBox.close(); } return false;','id="hikashop_add_to_cart_continue_button"'); ?>

to

<a href="javascript:history.back()">Continue Shopping</a>

Many Thanks
Iain

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #84848

Ok you were talking about this continue shopping button ;)

Please Log in or Create an account to join the conversation.

  • Posts: 234
  • Thank you received: 4
11 years 10 months ago #84902

Well, actually me thinking you were talking about that one. At present I have a nasty text line which says "continue shopping" how can I make this look like the other one within a button.

Thank You

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #84985

You have to add an input button like that:

<input id="hikashop_checkout_shopping_button" class="btn button hikashop_cart_input_button" type="button" onclick="javascript:history.back()" value="Continue shopping" name="continue_shopping">

The following user(s) said Thank You: mad-q

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 0
10 years 1 month ago #175290

I'm using essential v2.3.3

I have a very simple cart. I have only one category (default) and I would like to be able to redirect my customer back to the category page when they click on the "Continue Shopping" button on the popup notice. It works fine with the checkout page "Continue Shopping" button.

I have tried without success to modify the code to redirect to a specific page (not a programmer, but I try).

The cloest I have come is using this recommended code in the checkout/notoice.php


echo $this->cartClass->displayButton(JText::_('CONTINUE_SHOPPING'),'continue_shopping',$this->params,'','window.top.location.href=\''.JRoute::_($this->config->get('continue_shopping')).'\'; return false;','id="hikashop_add_to_cart_continue_button"');


I'm trying to get to "index.php/givingcards" but it returns "index.php/givingcards/givingcards" so I get the 404 page error of course.

I have "index.php/givingcards" set in the Continue Shopping button's URL box in the checkout tab, and the same thing on the main tab for "URL where you will be redirected when the cart is empty" if that matters.

I'd be happy to even hard code this if I knew how. Can you give me some direction?
Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 1 month ago #175460

Hi,

In the view "checkout / notice", you have to replace the code:

<?php echo $this->cartClass->displayButton(JText::_('CONTINUE_SHOPPING'),'continue_shopping',$this->params,'','window.parent.hikashop.closeBox(); return false;','id="hikashop_add_to_cart_continue_button"'); ?>
By:
<input type="button" onclick="window.parent.location.href = 'www.yoursite.com'; return false;" class="btn button" value="<?php echo JText::_('CONTINUE_SHOPPING'); ?>"/>
Then just replace " www.yoursite.com " by the desired page.

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 0
10 years 1 month ago #175555

That did it!
Thank you so much.

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 0
10 years 1 month ago #175618

I spoke too soon. Sorry.
So it is returning to my category page properly now after adding an item to the shopping cart and clicking on "Continue Shopping" in the popup dialog box, but then the shopping cart is emptied upon return. This only happens the first time. If I add an item again, it will remain in the shopping cart after clicking on the Continue Shopping button in the popup.

Update: with more testing, I have found clearing out the cookies in the browser makes it work properly, sort of. It will work the first time I open the browser, add an item to the cart, then click on "Continue Shopping" in the popup. After I check out, if I go back to the category page, select a product, add to cart, (which it clearly adds to the cart) then click on the "Continue Shopping" button in the popup, the cart will clear out to empty. Weird.

Last edit: 10 years 1 month ago by stereo3dguy.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 1 month ago #175867

Hi,

I tried to reproduce the problem on several browsers on my end on your website but each time it worked fine. So all I can think of is there there is something with your browser.
Do you reproduce the issue on other browsers ?
What browser are you using ? Which version ?

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 0
10 years 1 month ago #175870

I'm using Firefox 33.0.
and Internet Explorer 11.0.12
and Chrome 37.0.2062.124 m
Where it was happening all the time, it's now only happening occasionally.
I've posted a short video showing the malfunction
www.3d-web.com/IMG_0057.MOV
I wish it would either happen every time or not at all, but this occasionally makesit difficult to track down.

Update: Just noticed that if I hit the back key on the browser, the shopping cart WILL have the item in the cart! Hopefully that's a clue.

Last edit: 10 years 1 month ago by stereo3dguy.

Please Log in or Create an account to join the conversation.

Time to create page: 0.122 seconds
Powered by Kunena Forum