Skip to main content

Add Back Button on Checkout Pages

More
14 years 1 month ago #63243 by MyWorld
How do I add a "Back" button on the checkout pages please? My pages currently have "Continue Shopping" and "Next" buttons but I would also like to add a "Gack Button.
Code:
<a href="#" onclick="history.back();return false;">Go back</a>

Thank you!!
The following user(s) said Thank You: Lutya

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

More
14 years 1 month ago #63464 by nicolas
You can edit the file "step" of the view "checkout" via the menu Display->Views and add your code there.

Best regards,
Nicolas
The following user(s) said Thank You: Lutya

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

More
14 years 3 weeks ago #65542 by Batas
Hi Nikolas,

I'm also trying to figure out how could I get the "back" button on my checkout page, but I'm not so clever to get how to place that code. Could you please explain that in little more detailed way? Is this just to simply put it at whatever place within file?..
Thank you!

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

More
14 years 3 weeks ago #65732 by nicolas
Hi,

You can't put it randomly in the file. But you can always try and if it doesn't work like you want, move it somewhere else and try again.
The simplest is to put it at the top or the bottom of the file and it will display the link at the top or at the bottom of the checkout.

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

More
13 years 11 months ago #72011 by pattychocs
Hi,

I am also trying to place a Back button on the confirmation page before the customer hits the buy now button. I've found the code to use from previous posts, but still not sure where in the step view to place it. I've tried a few different places, but it either displays both the Continue Shopping button and the Back button next to each other, or the back button replaces the Continue shopping button on all checkout pages. Is there a specific place to put this?

Many thanks,

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

More
13 years 11 months ago #72370 by nicolas
Hi,

You should simply add it at the top of the file.

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

More
13 years 11 months ago #72518 by pattychocs
Thanks, but I would like to replace the "Continue Shopping" button with a "Back" button on the Confirmation page only so that if a customer needs to update something they can go back to their cart to make that change. However I would like only the "Continue Shopping" button to remain on the previous checkout pages.

Is this possible?

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

More
13 years 11 months ago #72781 by nicolas
Everything is possible. There is however a bit more complex as you need to know if you're on the last step or not.
Then, you can just display the normal continue button:
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"');
or your back button.

Here is more information on all that:
www.hikashop.com/en/forum/4-how-to/13429...der-in-checkout.html

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

More
12 years 6 days ago #174183 by joomwalker
Hi there, I too was looking to add the 'Back' button to the checkout pages (even though you can still click on the checkout workflow links to go back). However, after looking at a couple of posts, I have merged other solutions to come up with this addition within the checkout/step.php code just before the </form> tag (hikashop version 2.3.3):
Code:
$checkout_back_button = JText::_('HIKA_BACK'); if($this->step!=0){ echo $this->cart->displayButton($checkout_back_button,'back',$this->params,hikashop::currentUrl(),'history.back();return false;','id="hikashop_checkout_back_button"'); }

Also, in order to float it left, I added this to my hikashop stylesheet - frontend_bluegrass.css file (this is just a modified version of media/com_hikashop/css/frontend_default.css):
Code:
#hikashop_checkout_back_button { float:left; }

And it looks like the other button styles and sits to the left of the Continue Shopping button. Hope this helps others also.
The following user(s) said Thank You: Xavier

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

More
11 years 11 months ago - 11 years 11 months ago #175694 by av.opticom
I followed the instructions from last year and it worked great. I've just upgraded to the latest version and would now like to have the "Next" and "Back" buttons formatted by the template, like the "New" button for addresses (see image, which shows template formatted "New" button and plain "Next" button).

I can change the formatting of "Next" using Firebug by changing type="submit" to type="button", but I can't figure out how do do that permanently within the HikaShop php or css codes.

Thanks.

Dave
Last edit: 11 years 11 months ago by av.opticom.

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

More
11 years 11 months ago #175699 by Xavier
Hi,

You have to add new css properties in the hikashop frontend css file or directly in your template file on the following ids:
Code:
#hikashop_checkout_back_button, #hikashop_checkout_next_button{ /* Your properties */ }

You can get the template properties thanks to firebug and use it for the given ids.

hikashop.com/support/support/documentati...ize-the-display.html

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

More
11 years 11 months ago - 11 years 11 months ago #175856 by av.opticom
Hi Xavier,

Thanks for your quick reply. I couldn't get your suggestion to work, but you gave me the idea to copy the template CSS for buttons into the front-end CSS custom file of Hikashop like this:
Code:
#hikashop_checkout_next_button{ background:#265c91 url(../images/submitbutton_02.png) repeat-x; border: 1px solid transparent; padding: 4px 6px; border-radius: 6px; color: #fff; float:right; }

From what I see in the CSS of the template the buttons should have been formatted like the others, but I have no explanation why they're not. Thanks again!

Dave
Last edit: 11 years 11 months ago by av.opticom.

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

More
11 years 10 months ago #181900 by dyoungers
I know this is an old thread but I added the code:
Code:
$checkout_back_button = JText::_('HIKA_BACK'); if($this->step!=0){ echo $this->cart->displayButton($checkout_back_button,'back',$this->params,hikashop::currentUrl(),'history.back();return false;','id="hikashop_checkout_back_button"'); }

and on some (not all) of the checkout steps I get the browser error/warning: "Confirm Form Resubmission" ... is there a better solution to this?

Thanks!
Dave

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

More
11 years 10 months ago #181953 by Xavier
Hi,

Another solution could be to get the current url and replace the step number to the prevous number instead of doing a "history.back()".
If the url is mydomain.com/checkout/step-2 so replace it by mydomain.com/checkout/step-1 and redirect to this address with some javascript.

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

More
11 years 10 months ago #182028 by dyoungers
ended up adding the following code which seems to work
Code:
if ( $this->step!=0 ){ echo '<a class="btn button hikashop_cart_input_button" id="hikashop_checkout_back_button" href="' . hikashop_completeLink('checkout&task=step&step='.($this->step-1)) . '">' . JText::_('HIKA_BACK') . '</a>'; }

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

Time to create page: 0.301 seconds
Powered by Kunena Forum