Use catologemode and webshop

  • Posts: 1
  • Thank you received: 0
12 years 9 months ago #47556

I've got a question

At the moment I only use hikashop in cataloge mode. That works fine so far, because most of the products I don't have in stock and don't want people ordering them online, so no shoppingcart button should be shown with these products. But I do have some products in stock and to make it posible for people ordering those I do need a shoppingcart button. Is there a way to overrule the cataloge mode and only show a shoppingcart button with those products?

Best regards,

Sietse

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

  • Posts: 13201
  • Thank you received: 2322
12 years 9 months ago #47587

Hi Sietse,

I think the best way is to disable the Catalog mode, and add this code to hide the "Add to cart" for all the product except some products defined by ID.

In HikaShop > Display > Views, you can edit the view "Product / show.php" (or show_default.php it depends of your HikaShop version.)

Change:

	<?php } ?>
	<div id="hikashop_product_quantity_main" class="hikashop_product_quantity_main">
		<?php
		$this->row = & $this->element;
		$this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\'' . $this->row->product_id . '\',field,1' . $form . '); } else { return false; }';
		$this->setLayout('quantity');
		echo $this->loadTemplate();
		?>
	</div>
To:
	<?php }
	$item_ids = array('5','1');
	$item_cart = 0;
	foreach($item_ids as $key => $value){
		if($this->row->product_id == $value){
			$item_cart = 1;
		}
	}
	if($item_cart == 1){?>
	<div id="hikashop_product_quantity_main" class="hikashop_product_quantity_main">
		<?php
		$this->row = & $this->element;
		$this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\'' . $this->row->product_id . '\',field,1' . $form . '); } else { return false; }';
		$this->setLayout('quantity');
		echo $this->loadTemplate();
		?>
	</div>
	<?php } ?>

$item_ids are the items where the button "Add to cart" has to be displayed.

The following user(s) said Thank You: Sietse

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

Time to create page: 0.051 seconds
Powered by Kunena Forum