Continue and Next buttons on first page of checkou

  • Posts: 70
  • Thank you received: 4
11 years 9 months ago #119879

-- url of the page with the problem -- : http://www.charitymobi.org/purchase-ticket/checkout
-- HikaShop version -- : 2.2.0
-- Joomla version -- : 3.1.5

On the first step of our checkout page a "Continue" and "Next" button are appearing.



I am pretty sure the continue button has to do with user registration and the next button is part of the checkout process.

1. Are they both needed?
2. If they both do the same thing, what is the best way to hide the continue button? (I want to keep the next button since it has the same text and in same place as all of the other checkout screens)

Thanks! -- Steven

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

  • Posts: 12953
  • Thank you received: 1778
11 years 9 months ago #119895

Hi,

The continue button will test each field of your registration form, and the next button will only test if your username (email) is already used.
So if you hide the continue button, your registration won't be completely checked, and if you hide the next button, you won't be able to go through the next step if you're already logged in.

I think that the "best" solution will be to :
- Edit the checkout workflow through "Hikashop->System->Configuration->Checkout"
- Put only the "login" action through the first step
- Edit the Step file of the Checkout view of your front-end template and change this line :

if($this->nextButton){
By :
if($this->nextButton && $this->step != 0){

Last edit: 11 years 9 months ago by Mohamed Thelji.

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

  • Posts: 70
  • Thank you received: 4
11 years 9 months ago #119897

Thanks so much for the reply and suggestion.

I already had the login step as the only item on the first step, so that was done. (I changed the name to shipping)

I had modified

if($this->nextButton){

to
if($this->step==4){ 
echo $this->cart->displayButton('Purchase Ticket','next',$this->params,hikashop::completeLink('checkout&task=step&step='.$this->step+1),'document.forms[\'hikashop_checkout_form\'].submit(); return false; ','id="hikashop_checkout_next_button"'); 
}else{ 
echo $this->cart->displayButton(JText::_('NEXT'),'next',$this->params,hikashop::completeLink('checkout&task=step&step='.$this->step+1),'document.forms[\'hikashop_checkout_form\'].submit(); return false;','id="hikashop_checkout_next_button"'); 
}

So that I could change the text on the purchase step to custom text.

With the modifications I have made what should the new if statement look like?

Thanks! -- Steven

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

  • Posts: 2334
  • Thank you received: 403
11 years 9 months ago #119901

Your solution seems good.
It's way easier than changing the behavior of these button.
However I'm not sure I understood your question, which "if" are you talking about?

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

  • Posts: 70
  • Thank you received: 4
11 years 9 months ago #119906

I am not sure how to write an if statement that will show the custom text on final checkout step and NOT display the next button on the first step (so only the continue button shows).

Here is our product page
www.charitymobi.org/purchase-ticket/product

you can go through the checkout to see how it works.

-- Steven

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

  • Posts: 2334
  • Thank you received: 403
11 years 9 months ago #119986

Well in this case the code Mohamed gave you should work fine :)

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

  • Posts: 70
  • Thank you received: 4
11 years 9 months ago #120083

Thanks for the reply.

I am not sure how to combine

if($this->nextButton && $this->step != 0){

and
if($this->step==4){

so the buttons work the way I need them to.

Thanks! -- Steven

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

  • Posts: 70
  • Thank you received: 4
11 years 9 months ago #120090

I think I got it.

Does this look correct?

if($this->step==4){     
echo $this->cart->displayButton('Purchase Ticket','next',$this->params,hikashop::completeLink('checkout&task=step&step='.$this->step+1),'document.forms[\'hikashop_checkout_form\'].submit(); return false; ','id="hikashop_checkout_next_button"'); 
}elseif($this->nextButton && $this->step != 0){ 
echo $this->cart->displayButton(JText::_('NEXT'),'next',$this->params,hikashop::completeLink('checkout&task=step&step='.$this->step+1),'document.forms[\'hikashop_checkout_form\'].submit(); return false;','id="hikashop_checkout_next_button"'); 
}

Everything seems to work.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 9 months ago #120099

I think that you should use something like :

if($this->nextButton){
if($this->step != 0 && $this->step != 4){ 
echo $this->cart->displayButton(JText::_('NEXT'),'next',$this->params,hikashop::completeLink('checkout&task=step&step='.$this->step+1),'document.forms[\'hikashop_checkout_form\'].submit(); return false;','id="hikashop_checkout_next_button"'); 
}
if($this->step==4){ 
echo $this->cart->displayButton('Purchase Ticket','next',$this->params,hikashop::completeLink('checkout&task=step&step='.$this->step+1),'document.forms[\'hikashop_checkout_form\'].submit(); return false; ','id="hikashop_checkout_next_button"'); 
}
}

Last edit: 11 years 9 months ago by Mohamed Thelji.
The following user(s) said Thank You: intown

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

  • Posts: 70
  • Thank you received: 4
11 years 9 months ago #120121

Thanks so much for the code!

You guys are the best! -- Steven

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

Time to create page: 0.111 seconds
Powered by Kunena Forum