Next Button displayed both top and bottom

  • Posts: 441
  • Thank you received: 24
11 years 4 months ago #139250

I would like to display the next button in checkout in both top and bottom how can i do it?

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

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
11 years 4 months ago #139354

Hi,

There is no option for that. You would have to edit the file "show" of the view "product" via the menu Display>Views and copy/paste the code of the next/previous buttons at the bottom.

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

  • Posts: 441
  • Thank you received: 24
11 years 4 months ago #139366

Ive already tried but when i copy paste it breaks evwrything and display error message. Can you please tell me wich code to copy and whre to insert it. It shold be at the syart bellow the navigation steps

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

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
11 years 4 months ago #139405

It's that code:

if(!empty($this->links->previous))
		echo "<a title='".JText :: _('PREVIOUS_PRODUCT')."' href='".$this->links->previous."'><span class='hikashop_previous_product'></span></a>";
	if(!empty($this->links->next))
		echo "<a title='".JText :: _('NEXT_PRODUCT')."' href='".$this->links->next."'><span class='hikashop_next_product'></span></a>";
	echo "<div class='clear_both'></div>";
that you can put at the end of the file, after adding an opening PHP tag: <?php at the beginning.

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

  • Posts: 441
  • Thank you received: 24
11 years 4 months ago #139422

Are you sure is that code? i mean i want the button next in checkout not the product buttons, the button y want is continue shopping and i think it is in step view.
<?php

if($this->continueShopping){
if(strpos($this->continueShopping,'Itemid')===false){
if(strpos($this->continueShopping,'index.php?')!==false){
$this->continueShopping.=$url_itemid;
}
}
if(!preg_match('#^https?://#',$this->continueShopping)) $this->continueShopping = JURI::base().ltrim($this->continueShopping,'/');
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"');
}
}
?>

<div class="clear_both"></div>
i copy that code but it does not work it displays an error

Last edit: 11 years 4 months ago by condorazul.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 4 months ago #139450

Hi,
You'll just have to use the following code at the beginning of the checkout view's file of the first action of each step of your checkout workflow ("Hikashop->System->Configuration->Checkout"), for example if the first action of one of your step is address, then you'll have to add this code at the begining of the address file of the checkout view of your front-end template through "Hikashop->Display->Views" :

  if($this->nextButton)
    {
      if($this->step == (count($this->steps) - 2)) {
        $checkout_next_button = JText::_('CHECKOUT_BUTTON_FINISH');
        if($checkout_next_button == 'CHECKOUT_BUTTON_FINISH')
          $checkout_next_button = JText::_('NEXT');
      } else
        $checkout_next_button = JText::_('NEXT');
      echo $this->cart->displayButton($checkout_next_button,'next',$this->params, hikashop_completeLink('checkout&task=step&step='.$this->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"');
      $button = $this->config->get('button_style','normal');
         if ($button=='css')
          echo '<input type="submit" style="position: absolute; left: -9999px; width: 1px; height: 1px;"/></input>';
    }

Also, don't forget to add this code around PHP tags : <?php YOURCODE ?>

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

  • Posts: 441
  • Thank you received: 24
11 years 4 months ago #139494

and there is no way to add it in step before the form starts? it woould be in all the pages.
i tried copy/paste there but did not work.

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

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
11 years 4 months ago #139522

Before the form starts, no you should avoid it as it might not work in some cases.

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

Time to create page: 0.078 seconds
Powered by Kunena Forum