- Posts: 4
- Thank you received: 0
Price Calculations plugin
1 year 9 months ago #365263
by Kommas
Price Calculations plugin was created by Kommas
-- HikaShop version -- : 5.1.2
-- Joomla version -- : 4.4.10
-- PHP version -- : 8.1
-- Browser(s) name and version -- : Chrome
i can't seem to figure it out. Very little documentation on the plugin.
I have a custom field with a dropdown box. If the answer is Yes, then i need to add 6.25 euro.
How do i do that.
ChatGPT comes up with this formula, but isn't working {custom_field} == 'Yes' ? ({price} + 6.25) : {price}
Please help!
-- Joomla version -- : 4.4.10
-- PHP version -- : 8.1
-- Browser(s) name and version -- : Chrome
i can't seem to figure it out. Very little documentation on the plugin.
I have a custom field with a dropdown box. If the answer is Yes, then i need to add 6.25 euro.
How do i do that.
ChatGPT comes up with this formula, but isn't working {custom_field} == 'Yes' ? ({price} + 6.25) : {price}
Please help!
Please Log in or Create an account to join the conversation.
1 year 9 months ago #365265
by nicolas
Replied by nicolas on topic Price Calculations plugin
Hi,
You can't write PHP code in the formula.
Supposing that you have two values in your field: 0 (with the title "no") and 1 (with the title "yes"), and supposing that the column name of your custom field is "custom_field" and that your custom field is a custom field of the table "item", you could write this formula:
If the value selected is "no", then the formula will be {price}+6.25*0 and thus the calculated price will be equal to the base price of the product.
If the value selected is "yes", then the formula will be {price}+6.25*1 and thus the calculated price will be equal to the base price of the product plus 6.25.
You can't write PHP code in the formula.
Supposing that you have two values in your field: 0 (with the title "no") and 1 (with the title "yes"), and supposing that the column name of your custom field is "custom_field" and that your custom field is a custom field of the table "item", you could write this formula:
Code:
{price}+6.25*{custom_field}
If the value selected is "yes", then the formula will be {price}+6.25*1 and thus the calculated price will be equal to the base price of the product plus 6.25.
Please Log in or Create an account to join the conversation.
1 year 9 months ago #365268
by Kommas
Replied by Kommas on topic Price Calculations plugin
Thanks, this works. But i still have trouble understanding this kind of formulas.
Now the first field is working, but the second field in the same product is not. I made a extra formula. But it's not counting.
It's for a soccer shirt. First field is for a name on the back, second field is for the number on te back of the shirt
Now the first field is working, but the second field in the same product is not. I made a extra formula. But it's not counting.
It's for a soccer shirt. First field is for a name on the back, second field is for the number on te back of the shirt
Please Log in or Create an account to join the conversation.
1 year 9 months ago #365271
by nicolas
Replied by nicolas on topic Price Calculations plugin
Hi,
Only one formula can apply at the same time.
So you need to merge both formulas together:
Only one formula can apply at the same time.
So you need to merge both formulas together:
Code:
{price}+6.25*{custom_field}+6.25*{custom_field2}
Please Log in or Create an account to join the conversation.
Time to create page: 0.049 seconds