Hikashop - Plugin Price Calculations

  • Posts: 345
  • Thank you received: 10
  • Hikashop Business
2 weeks 1 day ago #368020

Hello.
I’m using your HikaShop - Price Calculations plugin to customize product prices based on custom fields and conditional formulas. So far, it works great with simple conditions like:
{etiqueta_001}=="SI" && {cant_etiquetas}=="1" && {grupoetiquetas}=="20u"
and formulas such as:
{price} + 1.5
Now, I need to apply around 216 unique combinations of three parameters:

ancho_etiqueta (label width)

alto_etiqueta (label height)

grupoetiquetas (quantity group)

Each combination requires setting a fixed final price (not an addition to {price}), which I have pre-calculated and organized in a spreadsheet.

For example, one condition and formula would look like this:

Condition:
{etiqueta_001}=="SI" && {ancho_etiqueta}=="3" && {alto_etiqueta}=="4" && {grupoetiquetas}=="500u"
Formula:
49.25
Additionally, please note that ancho_etiqueta and alto_etiqueta are custom fields I created to store label width and height.

My questions are:

Is there any way to bulk import or batch load all these 216 condition + formula rules, for example by CSV, JSON, or another method, instead of adding them manually one by one?

If bulk import is not possible, is there a way to add them directly via configuration files or code?

If neither is possible, are there any performance or technical limitations with having this many rules created manually?

Thank you very much for your help. I really want to maximize the potential of your plugin.

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

  • Posts: 84216
  • Thank you received: 13665
  • MODERATOR
2 weeks 1 day ago #368024

Hi,

You can go in your PHPMyAdmin and open the extensions table of Joomla. There, search for the entry for the calculations plugin. One of the last entries, I suppose.
Edit it, and in the "params" column, you'll find the JSON with all the formulas and conditions of the plugin. So you can follow this structure to generate a new JSON with all the entries you need and update it there and you'll then see all the formulas and conditions when you edit the plugin settings via the Joomla plugins manager.

A few hundred rules won't be a problem.

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

  • Posts: 345
  • Thank you received: 10
  • Hikashop Business
1 week 6 days ago #368032

Good morning,
I'm having trouble displaying some prices using this plugin.

Let me explain what I've done, in case you can help me troubleshoot it.

On a test domain URL, I want to display different options for a product (custom labels).
To show them on the site, I’ve created custom fields (of type "item") associated with this product page.

I’ve created three fields: ancho, alto, cantidad.
Each field is a simple dropdown with the available options.

To calculate the price, I use the plugin logic, with the following condition and formula.

I’ve tested it in two ways:

Option 1
Condition: {ancho}=="2" && {alto}=="4" && {cantidad}=="250"
Formula: {price} = + 11.48 (setting the base product price to 0)

Option 2
Condition: {ancho}=="2" && {alto}=="4" && {cantidad}=="250"
Formula: {price} = 11.48

When I select width 2, height 4, and quantity 250 on the product page, it doesn’t work in either case.

Can you help me figure out what might be going wrong?

Thank you very much in advance.

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

  • Posts: 345
  • Thank you received: 10
  • Hikashop Business
1 week 6 days ago #368034

I've already gotten it to work.
I only need one thing.
Let's see if you can help me.
In the formula I have to put {price} + 7, assuming that I put a price of 0.01 on these items.
Can I put the formula directly {price} = 7
and thus take the value that corresponds to each combination.
If this is not possible, how can I hide the initial price only for a specific url?

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

  • Posts: 84216
  • Thank you received: 13665
  • MODERATOR
1 week 6 days ago #368033

Hi,

The price will be the result of the formula. The tag {price} will be replaced by the base price of the product for the calculation.
So, suppose you have a product with a base price of 10 €.
And you have a formula like this:
{price} + 5
The price displayed will be 5

So, in your case, you want to use a formula like this:
{price} + 11.48

And yes, you can have a formula which directly uses the selected values. For exemple:

({field1}+{field2})*{field3}

With 3 selected in field1, 4 selected in field2 and 10 selected as field3 the calculation would become:
(3+4)*10
So the price would be 70

Last edit: 1 week 6 days ago by nicolas.

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

Time to create page: 0.042 seconds
Powered by Kunena Forum