VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: d0ublezer0 on August 22, 2017, 15:36:29 PM

Title: Zero-priced delivery
Post by: d0ublezer0 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
Title: Re: Zero-priced delivery
Post by: AH 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

} else { // added this custom element to deal with free shipping.
$costDisplay = '<span class="zero_' . $this->_type . '_cost">0.00</span>';
}
Title: Re: Zero-priced delivery
Post by: d0ublezer0 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.