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

[HACK Solved]How to hide or replace prices in customfields?

Started by servlet, April 06, 2016, 08:05:17 AM

Previous topic - Next topic

servlet

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
Он-лайн магазин за фототапети http://mishelfoster.com

servlet

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 ="";
Он-лайн магазин за фототапети http://mishelfoster.com

misholini

$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?

servlet

Hack it again ;)
You have to hack the core every time when you update VM
Он-лайн магазин за фототапети http://mishelfoster.com

Studio 42


servlet

Он-лайн магазин за фототапети http://mishelfoster.com

marvays

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 :)

joshry101

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

StefanSTS

Didn't it help to set COM_VM_PLUS and COM_VM_MINUS to ""?

--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

wendy1

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.

GJC Web Design

#10
hmm .. have u tried making a Joomla language over ride for COM_VM_CUSTOMFIELD_VARIANT_PRICE ?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Milbo

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

joshry101

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

StefanSTS

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
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.