Do standard HikaShop options not work in combination with price calculations?

  • Posts: 615
  • Thank you received: 23
  • Hikaserial Subscription Hikashop Multisite
3 weeks 9 hours ago #368615

-- HikaShop version -- : 6.1.0
-- Joomla version -- : 5.3.3
-- PHP version -- : 8.4

I used the Price Calculation plugin and it works fine, but as soon as I add an option to the product, the calculation stops working.

Is it correct that these don't work together?
Do I need to create custom fields for the options instead of the standard options feature from Hikashop?

See screenshot for example.

Hope to hear from you.


Kind regards,
Lumiga
Attachments:
Last edit: 3 weeks 9 hours ago by Lumiga.

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

  • Posts: 84498
  • Thank you received: 13740
  • MODERATOR
3 weeks 5 hours ago #368618

Hi,

Both can work together.
The formula result will give the new price of the product.
And in your formula, you don't use the tag {price} to take into account the base price of the product. So this might be something you want to change.

But that's not the main issue you have. If I open the console of my browser and look at the "network" tab, I can see the "calculate" requests sent by the javascript of my browser to your website and the have a Status "500":
i.imgur.com/dkcqcfW.png
This indicates a PHP fatal error during the processing.
And if I click on one request at look at its "preview" tab, I can see a PHP error:
i.imgur.com/7kvZf5j.png

array_keys(): Argument #1 ($array) must be of type array, null given

Unfortunately, this is the small error message which is displayed when the "debug" setting of the Joomla configuration is turned off. It doesn't allow us to really understand where the problem comes from.
Please activate that "debug" setting and check the preview of the request in the network tab of your browser's console. You'll then get the full error message (or leave the setting on so that I can look at it). With the full error message, I'll be able to tell you what to do.

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

  • Posts: 615
  • Thank you received: 23
  • Hikaserial Subscription Hikashop Multisite
2 weeks 6 days ago #368637

Hi Nicolas,

I have turned on the error massages and debug system. Hope you can find the issue.

Also when we publish or unpublish the custom field in the back-end we get an error, see screenshot.



Hope you can find the issue.

What about the calculation. There is no basic price. We set the price to 0.0001
The options must be added on top of the price.
But also with this code it doesn't work:
{price} * ({width_cm}*{height_cm}/10000) * 10

My goal is ultimately to get this calculation into Hikashop. But there will be many more calculations coming.
www.novomark.nl/naamplaten/bereken-aluminium-platen-prijs/


Kind regads,
Lumiga


Kind regards,
Lumiga
Attachments:
Last edit: 2 weeks 6 days ago by Lumiga.

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

  • Posts: 84498
  • Thank you received: 13740
  • MODERATOR
2 weeks 5 days ago #368647

Hi,

It seems that you're using an old version of the Price calculations plugin.
Please update to the latest version and you should not have that error anymore.

Also, if you want the price to be "added", then you need to use "+" in your formula.
If you use "*", the price will be multiplied, not added.

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

  • Posts: 615
  • Thank you received: 23
  • Hikaserial Subscription Hikashop Multisite
2 weeks 5 days ago #368650

Where can we download the latest version?
We bought the plugin 4 days ago and used the download link shown in the screenshot.
The file ID ends with 61. Is that the right one?
In the code we see: * @version 2.0.0 So that looks like the latest version to me.




Kind regards,
Lumiga
Attachments:
Last edit: 2 weeks 5 days ago by Lumiga.

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

  • Posts: 84498
  • Thank you received: 13740
  • MODERATOR
2 weeks 4 days ago #368655

Hi,

Ok, that's actually my bad. I was looking at a different version than the one on our website and I couldn't find the code corresponding to the error. So I wrongly concluded you had an old version while the problem was actually on my end.
I've found the issue now and made a patch, which lead to the release of a new version of the plugin along with other improvements.
Download the new version on our website and install it on yours and you'll get the patch.
It should then work much better.

The following user(s) said Thank You: Lumiga

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

  • Posts: 615
  • Thank you received: 23
  • Hikaserial Subscription Hikashop Multisite
2 weeks 3 days ago #368673

It's working fine now! Thanks.

But the error is still visible.


Kind regards,
Lumiga
Attachments:

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

  • Posts: 84498
  • Thank you received: 13740
  • MODERATOR
2 weeks 3 days ago #368674

Hi,

Oh, I had forgotten about this warning.
This doesn't come from the price calculation plugin.
This comes from the action log plugin.
I've made a patch for this and published a new version of the plugin.
Download the new version on our website and install it on yours and you'll get the patch.

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

Time to create page: 0.090 seconds
Powered by Kunena Forum