follow query product quantities

  • Posts: 846
  • Thank you received: 92
10 years 3 months ago #201124

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 2.5.28
-- PHP version -- : 5.x

Hi
if my product quantities is set to a number ( not unlimited) .
1) How can i follow in php the number of quantities for a product ? When people buy a product ( say quantity 1 ) , in which table cell is increment the product ? Does the product quantities table is decrement ( of 1 here ) ?

2) Is there a way in joomla to maintain a table of history of product quantities ?
in SQL i can use a trigger or view when event occur on quantities but i think joomla or hks wrap this ( mass action ?) !
Thank's

Last edit: 10 years 3 months ago by lionel75.

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

  • Posts: 84220
  • Thank you received: 13673
  • MODERATOR
10 years 3 months ago #201126

Hi,

The quantity of the product is decremented automatically of the purchased quantity in the hikashop_product table in the product_quantity column.
This is done in the file administrator/components/com_hikashop/classes/order_product.php

There is no quantity history data. If that's something you need, it would require the development of a complete plugin to track the changes and store them in a new table in your database.

Last edit: 10 years 3 months ago by nicolas.
The following user(s) said Thank You: lionel75

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

  • Posts: 846
  • Thank you received: 92
10 years 2 months ago #204052

I think i already ask this question . Which hikashop API event i must be use write the plugin ?
I think i don't have to care about all process steps only the one that interest me ? So could hks team confirm that among the list HKS API items event for plugin i have to implement my plug in using product event call onAfterProductUpdate(&$element)

thank's

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

  • Posts: 84220
  • Thank you received: 13673
  • MODERATOR
10 years 2 months ago #204054

Hi,

No. This trigger is not called when the quantity is updated for speed reasons.
Instead, you should use the onAfterOrderUpdate trigger, checking the new and old order_status of the order and if the order is being confirmed, you want to log in your history table the quantity change for each product of the order.

The following user(s) said Thank You: lionel75

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

  • Posts: 846
  • Thank you received: 92
10 years 2 months ago #204142

How quantity value behave if customer can see select buy item that i don't have in stock ?
Does the product quantity goes from 0 to -1 and -1 to -2 ?
Can i configure product quantity to prevent quantity goes to negative value ( don't have in stock because end of product life )

regard's

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

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
10 years 2 months ago #204145

Hi,

A product quantity can't become negative.

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.

Time to create page: 0.062 seconds
Powered by Kunena Forum