VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: Stephen Roberts on December 13, 2011, 05:46:58 AM

Title: [Fixed]Bug in vmPSPlugin getThisName()
Post by: Stephen Roberts on December 13, 2011, 05:46:58 AM
The getThisName() function needs to be updated to use the language tables. Something like this:

final protected function getThisName($virtuemart_method_id) {
$db = JFactory::getDBO();
$q = 'SELECT `' . $this->_psType . '_name` '
. 'FROM #__virtuemart_' . $this->_psType . 'methods_'.VMLANG.' '
. 'WHERE ' . $this->_idName . ' = "' . $virtuemart_method_id . '" ';
$db->setQuery($q);JError::raiseWarning(500, $q);
return $db->loadResult(); // TODO Error check
}
Title: Re: Bug in vmPSPlugin getThisName()
Post by: alatak on December 13, 2011, 09:58:11 AM
Hi,

Txs, I have added . But actually that function is not used any more. It has been replaced by the function renderPluginName(); which gives back the payment name+ logo, + description.
Title: Re: Bug in vmPSPlugin getThisName()
Post by: Stephen Roberts on December 13, 2011, 19:22:56 PM
Thanks. Another issue now. In revision 5065, I need to get the name of the shipping method by using the virtuemart_shipmentmethod_id. Now I can do this with:

$this->renderPluginName($this->getPluginMethod($virtuemart_shipmentmethod_id));

But there's a bug in getPluginMethod(). It's calling selectedThisByMethodId() with 2 parameters, but there should only be 1 parameter so the function fails every time. Is there a better way of getting the shipment method name with only the virtuemart_shipmentmethod_id?
Title: Re: Bug in vmPSPlugin getThisName()
Post by: alatak on December 14, 2011, 09:21:53 AM
Hi,

QuoteBut there's a bug in getPluginMethod(). It's calling selectedThisByMethodId() with 2 parameters,
Oops.. stupid bug. txs for reporting. Fixed in revision 5072.