Author Topic: Zero-priced delivery  (Read 144 times)

d0ublezer0

  • Jr. Member
  • **
  • Posts: 120
Zero-priced delivery
« on: August 22, 2017, 15:36:29 pm »
Standart psplugin code in administrator\components\com_virtuemart\plugins\vmpsplugin.php 
has 
protected function getPluginHtml ($plugin, $selectedPlugin, $pluginSalesPrice)
which not rendering zero-priced plugin methods costs
I want to display the shipping price always, even it is zero
it is possible?
i cant find override for this issue

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2585
  • VirtueMart Version: 3.2.4
Re: Zero-priced delivery
« Reply #1 on: August 22, 2017, 18:53:21 pm »
There is no override unfortunately.

This if statement returns a price and "nothing" when there is no price :-

if ($pluginSalesPrice) {


So you have to add an else clause to the code to return a formatted 0.00

Code: [Select]
} else { // added this custom element to deal with free shipping.
$costDisplay = '<span class="zero_' . $this->_type . '_cost">0.00</span>';
}
regards
A

Joomla 3.7.4
php 5.6 + php 7

d0ublezer0

  • Jr. Member
  • **
  • Posts: 120
Re: Zero-priced delivery
« Reply #2 on: August 23, 2017, 08:37:02 am »
Thanks for the answer. I understand that this is hack. And it will be deleted after the next update.