add to cart only on some products?

  • Posts: 39
  • Thank you received: 1
11 years 3 months ago #114736

I am looking for a way to have the add to cart button appear on only some products (without setting product quantity to zero). Is this possible?

If HikaShop does NOT provide an easy way to do this could you direct me to the file that processes the product quantity field - perhaps I can tweak it to show quantity as 1 and no add to cart button in response to a particular number? Any other suggested workarounds are welcome as well.

Thank you!

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

  • Posts: 26151
  • Thank you received: 4027
  • MODERATOR
11 years 3 months ago #114763

Hi,

Why you don't want to set the product quantity to zero ?

If you want to customize the display, you can change the view "product | quantity".

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.

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

  • Posts: 39
  • Thank you received: 1
11 years 3 months ago #114782

We want to use the quantity = zero setting to display an "available for order" message. We will also have many products where we'd like to display "# items in stock" messages but without add to cart buttons.

Ideally, we'd have a way to turn the add to cart buttons on or off for each product, but I will attempt to rework the product|quantity view for a solution.

Last edit: 11 years 3 months ago by arinehart.

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

  • Posts: 82731
  • Thank you received: 13345
  • MODERATOR
11 years 3 months ago #114941

Yes. It's actually quite easy.

You can create a custom product field to say if the product should display the add to cart button or not and then add such code at the beginning of the product|quantity view file:
<?php if(!$this->row->show_add_to_cart) return; ?>

(that supposes that the custom product field's column name is show_add_to_cart)

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

  • Posts: 39
  • Thank you received: 1
11 years 3 months ago #115323

Thank you Nicolas - I wish the first reply by had included this simple solution!

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

Time to create page: 0.069 seconds
Powered by Kunena Forum