- Posts: 846
- Thank you received: 92
follow query product quantities
11 years 4 months ago - 11 years 4 months ago #201124
by lionel75
follow query product quantities was created by lionel75
-- 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
-- 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: 11 years 4 months ago by lionel75.
Please Log in or Create an account to join the conversation.
11 years 4 months ago - 11 years 4 months ago #201126
by nicolas
Replied by nicolas on topic follow query product quantities
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.
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: 11 years 4 months ago by nicolas.
The following user(s) said Thank You: lionel75
Please Log in or Create an account to join the conversation.
11 years 3 months ago #204052
by lionel75
Replied by lionel75 on topic follow query product quantities
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
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.
11 years 3 months ago #204054
by nicolas
Replied by nicolas on topic follow query product quantities
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.
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.
11 years 3 months ago #204142
by lionel75
Replied by lionel75 on topic follow query product quantities
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
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.
11 years 3 months ago #204145
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic follow query product quantities
Hi,
A product quantity can't become negative.
Regards,
A product quantity can't become negative.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Time to create page: 0.183 seconds