[Skip to main content](#vessel-content)

#   Add a "previous step" button during checkout

##

- **[tinachou](/forum/user/11887-tinachou "View tinachou's Profile")**
- [![tinachou's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/11887-tinachou "View tinachou's Profile") Topic Author
- [ Offline](/forum/user/11887-tinachou)

Less More

- Posts: 107
- Thank you received: 1
-
-

13 years 10 months ago -  13 years 10 months ago [\#82687](#82687) by [tinachou](/forum/user/11887-tinachou "View tinachou's Profile")  *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#82687 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")* was created by *[tinachou](/forum/user/11887-tinachou "View tinachou's Profile")*

Hi there,

There are talks relating to changing the "next step" button of the last step to "confirm order" button.

But I need to add a "**go previous step**" button during the checkout process.

It's because I don't use breadcrumb; also, I realized when I use the "previous page" button of browsers, such as IE, errors will appear.

I think the best way is to add a "previous button".

Can you give me some insights how to do it?

Thank you so much. ![:)](/media/kunena/emoticons/3.png ":)")

Last edit: 13 years 10 months ago by [tinachou](/forum/user/11887-tinachou "View tinachou's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 10 months ago [\#82763](#82763) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#82763 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

Hi,

You try the code below in the view "checkout / step" in HikaShop &gt; Display &gt; Views. Code:

echo $this-&gt;cart-&gt;displayButton(JText::_('HIKA_NEXT'),'next',$this-&gt;params,hikashop_completeLink('checkout&amp;task=step&amp;step='.($this-&gt;step+1)),'','id="hikashop_checkout_previous_button"');

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[tinachou](/forum/user/11887-tinachou "View tinachou's Profile")**
- [![tinachou's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/11887-tinachou "View tinachou's Profile") Topic Author
- [ Offline](/forum/user/11887-tinachou)

Less More

- Posts: 107
- Thank you received: 1
-
-

13 years 10 months ago -  13 years 10 months ago [\#82770](#82770) by [tinachou](/forum/user/11887-tinachou "View tinachou's Profile")  Replied by *[tinachou](/forum/user/11887-tinachou "View tinachou's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#82770 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

Dear,

I changed code like this:
Code:

&lt;?php if($this-&gt;nextButton){ echo $this-&gt;cart-&gt;displayButton(JText::_('HIKA_NEXT'),'next',$this-&gt;params,hikashop_completeLink('checkout&amp;task=step&amp;step='.($this-&gt;step+1)),'if(hikashopCheckChangeForm(\'order\',\'hikashop_checkout_form\')){ if(hikashopCheckMethods()){ document.getElementById(\'hikashop_validate\').value=1; document.forms[\'hikashop_checkout_form\'].submit();}} return false;','id="hikashop_checkout_next_button"'); echo $this-&gt;cart-&gt;displayButton(JText::_('HIKA_BACK'),'next',$this-&gt;params,hikashop_completeLink('checkout&amp;task=step&amp;step='.($this-&gt;step-1)),'','id="hikashop_checkout_previous_button"'); } ?&gt;

I changed "HIKA_NEXT" to "HIKA_BACK", " step+1" becomes "step-1".

But I don't know what is the parameter "**next**" for? is it required to be changed accordingly?

Also, How can I make the initial step doesn't have the "previous button"?

Thank you so much. ![:kiss:](/media/kunena/emoticons/12.png ":kiss:")

Last edit: 13 years 10 months ago by [tinachou](/forum/user/11887-tinachou "View tinachou's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 10 months ago [\#82792](#82792) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#82792 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

You don't have to change the "next" after the "HIKA_BACK" text, it's just to recognize the kind of button, and it's the same type as the next.
To not display this button on the first step, you have to add a if condition like: Code:

if($this-&gt;step != 0) echo $this-&gt;cart-&gt;displayButton(JText::_('HIKA_BACK'),'next',$this-&gt;params,hikashop_completeLink('checkout&amp;task=step&amp;step='.($this-&gt;step-1)),'','id="hikashop_checkout_previous_button"');

The following user(s) said Thank You: [tinachou](/forum/user/11887-tinachou "View tinachou's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[tinachou](/forum/user/11887-tinachou "View tinachou's Profile")**
- [![tinachou's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/11887-tinachou "View tinachou's Profile") Topic Author
- [ Offline](/forum/user/11887-tinachou)

Less More

- Posts: 107
- Thank you received: 1
-
-

13 years 10 months ago [\#82807](#82807) by [tinachou](/forum/user/11887-tinachou "View tinachou's Profile")  Replied by *[tinachou](/forum/user/11887-tinachou "View tinachou's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#82807 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

Dear X.,

Your reply is professional and helpful.

I am really grateful. ![:)](/media/kunena/emoticons/3.png ":)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")**
- [![skullboy74's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar_2012-12-29.jpg)](/forum/user/9936-skullboy74 "View skullboy74's Profile")
- [ Offline](/forum/user/9936-skullboy74)

Less More

- Posts: 19
- Thank you received: 0
-
-

13 years 10 months ago [\#83690](#83690) by [skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")  Replied by *[skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#83690 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

I was looking for this feature and ran a search and found this topic.
This seems like a standard checkout feature - a back button.
Is there a reason that it wasn't added into HikaShop, or was not atleast given as an on/off option?
Just a *HikaShop Business* newbie askin some questions. ![B)](/media/kunena/emoticons/9.png "B)")

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")**
- [![skullboy74's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar_2012-12-29.jpg)](/forum/user/9936-skullboy74 "View skullboy74's Profile")
- [ Offline](/forum/user/9936-skullboy74)

Less More

- Posts: 19
- Thank you received: 0
-
-

13 years 10 months ago [\#83717](#83717) by [skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")  Replied by *[skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#83717 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

I've been trying to put together a **Back** and a**Finish** button into my checkout process.
I've culled together different posts (mostly from Xavier), edited Checkout/step .php, and here is what I have so far...

Code:

&lt;?php if($this-&gt;nextButton){ if($this-&gt;step==2){ echo $this-&gt;cart-&gt;displayButton('Finish','next',$this-&gt;params,hikashop::completeLink('checkout&amp;task=step&amp;step='.$this-&gt;step+1),'document.forms[\'hikashop_checkout_form\'].submit(); return false; ','id="hikashop_checkout_next_button"'); } else{echo $this-&gt;cart-&gt;displayButton(JText::_('NEXT'),'next',$this-&gt;params,hikashop::completeLink('checkout&amp;task=step&amp;step='.$this-&gt;step+1),'document.forms[\'hikashop_checkout_form\'].submit(); return false;','id="hikashop_checkout_next_button"'); } if($this-&gt;step!=0){ echo $this-&gt;cart-&gt;displayButton(JText::_('BACK'),'next',$this-&gt;params,hikashop::currentUrl(),'history.back();return false;','id="hikashop_checkout_back_button"'); } } ?&gt; &lt;/form&gt;

Everything ALMOST works perfectly.

**checkout**: has [Next Button] and it works fine.
**step-1**: has [Back Button] &amp; [Next Button] - Both works fine.
**step-2**: has [Back Button] &amp; [Finish Button] - [Finish] works ok. But [Back Button] gives error.

> Confirm Form Resubmission
> This webpage requires data that you entered earlier in order to be properly displayed. You can send this data again, but by doing so you will repeat any action this page previously performed. Press Reload to resend that data and display this page

This is the same error I would get if I just clicked the Back button on the browser navigation.

my Checkout Workflow: cart,login_address_shipping_coupon,payment_status_fields_confirm,end

I've tried messing with things, but I'm at a loss.
Any assistance would be great.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14279
-
-

13 years 9 months ago [\#84013](#84013) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#84013 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

Hi,

There is no such back button by default because usually, people will activate the display of the progress bar in the configuration and the links on the progress bar allow the user to move from one step to another and on top of that, the user can see where he is on the checkout.

The message that you get is normal since you do a history.back() on the back button which equals clicking on the back button of the browser. That's not an error. just a message from your browser telling you to resubmit the data to the server (which is not a problem).

If you just want a back button which will go to the step you want, you'll have to use something like that:
echo $this-&gt;cart-&gt;displayButton(JText::_('BACK'),'next',$this-&gt;params,hikashop::currentUrl(),'window.location=\''.hikashop::completeLink('checkout&amp;task=step&amp;step='.$this-&gt;step-1).'\';return false;','id="hikashop_checkout_back_button"');

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")**
- [![skullboy74's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar_2012-12-29.jpg)](/forum/user/9936-skullboy74 "View skullboy74's Profile")
- [ Offline](/forum/user/9936-skullboy74)

Less More

- Posts: 19
- Thank you received: 0
-
-

13 years 9 months ago [\#84062](#84062) by [skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")  Replied by *[skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#84062 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

hmmm....
Didn't exactly work for me.

I edited the code to be the following.
Code:

&lt;?php if($this-&gt;nextButton){ if($this-&gt;step==2){ echo $this-&gt;cart-&gt;displayButton('Finish','next',$this-&gt;params,hikashop::completeLink('checkout&amp;task=step&amp;step='.$this-&gt;step+1),'document.forms[\'hikashop_checkout_form\'].submit(); return false; ','id="hikashop_checkout_next_button"'); } else{echo $this-&gt;cart-&gt;displayButton(JText::_('NEXT'),'next',$this-&gt;params,hikashop::completeLink('checkout&amp;task=step&amp;step='.$this-&gt;step+1),'document.forms[\'hikashop_checkout_form\'].submit(); return false;','id="hikashop_checkout_next_button"'); } if($this-&gt;step!=0){ echo $this-&gt;cart-&gt;displayButton(JText::_('BACK'),'next',$this-&gt;params,hikashop::currentUrl(),'window.location=\''.hikashop::completeLink('checkout&amp;task=step&amp;step='.$this-&gt;step-1).'\';return false;','id="hikashop_checkout_back_button"'); } } ?&gt; &lt;/form&gt;

But I get a '404 Error' because it sends me to "www.....com/store/***-1***" no matter what page it's on.
The code I had before worked on Step 1(took me back to Step 0), but not Step 2; the code that you kindly gave unfortunately works on neither.
Did I implement it incorrectly? It's possible. :blush: I'm coding while packing. hehehe.
Thanks and looking forward to getting this rolling. ![B)](/media/kunena/emoticons/9.png "B)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 9 months ago [\#84202](#84202) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#84202 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

Hi,

I did not see parentheses in your code (like the code that Xavier gives).
After that, when using hikashop_completeLink for Javascript code, you should use the parameters. Code:

hikashop_completeLink($link,$popup = false,$redirect = false)

$popup should stay "false" but $redirect should be set to "true" (for better javascript serialization).

After that, adding some parentheses for the "($this-&gt;step - 1)" should be better.
Checking the generated code would be useful too.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")**
- [![skullboy74's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar_2012-12-29.jpg)](/forum/user/9936-skullboy74 "View skullboy74's Profile")
- [ Offline](/forum/user/9936-skullboy74)

Less More

- Posts: 19
- Thank you received: 0
-
-

13 years 9 months ago -  13 years 9 months ago [\#84301](#84301) by [skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")  Replied by *[skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#84301 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

Thanks for the help Jerome.
I'll be honest... I haven't a clue about any of the stuff you just said.

> I did not see parentheses in your code (like the code that Xavier gives).

which parentheses? where should I be looking?

> After that, when using hikashop\_completeLink for Javascript code, you should use the parameters.
>
> Code:
>
> hikashop_completeLink($link,$popup = false,$redirect = false)
>
>
>
> $popup should stay "false" but $redirect should be set to "true" (for better javascript serialization).

I haven't seen this code implemented. how should I do it?

> After that, adding some parentheses for the "($this-&gt;step - 1)" should be better.

Where should the parentheses go? I thought I had them correct.

> Checking the generated code would be useful too.

What do you mean by this?

I feel rather depressed now as I seem to be more lost than before. ![:(](/media/kunena/emoticons/22.png ":(")

Last edit: 13 years 9 months ago by [skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 9 months ago [\#84319](#84319) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#84319 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

Hi,

Can you try the solution given in that post:
[ www.hikashop.com/fr/forum/2-general-talk...t-go-back.html#82912](http://www.hikashop.com/fr/forum/2-general-talk-about-hikashop/76925-back-button-in-checkout-wont-go-back.html#82912)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")**
- [![skullboy74's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar_2012-12-29.jpg)](/forum/user/9936-skullboy74 "View skullboy74's Profile")
- [ Offline](/forum/user/9936-skullboy74)

Less More

- Posts: 19
- Thank you received: 0
-
-

13 years 9 months ago [\#84453](#84453) by [skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")  Replied by *[skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#84453 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

Hi Xavier,

I had tried that code and had it working, but I could never figure out how to not have it show up on *Step 0*.
It would show up on that step and take me to *Step--1* (which was actually *Step 0* again).

If I could get it to not show up on the first page (cart overview) that would be awesome!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 9 months ago [\#84501](#84501) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#84501 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

Hi,

You can add a check around this button, like: Code:

if($this-&gt;step &gt; 0){ // display the button }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")**
- [![skullboy74's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar_2012-12-29.jpg)](/forum/user/9936-skullboy74 "View skullboy74's Profile")
- [ Offline](/forum/user/9936-skullboy74)

Less More

- Posts: 19
- Thank you received: 0
-
-

13 years 9 months ago -  13 years 9 months ago [\#84634](#84634) by [skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")  Replied by *[skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#84634 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

I tried it but it goes to white screen.

This is how I have the code and what it looks like (including the colors it shows) - I couldnt get the post to show it right with the {code} thing. The red text actually shows as black in the code box in hikashop, but it's too hard to see it black so I made it red.

&lt;?php
if($this-&gt;nextButton){

if($this-&gt;step==2){
echo $this-&gt;cart-&gt;displayButton('Finish','next',$this-&gt;params,hikashop::completeLink('checkout&amp;task=step&amp;step='.$this-&gt;step+1),'document.forms\[\\'hikashop\_checkout\_form\\'\].submit(); return false; ','id="hikashop\_checkout\_next\_button"');
}
else{echo $this-&gt;cart-&gt;displayButton(JText::\_('NEXT'),'next',$this-&gt;params,hikashop::completeLink('checkout&amp;task=step&amp;step='.$this-&gt;step+1),'document.forms\[\\'hikashop\_checkout\_form\\'\].submit(); return false;','id="hikashop\_checkout\_next\_button"');
}

if($this-&gt;step &gt; 0){
&lt;input onclick="location.href='&lt;?php $stepb = $this-&gt;step-1; echo hikashop\_completeLink('checkout&amp;task=step&amp;step='.$stepb.$url\_itemid);?&gt;'" type="button" name="Back" value="&lt;?php echo JText::\_('HIKA\_BACK'); ?&gt;" class="btn button hikashop\_cart\_input\_button" id="hikashop\_checkout\_previous\_button"; /&gt;
}

}
?&gt;

&lt;/form&gt;

&lt;?php
if($this-&gt;continueShopping){ .................................

Last edit: 13 years 9 months ago by [skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 9 months ago [\#84661](#84661) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#84661 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

Thanks to try that: Code:

&lt;?php if($this-&gt;nextButton){ if($this-&gt;step==2){ echo $this-&gt;cart-&gt;displayButton('Finish','next',$this-&gt;params,hikashop::completeLink('checkout&amp;task=step&amp;step='.$this-&gt;step+1),'document.forms[\'hikashop_checkout_form\'].submit(); return false; ','id="hikashop_checkout_next_button"'); } else{echo $this-&gt;cart-&gt;displayButton(JText::_('NEXT'),'next',$this-&gt;params,hikashop::completeLink('checkout&amp;task=step&amp;step='.$this-&gt;step+1),'document.forms[\'hikashop_checkout_form\'].submit(); return false;','id="hikashop_checkout_next_button"'); } if($this-&gt;step &gt; 0){ ?&gt; &lt;input onclick="location.href='&lt;?php $stepb = $this-&gt;step-1; echo hikashop_completeLink('checkout&amp;task=step&amp;step='.$stepb.$url_itemid);?&gt;'" type="button" name="Back" value="&lt;?php echo JText::_('HIKA_BACK'); ?&gt;" class="btn button hikashop_cart_input_button" id="hikashop_checkout_previous_button"; /&gt; &lt;?php } } ?&gt; &lt;/form&gt;

The following user(s) said Thank You: [skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")**
- [![skullboy74's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar_2012-12-29.jpg)](/forum/user/9936-skullboy74 "View skullboy74's Profile")
- [ Offline](/forum/user/9936-skullboy74)

Less More

- Posts: 19
- Thank you received: 0
-
-

13 years 9 months ago -  13 years 9 months ago [\#84712](#84712) by [skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")  Replied by *[skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile")* on topic *[Add a "previous step" button during checkout](/forum/4-how-to/76880-add-a-previous-step-button-during-checkout#84712 "Hi there,  There are talks relating to changing the &quot;next step&quot; button of the last step to &quot;confirm order&quot; button.  But I need to add a &quot;go previous step&quot; button during the checkout process.  It's because I don't use breadcrumb; also, I realized when I use the &quot;previous page&quot; button of browsers, such as IE, errors will appear.  I think the best way is to add a &quot;previous button&quot;.  Can you give me some insights how to do it?  Thank you so much. :)")*

:woohoo: :woohoo: :woohoo: :woohoo:
YES! that works!!!! MANY Thanks Xavier!!!

Copy pasted that code in and worked flawlessly moving back and forth.

I figured it was me not knowing enough php :blush: . hehehe
You rock.
Again.... THANKS!!

For anyone wanting a {Back} button and a {Finish} Button - This is the way to go. ![B)](/media/kunena/emoticons/9.png "B)")

Last edit: 13 years 9 months ago by [skullboy74](/forum/user/9936-skullboy74 "View skullboy74's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2ODgwLWFkZC1hLXByZXZpb3VzLXN0ZXAtYnV0dG9uLWR1cmluZy1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.170 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
