_tablepkey = 'id'; //virtuemart_order_id';
$this->_idName = 'virtuemart_' . $this->_psType . 'method_id';
$this->_configTable = '#__virtuemart_' . $this->_psType . 'methods';
$this->_configTableFieldName = $this->_psType . '_params';
$this->_configTableFileName = $this->_psType . 'methods';
$this->_configTableClassName = 'Table' . ucfirst ($this->_psType) . 'methods'; //TablePaymentmethods
// $this->_configTableIdName = $this->_psType.'_jplugin_id';
$this->_loggable = TRUE;
//$this->_tableChecked = TRUE;
}
public function getVarsToPush () {
return self::getVarsToPushByXML($this->_xmlFile,$this->_name.'Form');
}
public function setConvertable($toConvert) {
$this->_toConvert = $toConvert;
}
/**
* check if it is the correct type
*
* @param string $psType either payment or shipment
* @return boolean
*/
public function selectedThisType ($psType) {
if ($this->_psType <> $psType) {
return FALSE;
} else {
return TRUE;
}
}
/**
* Create the table for this plugin if it does not yet exist.
* This functions checks if the called plugin is active one.
* When yes it is calling the standard method to create the tables
*
* @author Valérie Isaksen
*
*/
public function onStoreInstallPluginTable ($jplugin_id, $name = FALSE) {
if ($res = $this->selectedThisByJPluginId ($jplugin_id)) {
vmdebug('onStoreInstallPluginTable, going to execute onStoreInstallPluginTable');
parent::onStoreInstallPluginTable ($this->_psType);
}
return $res;
}
/**
* This event is fired after the payment method has been selected. It can be used to store
* additional payment info in the cart.
*
* @author Max Milbers
* @author Valérie isaksen
*
* @param VirtueMartCart $cart: the actual cart
* @return null if the payment was not selected, true if the data is valid, error message if the data is not vlaid
*
*/
public function onSelectCheck (VirtueMartCart $cart) {
$idName = $this->_idName;
if (!$this->selectedThisByMethodId ($cart->$idName)) {
return NULL; // Another method was selected, do nothing
}
return TRUE; // this method was selected , and the data is valid by default
}
/**
* displayListFE
* This event is fired to display the pluginmethods in the cart (edit shipment/payment) for example
*
* @param object $cart Cart object
* @param integer $selected ID of the method selected
* @return boolean True on success, false on failures, null when this plugin was not selected.
* On errors, JError::raiseWarning (or JError::raiseError) must be used to set a message.
*
* @author Valerie Isaksen
* @author Max Milbers
*/
public function displayListFE (VirtueMartCart $cart, $selected = 0, &$htmlIn) {
if ($this->getPluginMethods ($cart->vendorId) === 0) {
if (empty($this->_name)) {
vmAdminInfo ('displayListFE cartVendorId=' . $cart->vendorId);
$app = JFactory::getApplication ();
$app->enqueueMessage (vmText::_ ('COM_VIRTUEMART_CART_NO_' . strtoupper ($this->_psType)));
return FALSE;
} else {
return FALSE;
}
}
$mname = $this->_psType . '_name';
$idN = 'virtuemart_'.$this->_psType.'method_id';
$ret = FALSE;
foreach ($this->methods as $method) {
if(!isset($htmlIn[$this->_psType][$method->$idN])) {
if ($this->checkConditions ($cart, $method, $cart->cartPrices)) {
// the price must not be overwritten directly in the cart
$prices = $cart->cartPrices;
$methodSalesPrice = $this->setCartPrices ($cart, $prices ,$method);
//This makes trouble, because $method->$mname is used in renderPluginName to render the Name, so it must not be called twice!
$method->$mname = $this->renderPluginName ($method);
$htmlIn[$this->_psType][$method->$idN] = $this->getPluginHtml ($method, $selected, $methodSalesPrice);
$ret = TRUE;
}
} else {
$ret = TRUE;
}
}
return $ret;
}
/*
* onSelectedCalculatePrice
* Calculate the price (value, tax_id) of the selected method
* It is called by the calculator
* This function does NOT to be reimplemented. If not reimplemented, then the default values from this function are taken.
* @author Valerie Isaksen
* @cart: VirtueMartCart the current cart
* @cart_prices: array the new cart prices
* @return null if the method was not selected, false if the shipping rate is not valid any more, true otherwise
*
*/
public function onSelectedCalculatePrice (VirtueMartCart $cart, array &$cart_prices, &$cart_prices_name) {
$idName = $this->_idName;
if (!($method = $this->selectedThisByMethodId ($cart->$idName))) {
return NULL; // Another method was selected, do nothing
}
if (!$method = $this->getVmPluginMethod ($cart->$idName) or empty($method->$idName)) {
return NULL;
}
$cart_prices_name = '';
$cart_prices['cost'] = 0;
if (!$this->checkConditions ($cart, $method, $cart_prices)) {
return FALSE;
}
$cart_prices_name = $this->renderPluginName ($method);
$this->setCartPrices ($cart, $cart_prices, $method);
return TRUE;
}
/**
* onCheckAutomaticSelected
* Checks how many plugins are available. If only one, the user will not have the choice. Enter edit_xxx page
* The plugin must check first if it is the correct type
*
* @author Valerie Isaksen
* @param VirtueMartCart cart: the cart object
* @return null if no plugin was found, 0 if more then one plugin was found, virtuemart_xxx_id if only one plugin is found
*
*/
function onCheckAutomaticSelected (VirtueMartCart $cart, array $cart_prices = array(), &$methodCounter = 0) {
$virtuemart_pluginmethod_id = 0;
$nbMethod = $this->getSelectable ($cart, $virtuemart_pluginmethod_id, $cart_prices);
$methodCounter += $nbMethod;
if ($nbMethod == NULL) {
return NULL;
} else {
if ($nbMethod == 1) {
return $virtuemart_pluginmethod_id;
} else {
return 0;
}
}
}
/**
* This method is fired when showing the order details in the frontend.
* It displays the method-specific data.
*
* @param integer $order_id The order ID
* @return mixed Null for methods that aren't active, text (HTML) otherwise
* @author Max Milbers
* @author Valerie Isaksen
*/
protected function onShowOrderFE ($virtuemart_order_id, $virtuemart_method_id, &$method_info) {
if (!($this->selectedThisByMethodId ($virtuemart_method_id))) {
return NULL;
}
$method_info = $this->getOrderMethodNamebyOrderId ($virtuemart_order_id);
}
/**
*
* @author Valerie Isaksen
* @author Max Milbers
* @param int $virtuemart_order_id
* @return string pluginName from the plugin table
*/
private function getOrderMethodNamebyOrderId ($virtuemart_order_id) {
$db = JFactory::getDBO ();
$q = 'SELECT * FROM `' . $this->_tablename . '` '
. 'WHERE `virtuemart_order_id` = ' . (int)$virtuemart_order_id;
$db->setQuery ($q);
if (!($pluginInfo = $db->loadObject ())) {
vmdebug ('Attention, ' . $this->_tablename . ' has not any entry for order_id = '.$virtuemart_order_id);
//if(!empty($err)){
// vmWarn ('Attention, ' . $this->_tablename . ' has not any entry for order_id = '.$virtuemart_order_id. ' err = '.$err);
//}
return NULL;
}
$idName = $this->_psType . '_name';
return $pluginInfo->$idName;
}
/**
* check if it is the correct element
*
* @param string $element either standard or paypal
* @return boolean
*/
public function selectedThisElement ($element) {
if ($this->_name <> $element) {
return FALSE;
} else {
return TRUE;
}
}
/**
* This method is fired when showing the order details in the backend.
* It displays the the payment method-specific data.
* All plugins *must* reimplement this method.
*
* @param integer $_virtuemart_order_id The order ID
* @param integer $_paymethod_id Payment method used for this order
* @return mixed Null when for payment methods that were not selected, text (HTML) otherwise
* @author Max Milbers
* @author Valerie Isaksen
*/
function onShowOrderBE ($_virtuemart_order_id, $_method_id) {
return NULL;
}
/**
* This method is fired when showing when priting an Order
* It displays the the payment method-specific data.
*
* @param integer $_virtuemart_order_id The order ID
* @param integer $method_id method used for this order
* @return mixed Null when for payment methods that were not selected, text (HTML) otherwise
* @author Valerie Isaksen
*/
function onShowOrderPrint ($order_number, $method_id) {
if (!$this->selectedThisByMethodId ($method_id)) {
return NULL; // Another method was selected, do nothing
}
if (!($order_name = $this->getOrderPluginName ($order_number, $method_id))) {
return NULL;
}
vmLanguage::loadJLang('com_virtuemart');
$html = '
' . "\n";
return $html;
}
private function getOrderPluginName ($order_number, $pluginmethod_id) {
$db = JFactory::getDBO ();
$q = 'SELECT * FROM `' . $this->_tablename . '` WHERE `order_number` = "' . $order_number . '"
AND `' . $this->_idName . '` =' . $pluginmethod_id;
$db->setQuery ($q);
if (!($order = $db->loadObject ())) {
return NULL;
}
$plugin_name = $this->_psType . '_name';
return $order->$plugin_name;
}
/**
* Save updated order data to the method specific table
*
* @param array $_formData Form data
* @return mixed, True on success, false on failures (the rest of the save-process will be
* skipped!), or null when this method is not actived.
* @author Oscar van Eijk
*/
public function onUpdateOrder ($formData) {
return NULL;
}
/**
* Save updated orderline data to the method specific table
*
* @param array $_formData Form data
* @return mixed, True on success, false on failures (the rest of the save-process will be
* skipped!), or null when this method is not actived.
* @author Oscar van Eijk
*/
public function onUpdateOrderLine ($formData) {
return NULL;
}
/**
* OnEditOrderLineBE
* This method is fired when editing the order line details in the backend.
* It can be used to add line specific package codes
*
* @param integer $_orderId The order ID
* @param integer $_lineId
* @return mixed Null for method that aren't active, text (HTML) otherwise
* @author Oscar van Eijk
*/
public function onEditOrderLineBE ($orderId, $lineId) {
return NULL;
}
/**
* This method is fired when showing the order details in the frontend, for every orderline.
* It can be used to display line specific package codes, e.g. with a link to external tracking and
* tracing systems
*
* @param integer $_orderId The order ID
* @param integer $_lineId
* @return mixed Null for method that aren't active, text (HTML) otherwise
* @author Oscar van Eijk
*/
public function onShowOrderLineFE ($orderId, $lineId) {
return NULL;
}
/**
* This event is fired when the method notifies you when an event occurs that affects the order.
* Typically, the events represents for payment authorizations, Fraud Management Filter actions and other actions,
* such as refunds, disputes, and chargebacks.
*
* NOTE for Plugin developers:
* If the plugin is NOT actually executed (not the selected payment method), this method must return NULL
*
* @param $return_context: it was given and sent in the payment form. The notification should return it back.
* Used to know which cart should be emptied, in case it is still in the session.
* @param int $virtuemart_order_id : payment order id
* @param char $new_status : new_status for this order id.
* @return mixed Null when this method was not selected, otherwise the true or false
*
* @author Valerie Isaksen
*
*/
public function onNotification () {
return NULL;
}
/**
* OnResponseReceived
* This event is fired when the method returns to the shop after the transaction
*
* the method itself should send in the URL the parameters needed
* NOTE for Plugin developers:
* If the plugin is NOT actually executed (not the selected payment method), this method must return NULL
*
* @param int $virtuemart_order_id : should return the virtuemart_order_id
* @param text $html: the html to display
* @return mixed Null when this method was not selected, otherwise the true or false
*
* @author Valerie Isaksen
*
*/
function onResponseReceived (&$virtuemart_order_id, &$html) {
return NULL;
}
function getDebug () {
return $this->_debug;
}
function setDebug ($params) {
return $this->_debug = $params->get ('debug', 0);
}
/**
* Get Plugin Data for a go given plugin ID
*
* @author Valérie Isaksen
* @param int $pluginmethod_id The method ID
* @return method data
*/
final protected function getPluginMethod ($method_id) {
if (!$this->selectedThisByMethodId ($method_id)) {
return FALSE;
}
return $this->getVmPluginMethod ($method_id);
}
/**
* Fill the array with all plugins found with this plugin for the current vendor
* Todo it would be nicer to use here the correct vmtable methods
* @return True when plugins(s) was (were) found for this vendor, false otherwise
* @author Oscar van Eijk
* @author max Milbers
* @author valerie Isaksen
*/
protected function getPluginMethods ($vendorId) {
static $mC = array();
$h = $vendorId.$this->_psType.$this->_name;
if(isset($mC[$h])) {
$this->methods = $mC[$h];
//vmdebug('getPluginMethods return cached '.$h);
return count($this->methods);
}
$usermodel = VmModel::getModel ('user');
$user = $usermodel->getUser ();
$user->shopper_groups = (array)$user->shopper_groups;
$db = JFactory::getDBO ();
if(empty($vendorId)) $vendorId = 1;
$select = 'SELECT i.*, ';
$extPlgTable = '#__extensions';
$extField1 = 'extension_id';
$extField2 = 'element';
$select .= 'j.`' . $extField1 . '`,j.`name`, j.`type`, j.`element`, j.`folder`, j.`client_id`, j.`enabled`, j.`access`, j.`protected`, j.`manifest_cache`,
j.`params`, j.`custom_data`, j.`system_data`, j.`checked_out`, j.`checked_out_time`, j.`state`, s.virtuemart_shoppergroup_id ';
if(!VmConfig::$vmlang){
vmLanguage::initialise();
}
$joins = array();
$langFields = array($this->_psType.'_name',$this->_psType.'_desc');
$select .= ', '.implode(', ',VmModel::joinLangSelectFields($langFields));
$joins = VmModel::joinLangTables('#__virtuemart_' . $this->_psType . 'methods','i','virtuemart_' . $this->_psType . 'method_id');
array_unshift($joins, ' FROM #__virtuemart_' . $this->_psType . 'methods as i');
$joins[]= ' LEFT JOIN `' . $extPlgTable . '` as j ON j.`' . $extField1 . '` = i.`' . $this->_psType . '_jplugin_id` ';
$joins[]= ' LEFT OUTER JOIN `#__virtuemart_' . $this->_psType . 'method_shoppergroups` AS s ON i.`virtuemart_' . $this->_psType . 'method_id` = s.`virtuemart_' . $this->_psType . 'method_id` ';
$q = $select.implode(' '."\n",$joins);
$q .= ' WHERE i.`published` = "1" AND j.`' . $extField2 . '` = "' . $this->_name . '"
AND (i.`virtuemart_vendor_id` = "' . $vendorId . '" OR i.`virtuemart_vendor_id` = "0" OR i.`shared` = "1")
AND (';
foreach ($user->shopper_groups as $groups) {
$q .= ' s.`virtuemart_shoppergroup_id`= "' . (int)$groups . '" OR';
}
$q .= ' (s.`virtuemart_shoppergroup_id`) IS NULL ) GROUP BY i.`virtuemart_' . $this->_psType . 'method_id` ORDER BY i.`ordering`';
$db->setQuery ($q);
$this->methods = $db->loadObjectList ();
if($err = $db->getErrorMsg()){
vmError('Error in slq vmpsplugin.php function getPluginMethods '.$err);
}
if ($this->methods) {
foreach ($this->methods as $method) {
VmTable::bindParameterable ($method, $this->_xParams, $this->_varsToPushParam);
$this->decryptFields($method);
}
} else if($this->methods===null or empty($this->methods)){
$this->methods = array();
//vmError ('Error reading getPluginMethods ' . $q);
}
$mC[$h] = $this->methods;
//vmdebug('getPluginMethods my query ',str_replace('#__',$db->getPrefix(),$db->getQuery()));
return count($this->methods);
}
function decryptFields($method){
if($this->_cryptedFields and is_array($this->_cryptedFields)){
if(!class_exists('vmCrypt')){
require(VMPATH_ADMIN .'/helpers/vmcrypt.php');
}
if(isset($method->modified_on) and $method->modified_on!='0000-00-00 00:00:00'){
$date = JFactory::getDate($method->modified_on);
$date = $date->toUnix();
} else if(isset($method->created_on) and $method->created_on!='0000-00-00 00:00:00'){
$date = JFactory::getDate($method->created_on);
$date = $date->toUnix();
} else {
$date = 0;
}
foreach($this->_cryptedFields as $field){
if(isset($method->$field)){
$t = $method->$field;
$method->$field = vmCrypt::decrypt($method->$field, $date);
//vmdebug(' Field '.$field.' crypted '.$t.' decrypted = '.$method->$field);
}
}
$this->_encrypted = false;
}
}
/**
* Get Method Data for a given Payment ID
*
* @author Valérie Isaksen
* @param int $virtuemart_order_id The order ID
* @return $methodData
*/
final protected function getDataByOrderId ($virtuemart_order_id) {
$t = substr($this->_tablename,3);
if(!vmTable::checkTableExists($t)) return false;
$db = JFactory::getDBO ();
$q = 'SELECT * FROM `' . $this->_tablename . '` '
. 'WHERE `virtuemart_order_id` = ' . (int)$virtuemart_order_id;
$db->setQuery ($q);
$methodData = $db->loadObject ();
return $methodData;
}
/**
* Get Method Datas for a given Payment ID
*
* @author Valérie Isaksen
* @param int $virtuemart_order_id The order ID
* @return $methodData
*/
final protected function getDatasByOrderId ($virtuemart_order_id) {
$t = substr($this->_tablename,3);
if(!vmTable::checkTableExists($t)) return false;
$db = JFactory::getDBO ();
$q = 'SELECT * FROM `' . $this->_tablename . '` '
. 'WHERE `virtuemart_order_id` = "' . (int)$virtuemart_order_id. '" '
. 'ORDER BY `id` ASC';
$db->setQuery ($q);
$methodData = $db->loadObjectList ();
return $methodData;
}
/**
* Get Method Data for a given Payment ID
*
* @author Valérie Isaksen
* @param int $order_number The order Number
* @return $methodData
*/
final protected function getDataByOrderNumber ($order_number) {
$t = substr($this->_tablename,3);
if(!vmTable::checkTableExists($t)) return false;
$db = JFactory::getDBO ();
$q = 'SELECT * FROM `' . $this->_tablename . '` '
. 'WHERE `order_number`="'.$db->escape($order_number).'"';
$db->setQuery ($q);
$methodData = $db->loadObject ();
return $methodData;
}
/**
* Get Method Datas for a given Payment ID
*
* @author Valérie Isaksen
* @param int $order_number The order Number
* @return $methodData
*/
final protected function getDatasByOrderNumber ($order_number) {
$t = substr($this->_tablename,3);
if(!vmTable::checkTableExists($t)) return false;
$db = JFactory::getDBO ();
$q = 'SELECT * FROM `' . $this->_tablename . '` '
. 'WHERE `order_number`="'.$db->escape($order_number).'" and payment_currency > "0"';
$db->setQuery ($q);
$methodData = $db->loadObjectList ();
return $methodData;
}
/**
* Get the total weight for the order, based on which the proper shipping rate
* can be selected.
*
* @param object $cart Cart object
* @return float Total weight for the order
*/
protected function getOrderWeight (VirtueMartCart $cart, $to_weight_unit) {
static $weight = array();
if(!isset($weight[$to_weight_unit])) $weight[$to_weight_unit] = 0.0;
if(count($cart->products)>0 and empty($weight[$to_weight_unit])){
foreach ($cart->products as $product) {
$weight[$to_weight_unit] += (ShopFunctions::convertWeightUnit ($product->product_weight, $product->product_weight_uom, $to_weight_unit) * $product->quantity);
}
}
return $weight[$to_weight_unit];
}
/**
* getThisName
* Get the name of the method
*
* @param int $id The method ID
* @author Valérie Isaksen
* @return string Shipment name
*/
final protected function getThisName ($virtuemart_method_id) {
$db = JFactory::getDBO ();
$q = 'SELECT `' . $this->_psType . '_name` '
. 'FROM #__virtuemart_' . $this->_psType . 'methods '
. 'WHERE ' . $this->_idName . ' = "' . (int)$virtuemart_method_id . '" ';
$db->setQuery ($q);
return $db->loadResult (); // TODO Error check
}
/**
* Extends the standard function in vmplugin. Extendst the input data by virtuemart_order_id
* Calls the parent to execute the write operation
*
* @author Max Milbers
* @param array $_values
* @param string $_table
*/
protected function storePSPluginInternalData ($values, $primaryKey = 0, $preload = FALSE) {
if (!class_exists ('VirtueMartModelOrders')) {
require(VMPATH_ADMIN . DS . 'models' . DS . 'orders.php');
}
if (!isset($values['virtuemart_order_id'])) {
$values['virtuemart_order_id'] = VirtueMartModelOrders::getOrderIdByOrderNumber ($values['order_number']);
}
return $this->storePluginInternalData ($values, $primaryKey, 0, $preload);
}
/**
* Something went wrong, Send notification to all administrators
*
* @param string subject of the mail
* @param string message
*/
protected function sendEmailToVendorAndAdmins ($subject = NULL, $message = NULL) {
// recipient is vendor and admin
$vendorId = 1;
$vendorModel = VmModel::getModel('vendor');
$vendor = $vendorModel->getVendor($vendorId);
$vendorEmail = $vendorModel->getVendorEmail($vendorId);
$vendorName = $vendorModel->getVendorName($vendorId);
vmLanguage::loadJLang('com_virtuemart');
if ($subject == NULL) {
$subject = vmText::sprintf('COM_VIRTUEMART_ERROR_SUBJECT', $this->_name, $vendor->vendor_store_name);
}
if ($message == NULL) {
$message = vmText::sprintf('COM_VIRTUEMART_ERROR_BODY', $subject, $this->getLogFilename().VmConfig::LOGFILEEXT);
}
JFactory::getMailer()->sendMail($vendorEmail, $vendorName, $vendorEmail, $subject, $message);
$query = 'SELECT name, email, sendEmail FROM #__users WHERE sendEmail=1';
$db = JFactory::getDBO();
$db->setQuery($query);
$rows = $db->loadObjectList();
$subject = html_entity_decode($subject, ENT_QUOTES);
// get superadministrators id
foreach ($rows as $row) {
if ($row->sendEmail) {
$message = html_entity_decode($message, ENT_QUOTES);
JFactory::getMailer()->sendMail($vendorEmail, $vendorName, $row->email, $subject, $message);
}
}
}
/**
* displays the logos of a VirtueMart plugin
*
* @author Valerie Isaksen
* @author Max Milbers
* @param array $logo_list
* @return html with logos
*/
protected function displayLogos ($logo_list) {
$img = "";
if (!(empty($logo_list))) {
if(!class_exists('JFolder')){
require(VMPATH_LIBS.DS.'joomla'.DS.'filesystem'.DS.'folder.php');
}
$url ='images/virtuemart/' . $this->_psType ;
if(!JFolder::exists( VMPATH_ROOT .'/'. $url)){
$url = 'images/stories/virtuemart/' . $this->_psType;
if(!JFolder::exists(VMPATH_ROOT .'/'. $url)){
return $img;
}
}
if (!is_array ($logo_list)) {
$logo_list = (array)$logo_list;
}
foreach ($logo_list as $logo) {
if(!empty($logo)){
if(JFile::exists(VMPATH_ROOT .DS. $url .DS.$logo)){
$alt_text = substr ($logo, 0, strpos ($logo, '.'));
$img .= ' ';
}
}
}
}
return $img;
}
protected function renderPluginName ($plugin) {
static $c = array();
$idN = 'virtuemart_'.$this->_psType.'method_id';
if(isset($c[$this->_psType][$plugin->$idN])){
return $c[$this->_psType][$plugin->$idN];
}
$return = '';
$plugin_name = $this->_psType . '_name';
$plugin_desc = $this->_psType . '_desc';
$description = '';
$logosFieldName = $this->_psType . '_logos';
$logos = property_exists($plugin,$logosFieldName)? $plugin->$logosFieldName:array();
if (!empty($logos)) {
$return = $this->displayLogos ($logos) . ' ';
}
if (!empty($plugin->$plugin_desc)) {
$description = '' . $plugin->$plugin_desc . '';
}
$c[$this->_psType][$plugin->$idN] = $return . '' . $plugin->$plugin_name . '' . $description;
return $c[$this->_psType][$plugin->$idN];
}
protected function getPluginHtml ($plugin, $selectedPlugin, $pluginSalesPrice) {
$pluginmethod_id = $this->_idName;
$pluginName = $this->_psType . '_name';
if ($selectedPlugin == $plugin->$pluginmethod_id) {
$checked = 'checked="checked"';
} else {
$checked = '';
}
if (!class_exists ('CurrencyDisplay')) {
require(VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php');
}
$currency = CurrencyDisplay::getInstance ();
$costDisplay = "";
if ($pluginSalesPrice) {
$costDisplay = $currency->priceDisplay( $pluginSalesPrice );
$t = vmText::_( 'COM_VIRTUEMART_PLUGIN_COST_DISPLAY' );
if(strpos($t,'/')!==FALSE){
list($discount, $fee) = explode( '/', vmText::_( 'COM_VIRTUEMART_PLUGIN_COST_DISPLAY' ) );
if($pluginSalesPrice>=0) {
$costDisplay = ' ('.$fee.' '.$costDisplay.")";
} else if($pluginSalesPrice<0) {
$costDisplay = trim(strip_tags($costDisplay),'-');
$costDisplay = ' ('.$discount.' '.$costDisplay.")";
}
} else {
$costDisplay = ' ('.$t.' '.$costDisplay.")";
}
}
$dynUpdate='';
if( VmConfig::get('oncheckout_ajax',false)) {
//$url = JRoute::_('index.php?option=com_virtuemart&view=cart&task=updatecart&'. $this->_idName. '='.$plugin->$pluginmethod_id );
$dynUpdate=' data-dynamic-update="1" ';
}
$html = '\n"
. '\n";
return $html;
}
protected function getHtmlHeaderBE () {
$class = "class='key'";
$html = ' ' . "\n"
. '