Hello
Is it possible to hide prices in customfields for non logged users or catalog view? OR how to replace prices with ASK FOR PRICE. Catalog view is not correct as I described here http://forum.virtuemart.net/index.php?topic=133748.0 No bode mark it as a BUG.... so I am looking for way to solve this problem.
Thank you
NOTE: If you update VM dont forget to change again. To this moment this is a hack, and it is not improved by VM team. I hope to add option in configuration section shop hide price in custom field or hide in catalogue mode
If you want to do this you must replace
/administrator/components/com_virtuemart/models/customfields.php
It usable if price of custom field is >0 If it is =0 you will see No additional charge (you can edit language file to change it)
Line 874
$price ="+".$price;
with
$price ="- Ask for price";
or
If you dont want to display anything use this:
$price ="";
$price =""; -> This used to work for me, but ever since I updated Virtuemart to ver. 3.2.8 it does not work anymore and I see variants price additions showing in the drop down. (e.g product variant +/- price difference).
Any suggestions how to remove +/- price difference?
Hack it again ;)
You have to hack the core every time when you update VM
You can use https://shop.st42.fr/en/products/shortcodes.htm see Cart Dropdown list
In the plugin, you have an option to hide price.
See http://pro.st42.fr/en/shortcodes/test-product-no4.html OPTION LIST for eg.
Sounds good :)
I try delete line 919 - 945:
if ((float)$customPrice) {
if ($customPrice > 0) {
$sign = vmText::_('COM_VM_PLUS');
} else {
$sign = vmText::_('COM_VM_MINUS');
}
if(empty($productCustom->multiplyPrice)){
$calculator->setProduct($product);
$v = strip_tags ($calculator->_currencyDisplay->priceDisplay ($calculator->calculateCustomPriceWithTax ($customPrice)));
if ($customPrice < 0) {
$v = trim($v,'-');
}
$price = vmText::sprintf('COM_VM_CUSTOMFIELD_VARIANT_PRICE',$sign,$v);
} else {
$v = trim($productCustom->customfield_price,0);
$v = trim($v,'.');
$price = vmText::sprintf('COM_VM_CUSTOMFIELD_VARIANT_PERCENTAGE',$sign,$v);
}
}
else {
$price = ($customPrice === '') ? '' : vmText::sprintf('COM_VIRTUEMART_CART_PRICE_FREE',$calculator->_currencyDisplay->getSymbol());
}
return $price;
and work it :)
I used to use
$price =" ".$price;
To remove the '+' sign from the front end
Since upgrading to 3.4.2 this hack no longer works
Any ideas? Thanks
Didn't it help to set COM_VM_PLUS and COM_VM_MINUS to ""?
Hello where do I edit this? I upgraded VM to the latest version and now all my custom fields display this message COM_VM_CUSTOMFIELD_VARIENT_PRICE. I have different prices for certain sizes. Any advice would be greatly appreciated.
hmm .. have u tried making a Joomla language over ride for COM_VM_CUSTOMFIELD_VARIENT_PRICE ?
You need
COM_VM_CUSTOMFIELD_VARIANT_PRICE="%1$s%2$s"
and used in models/customfields.php line 963
$price = vmText::sprintf('COM_VM_CUSTOMFIELD_VARIANT_PRICE',$sign,$v);
not varient. We have no COM_VM_CUSTOMFIELD_VARIENT_PRICE in the code.
Thanks Stefan, your solution worked
For others searching for this you need to edit
/components/com_virtuemart/language/en-GB/en-GB.com_virtuemart.ini
Change COM_VM_PLUS="+" to suit
Please don't edit the language file itself, otherwise you lose the change on update.
Search Google for Joomla language override.
The override will stay regardless if you update or not.
Stefan