News:

Looking for documentation? Take a look on our wiki

Main Menu

[Fixed]Bug in vmPSPlugin getThisName()

Started by Stephen Roberts, December 13, 2011, 05:46:58 AM

Previous topic - Next topic

Stephen Roberts

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
}
Sell downloadable (virtual) products in VirtueMart 2 and deliver downloads via local server, Amazon S3, and more! http://www.digitollsoftware.com

alatak

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.

Stephen Roberts

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?
Sell downloadable (virtual) products in VirtueMart 2 and deliver downloads via local server, Amazon S3, and more! http://www.digitollsoftware.com

alatak

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.