[SOLVED] hide the price in product options - but recalculate the sales price

Started by edsmiths, May 28, 2019, 13:22:37 PM

Previous topic - Next topic

edsmiths

Hi there,

I'm not an expert on virtuemart and have been digging in the code to solve the following issue without success.

- I need to hide the increase (or decrease) price that shows on product's options dropdown list.

- However, I need to keep the sales price recalculation function.

Let' say that my product cost $100 and I have three options that change the sales price:
- option 1 (+$10)
- option 2 (+$20)
- option 3 (-$15)

Basically, I want to hide the value added or substracted by the option, but keep the sales price recalculation. So, if the client chose "option 1", he won't see that the increase will be ($10) but will see the sales price at $110.

Presuming in advance that you propably won't undertand my question, please have a look at the attached image.
https://www.dropbox.com/s/2dsfwfmw8k1e635/capture.PNG?dl=0

virtuemart version: 3.0.12

Thanks,
Ed

Studio 42

You can override components\com_virtuemart\sublayouts\customfield.php
in your template/html/virtuemart\sublayouts\customfield.php
For standard options search
$price = VirtueMartModelCustomfields::renderCustomfieldPrice($productCustom, $product, $calculator);
and replace with
$price = '';
You have some plugin that can handle this by default as my plugin https://shop.st42.fr/en/products/shortcodes.htm or demo (https://pro.st42.fr/en/shortcodes) and perhaps breckdesign customfield for all.
                       

edsmiths

Thanks Studio 42,

It's solved the issue.  Altough, not exacty the source code that you pointed (probably due to different VM version):

$price = VirtueMartModelCustomfields::_getCustomPrice($productCustom->customfield_price, $currency, $calculator);

Thaks again,
Ed