trigger events for product option change
10 years 2 weeks ago #249400
by buzibuzi
trigger events for product option change was created by buzibuzi
-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.4.45
-- Browser(s) name and version -- : chrome 52.0.2743.116 m
Hi,
im developing a plugin that will recalculate product price in the front end based on a certain percentage taken from product option change,
(since product option doesn't have an option to use %)
example:
product name:
"custom business card print"
product variations:
1. amount (100,200,300....)
2. lamination (yes, no)
product options:
1.paper type:
a. normal (price $0) ( total price + 0%)
b. special (price $0) ( total price + 20%)
c. recycled (price $0) ( total price + 35%
d. metal (price $0) ( total price + 70%
challenge:
recalculate total product price on product option change event .
looking for the event trigger that happens after product option change. does this exist ?
if not, what should i do :
1. to catch such an event
2. what function can i use to get current total price, change it and update it on the product page (just like it happens when variations or product options are changed)
Thanks
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.4.45
-- Browser(s) name and version -- : chrome 52.0.2743.116 m
Hi,
im developing a plugin that will recalculate product price in the front end based on a certain percentage taken from product option change,
(since product option doesn't have an option to use %)
example:
product name:
"custom business card print"
product variations:
1. amount (100,200,300....)
2. lamination (yes, no)
product options:
1.paper type:
a. normal (price $0) ( total price + 0%)
b. special (price $0) ( total price + 20%)
c. recycled (price $0) ( total price + 35%
d. metal (price $0) ( total price + 70%
challenge:
recalculate total product price on product option change event .
looking for the event trigger that happens after product option change. does this exist ?
if not, what should i do :
1. to catch such an event
2. what function can i use to get current total price, change it and update it on the product page (just like it happens when variations or product options are changed)
Thanks
Please Log in or Create an account to join the conversation.
10 years 2 weeks ago #249403
by nicolas
Replied by nicolas on topic trigger events for product option change
Hi,
You can edit the file "option" of the view "product" via the menu Display>Views.
There, you can modify the javascript code to add your own code and recalculate the product price based on your needs.
You'll see in the javascript code there, the total price calculated is in price_with_options.value
You can edit the file "option" of the view "product" via the menu Display>Views.
There, you can modify the javascript code to add your own code and recalculate the product price based on your needs.
You'll see in the javascript code there, the total price calculated is in price_with_options.value
Please Log in or Create an account to join the conversation.
10 years 2 weeks ago #249468
by buzibuzi
Replied by buzibuzi on topic trigger events for product option change
Thanks very much.
Please Log in or Create an account to join the conversation.
Time to create page: 0.199 seconds