Author Topic: [SOLVED] hide the price in product options - but recalculate the sales price  (Read 380 times)

edsmiths

  • Beginner
  • *
  • Posts: 6
  • A beginner
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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4046
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
You can override components\com_virtuemart\sublayouts\customfield.php
in your template/html/virtuemart\sublayouts\customfield.php
For standard options search
Code: [Select]
$price = VirtueMartModelCustomfields::renderCustomfieldPrice($productCustom, $product, $calculator);and replace with
Code: [Select]
$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

  • Beginner
  • *
  • Posts: 6
  • A beginner
Thanks Studio 42,

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

Code: [Select]
$price = VirtueMartModelCustomfields::_getCustomPrice($productCustom->customfield_price, $currency, $calculator);
Thaks again,
Ed