- Posts: 1
- Thank you received: 0
Use catologemode and webshop
14 years 5 months ago #47556
by Sietse
Use catologemode and webshop was created by Sietse
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
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.
14 years 5 months ago #47587
by Xavier
Replied by Xavier on topic Re: Use catologemode and webshop
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:
To:
$item_ids are the items where the button "Add to cart" has to be displayed.
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:
Code:
<?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>
Code:
<?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.205 seconds