News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Price base by CF - problem how to display price in category view

Started by usr_jk, June 25, 2018, 09:13:09 AM

Previous topic - Next topic

usr_jk

Hello
I've a problem with displaying the product price
In my (future ;-)) store, the product price will be calculated from custom fields (string as Adminlist, "custom fields for everyone" plugin, etc.), as in this topic
https://forum.virtuemart.net/index.php?topic=135142.0

I set the "cost price" in the Product Information to 0.001, and later I set the price of the product in custom fields - the first CF from the group determines the price for a given field and further CF from the group are displayed for the user to choose (modify the price)

E.g
I have set up in CF
String Car-Color, 40 $, black
String Car-Color, 0 $, white
String Car-Color, 10 $, red

and with this setting CF, on the product page at start the product price is displayed  40$ and the user can modify the color (and automatically price) and on the category page the price of the product is displayed as 0$ :-( (understands that it is charged from Base price of the product and not from CF)

Is it possible to get to the price that is displayed immediately after visiting product page ( 40$ in this example)?

I hope that I have presented my problem as clearly as possible

My VirtueMart 3.2.14

P.S. Sorry for my English ;-)

Studio 42

Use 0 as customfield price in the first option and 40 as product base price.
If you need negative value, you can us customfield price -20 for the other option.

usr_jk

Thanks for the quick response / hint :-)

Yes, you are right, but in my case it is more complicated actually I did not describe exactly the "complexity" of my CF
I use about 11 custom fields, and all of them contain about 5 options (price modifiers)
it would be very difficult to place products in the store
for example (regarding the previous example)

1 case - base price of 40 $

String Car-Color, 40 $, black (change to 0)
String Car-Color, 0 $, white (should be changed to -40)
String Car-Color, 10 $, red (change to -30)

2 base price case 10
String Car-Color, 10 $, red (change to 0)
String Car-Color, 40 $, black (change to -30)
String Car-Color, 0 $, white (should be changed to -10)

and so for all CFs I would have to "calculate" differences each time.

Maybe it could somehow be solved to reach directly the price displayed on the product page?

Studio 42

I have give you the solution. Vm do not calculate the price first time(as i know) so or you use my method, or you refresh prices using javascript(this can be slow)