Author Topic: [HACK Solved]How to hide or replace prices in customfields?  (Read 2488 times)

servlet

  • Jr. Member
  • **
  • Posts: 348
  • Business optimization
    • Фототапети
  • VirtueMart Version: 3.2.2
[HACK Solved]How to hide or replace prices in customfields?
« on: April 06, 2016, 08:05:17 am »
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
I am using: Joomla 3.7.2 VM 3.2.2
Он-лайн магазин за фототапети http://mishelfoster.com

servlet

  • Jr. Member
  • **
  • Posts: 348
  • Business optimization
    • Фототапети
  • VirtueMart Version: 3.2.2
Re: How to hide or replace prices in customfields?
« Reply #1 on: April 08, 2016, 16:39:33 pm »
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
Code: [Select]
$price ="+".$price;
with

Code: [Select]
$price ="- Ask for price";
or

If you dont want to display anything use this:

Code: [Select]
$price ="";
I am using: Joomla 3.7.2 VM 3.2.2
Он-лайн магазин за фототапети http://mishelfoster.com

misholini

  • Beginner
  • *
  • Posts: 29
  • VirtueMart Version: 3.2.14
Re: [HACK Solved]How to hide or replace prices in customfields?
« Reply #2 on: December 14, 2017, 04:06:34 am »
$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

  • Jr. Member
  • **
  • Posts: 348
  • Business optimization
    • Фототапети
  • VirtueMart Version: 3.2.2
Re: [HACK Solved]How to hide or replace prices in customfields?
« Reply #3 on: December 14, 2017, 11:59:41 am »
Hack it again ;)
You have to hack the core every time when you update VM
I am using: Joomla 3.7.2 VM 3.2.2
Он-лайн магазин за фототапети http://mishelfoster.com

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3973
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: [HACK Solved]How to hide or replace prices in customfields?
« Reply #4 on: December 14, 2017, 15:43:10 pm »
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.

servlet

  • Jr. Member
  • **
  • Posts: 348
  • Business optimization
    • Фототапети
  • VirtueMart Version: 3.2.2
Re: [HACK Solved]How to hide or replace prices in customfields?
« Reply #5 on: December 16, 2017, 10:52:44 am »
Sounds good :)
I am using: Joomla 3.7.2 VM 3.2.2
Он-лайн магазин за фототапети http://mishelfoster.com

marvays

  • Jr. Member
  • **
  • Posts: 229
    • http://marvays.cz
  • Skype Name: marvays
Re: [HACK Solved]How to hide or replace prices in customfields?
« Reply #6 on: May 14, 2019, 11:37:00 am »
I try delete line 919 - 945:
Code: [Select]
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

  • Beginner
  • *
  • Posts: 1
  • A beginner
Re: [HACK Solved]How to hide or replace prices in customfields?
« Reply #7 on: August 07, 2019, 14:55:18 pm »
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

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 412
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: [HACK Solved]How to hide or replace prices in customfields?
« Reply #8 on: August 07, 2019, 15:58:27 pm »
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 life shop! Use Alpha versions only if you know what risk you are taking.

wendy1

  • Beginner
  • *
  • Posts: 10
Re: [HACK Solved]How to hide or replace prices in customfields?
« Reply #9 on: September 06, 2019, 01:03:44 am »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9024
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: [HACK Solved]How to hide or replace prices in customfields?
« Reply #10 on: September 06, 2019, 08:42:12 am »
hmm .. have u tried making a Joomla language over ride for COM_VM_CUSTOMFIELD_VARIENT_PRICE ?
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation