Display ALL prices in product listing not working as expected

  • Posts: 217
  • Thank you received: 4
5 years 7 months ago #309097

-- HikaShop version -- : 4.2.0

Hello,

I am trying to display both prices of the product in the product listing like this:



I set up two prices of product:


And "Which price: all" in settings of displayed menu:


Unfortunately, only 1 price (the cheaper) is generated in the code:



Please, could you help me to achieve the result I am looking for? I would need to see 4 prices as in the first screenshot

1st price before discount, 1st price after discount
2st price before discount, 2st price after discount


Thank you in advance!
Filip

Attachments:

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

  • Posts: 83480
  • Thank you received: 13505
  • MODERATOR
5 years 7 months ago #309099

Hi,

The setting in the HikaShop configuration is only the default value for products listing menu items and modules. It doesn't affect the product details pages.
On them, the prices are filtered to only display the relevant prices.
Changing that wouldn't be that easy.
But then, could you explain what you're trying to do ? Because if you sell products with different prices without any restriction on them, then I don't understand the logic behind it ? There can only be one price for a product in the cart so we purposefully filter out the prices that won't be taken into account for the cart on the product page so that the customer actually knows what will be the price of the product in the cart before adding it to the cart. If we were to display all the prices like you want, then the customer wouldn't the actual price of the product. So I think I'm missing something here. Could you explain why you're trying to do that ? Maybe with some context, we'll be able to provide a solution.

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

  • Posts: 217
  • Thank you received: 4
5 years 7 months ago #309140

Hello,

Thank you very much for your reply.

Sure, I will explain to you my purpose :-).

ON PRODUCT PAGE I would have a custom coded plugin that will load prices from MySQL table accordingly to chosen custom fields by user. This is the only solution since I have thousands of variants of each product with different prices.

Basically, there are 2 main prices in thousands of variants – a ring with diamonds and without diamonds. I would need to show them both on product listing only, not on the product page (because there will be custom price calculator), neither in the cart, only on the product listing page. When I have both prices generated in code, I will create own jquery plugin that will switch between them.


I hope it is clear now

Thank you,
Filip

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

  • Posts: 12953
  • Thank you received: 1778
5 years 7 months ago #309152

Hello Filip,

there are 2 main prices in thousands of variants – a ring with diamonds and without diamonds. I would need to show them both on product listing only, not on the product page (because there will be custom price calculator), neither in the cart, only on the product listing page. When I have both prices generated in code, I will create own jquery plugin that will switch between them.


The solution will be to directly use a "product" custom fields via "Hikashop->Display->Custom fields" that way you'll be able to add your 2 custom prices on your product configuration page, and display it where and how you want.

Kind regards,
Mohamed Thelji.

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

  • Posts: 217
  • Thank you received: 4
5 years 7 months ago #309246

Thank you very much Mohamed!

Have a nice day,
Filip

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

Time to create page: 0.092 seconds
Powered by Kunena Forum