external store quantity override

  • Posts: 15
  • Thank you received: 2
1 month 6 days ago #365872

-- HikaShop version -- : 5.1.0
-- Joomla version -- : 5.2.2
-- PHP version -- : 8.1.28
-- Browser(s) name and version -- : chrome latest, firefox, etc.

Hi guys!

Again, I have a complex question: is it possible to manage external stock? It would be important to be able to order only the existing quantity (e.g. 2pcs), but to show the quantity increased by a value stored in a custom field (e.g. extstore) and the quantity selector also uses this value (e.g. extstore value=4, so the full value is 6pcs)?

This would be important because I can't put what is in external stock into the order, I can only contact the customer via email (e.g. RSForm form).

This way I could manage the order itself (original quantity) and the enquiry (extstock quantity) in one interface.

My question would be how can I override the default quantity handler in hikashop, is there any solution?

Thanks in advance!

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

  • Posts: 83512
  • Thank you received: 13511
  • MODERATOR
1 month 6 days ago #365873

Hi,

This plugin www.hikashop.com/marketplace/product/109...rder-by-obsidev.html allows you to have a "pre order stock" on top of the default stock for each product.
Once the normal stock reaches 0, the product can still be purchased until the pre order stock reaches 0.
So it seems to match with what you're describing.

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

  • Posts: 15
  • Thank you received: 2
1 month 6 days ago #365876

Pre-order is not working well for me because you cannot put the maximum quantity in the cart at once. So you have to consume the default stock first, and then you can only use it afterwards.

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

  • Posts: 83512
  • Thank you received: 13511
  • MODERATOR
1 month 5 days ago #365881

Hi,

Then, you can use a custom product field, and in a plugin, you can implement the onAfterLoadProductPrice event:
www.hikashop.com/support/documentation/6...fterLoadProductPrice
In $element, you have either an object of a product and you can change $element->product_quantity to what you want, or you have an array of product objects and you can loop on the array to change product_quantity on all of them.

The following user(s) said Thank You: mizso676

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

  • Posts: 15
  • Thank you received: 2
1 month 5 days ago #365891

Thanks for your help!

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

Time to create page: 0.046 seconds
Powered by Kunena Forum