Price per item show total price when item has options

  • Posts: 287
  • Thank you received: 22
3 years 2 months ago #328365

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.24
-- PHP version -- : 7.4

Hi,
I found that when you have products that has no price but get the price through the options it's not showing the price per item in the cart but the total of the items.

Example:
Product 1 has no price but options of 10 euro per option.

If you buy 2 items at 10 euro a piece that the cart show 2 times the 20 euro amount instead of the expected 10 per item and a total of 20 for 2 items.

My cart now looks like this for a product called "red car" with a price of 10 euro's :

ProductNamePrice per single itemAmountTotal
Product1red car20220

Is there an option / view that I could change to make it show the singel price instead of the total?
Not sure if this is a little bug or a feature I didn't know about :)

Last edit: 3 years 2 months ago by nico.van.leeuwen. Reason: solved

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

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
3 years 2 months ago #328381

Hi,

The unit price is supposed to be the sum of the unit price of the main product plus the unit price of each option selected.
There is no option to change that.

If that's not what you see, we would need more information from you to reproduce the issue on your website in odrder to better understand the situation.

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

  • Posts: 287
  • Thank you received: 22
3 years 2 months ago #328389

Hi, I've send an account to your mailbox with a few links and extra explanation.
Hope this makes it clear.

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

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
3 years 2 months ago #328391

Hi,

I see what is the issue.
Edit the file show_block_cart.php via the menu Display>Views and add the code:

$product->prices[0]->unit_price = new stdClass();
				$product->prices[0]->unit_price->price_value = 0;
				$product->prices[0]->unit_price->price_value_with_tax = 0.0;
				$product->prices[0]->unit_price->price_currency_id = hikashop_getCurrency();
after the code:
				$product->prices[0]->price_currency_id = hikashop_getCurrency();
It should then display properly.
We'll add that patch on our end too.

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

  • Posts: 287
  • Thank you received: 22
3 years 2 months ago #328415

Thank you Nicolas,
The patch works perfectly.

Have a nice day !

The following user(s) said Thank You: nicolas

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

Time to create page: 0.060 seconds
Powered by Kunena Forum