Restrict Product Quantity

  • Posts: 11
  • Thank you received: 0
  • Hikashop Business
9 years 3 months ago #212456

-- url of the page with the problem -- : www.impress51websites.co.uk/tophat
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.5
-- Browser(s) name and version -- : Firefox 39.0

Hi,

The shop I'm building has unique products and there is only ever one of each product available. Customers should not be able to edit the quantity in the cart. When a product has been sold, an admin user should not be able to increase the quantity back to one and should not be able to edit the product. How would you suggest creating this in a plugin?

Last edit: 9 years 3 months ago by Impress51.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 3 months ago #212457

Hi,

When configuring your products, you can specify a product quantity and also set the "quantity layout".
That "quantity layout" can also be configured for some specific categories or for all your store.
www.hikashop.com/support/documentation/i...op-product-form.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.

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

  • Posts: 11
  • Thank you received: 0
  • Hikashop Business
9 years 3 months ago #212493

Hi, I've worked that part out, but need to know about this:

When a product has been sold, an admin user should not be able to increase the quantity back to one and should not be able to edit the product. How would you suggest creating this in a plugin?

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
9 years 2 months ago #212511

Hi,

An admin user has all the rights. The goal is to be able to do as much modifications as possible.
If you don't want admins to modify products, then remove their right to that in the "Access level" tab of the HikaShop configuration.

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

  • Posts: 11
  • Thank you received: 0
  • Hikashop Business
9 years 2 months ago #212581

Hi, that wasn't what I was asking. A admin should be able to edit products, but the quantity field should be disabled in the backend, because it is always set to one (the products are unique). After a product has sold, the product should not be editable and the quantity should not be able to be increased.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
9 years 2 months ago #212614

Hi,

There is no setting to do that. You will have to edit the file "form" of the view "product" for your backend template via the menu Display>Views and change the line:
if(hikashop_acl('product/edit/quantity')) { ?>
to:
if(hikashop_acl('product/edit/quantity') && @$this->product->product_quantity!= 0) { ?>

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

  • Posts: 11
  • Thank you received: 0
  • Hikashop Business
9 years 2 months ago #212867

Thanks, one more question how can i disable this message?

"Message

Limit reached. Quantity reduced for product:product name here"

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
9 years 2 months ago #212874

Hi,

There is no option to remove it. But you can modify it to suits your needs with a translation override:
hikashop.com/download/languages.html#modify

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

Time to create page: 0.061 seconds
Powered by Kunena Forum