A 'Continue shopping button' in the cart module

  • Posts: 13
  • Thank you received: 0
11 years 3 months ago #116423

Is it possible to put an extra button (next or under 'Proceed to checkout') in the cart module.
An extra button 'Continue Shopping' like in the checkout page.
I found this topic on this forum, but I don't know where to place it.

link

Last edit: 11 years 3 months ago by Pistol.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 3 months ago #116432

Hi,

Like Jerome said, you'll have to place it through the cart file of your product view of your front-end template through "Hikashop->Display->Views"

The following user(s) said Thank You: Pistol

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

  • Posts: 13
  • Thank you received: 0
11 years 3 months ago #116442

If I paste following code:

$config =& hikashop_config();
$continueShopping = $config->get('continue_shopping', '');
if(!empty($continueShopping)) {
	global $Itemid;
	$url_itemid='';
	if(!empty($Itemid)){
		$url_itemid='&Itemid='.$Itemid;
	}
	if(strpos($continueShopping,'Itemid') === false) {
		if(strpos($continueShopping,'index.php?') !== false) {
			$continueShopping .= $url_itemid;
		}
	}
	if(!preg_match('#^https?://#',$continueShopping)) $continueShopping = JURI::base().ltrim($continueShopping,'/');
	echo $this->cart->displayButton(JText::_('CONTINUE_SHOPPING'),'continue_shopping',$this->params,JRoute::_($continueShopping),'window.location=\''.JRoute::_($continueShopping).'\';return false;','id="hikashop_checkout_shopping_button"');

at the end of product- cart
All I get is a white page and I can't see my site...

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

  • Posts: 13
  • Thank you received: 0
11 years 3 months ago #116444

Oooooh, I've missed an accolade } or how do you call this in English!!!
Great it works!!!!

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

  • Posts: 45
  • Thank you received: 1
11 years 2 months ago #121969

I copied the code in the other post in my product-cart. However, I'm not an expert in these codes.
So I copied the code directly after the last line before } exit}
Please see below. Is this the correct way to do? If so, nothing has been changed, no continue shopping button was created. What is it that I do wrong?

Regards,

 <input type="hidden" name="url" value="<?php echo $this->params->get('url');?>"/>
    <input type="hidden" name="ctrl" value="product"/>
    <input type="hidden" name="task" value="updatecart"/>
  </form>
  <?php } ?>
</div>
<div class="clear_both"></div>
<?php } ?>
<?php
if(JRequest::getWord('tmpl','')=='component'){
  if(!headers_sent()){
    header('Content-Type: text/css; charset=utf-8');
$config =& hikashop_config();
$continueShopping = $config->get('continue_shopping', '');
if(!empty($continueShopping)) {
  global $Itemid;
  $url_itemid='';
  if(!empty($Itemid)){
    $url_itemid='&Itemid='.$Itemid;
  }
  if(strpos($continueShopping,'Itemid') === false) {
    if(strpos($continueShopping,'index.php?') !== false) {
      $continueShopping .= $url_itemid;
    }
  }
  if(!preg_match('#^https?://#',$continueShopping)) $continueShopping = JURI::base().ltrim($continueShopping,'/');
  echo $this->cart->displayButton(JText::_('CONTINUE_SHOPPING'),'continue_shopping',$this->params,JRoute::_($continueShopping),'window.location=\''.JRoute::_($continueShopping).'\';return false;','id="hikashop_checkout_shopping_button"');
  }
  exit;
}

Last edit: 11 years 2 months ago by Jerome. Reason: code tag makes nice code blocks

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 2 months ago #122045

Hi,

You have to past the code where you want to display the button in the page.
And in your case, I guess that you want to display it under the cart list.

					$this->cart_product_price=false;
				?>
			</tbody>
		</table>

<!-- PASTE THE BLOCK FROM THE OTHER POST RIGHT HERE -->

			<?php
			if($this->params->get('show_cart_quantity',1)){ ?>
				<noscript>
					<input type="submit" class="btn button" name="refresh" value="<?php echo JText::_('REFRESH_CART');?>"/>
				</noscript>
			<?php }
And please, use the code from this post: www.hikashop.com/en/forum/4-how-to/60725...the-cart-module.html

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 11 years 2 months ago by Jerome.

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

Time to create page: 0.098 seconds
Powered by Kunena Forum