News:

Support the VirtueMart project and become a member

Main Menu

when < in shipping mode , not working

Started by serge-web54, September 23, 2018, 20:03:03 PM

Previous topic - Next topic

serge-web54

Hello,

on a 3.2.14 (upgrading from 3.2.4) when i have < in shipping mode ( france < 3kg ) items does not display in pdf , either note as invoice.

Jörgen

Hello

Haven´t seen this before, where exactly do You have the text ? I tried in Name and description and it works as expected. Tested on 3.2.12 and 3.2.15. Does this only happen in pdf ?.
Have You tried with &lt;  ?

Jörgen

Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

serge-web54

so,
I see what is happening
It is insered in field shipment_name in table Shipment Weight Countries.
The code insered in this field is : <span class="vmshipment_name">FRANCE < 3 Kg</span><span class="vmshipment_description">Envoi en France métropolitaine jusqu'à 3Kg</span>
I see the problem, and if i clean that field for each entry it works, but I do not find what is the file who generate this and include it in the database.
Perharps it is a change made by the previous webmaster ...
Do you know how I will be able to find this file ?
Thanks

GJC Web Design

administrator\components\com_virtuemart\plugins\vmpsplugin.php

protected function renderPluginName ($plugin)

you can over ride this function in any plugin
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

serge-web54

Ok, i see it :

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 = '<span class="' . $this->_type . '_description">' . $plugin->$plugin_desc . '</span>';
}
$c[$this->_psType][$plugin->$idN] = $return . '<span class="' . $this->_type . '_name">' . $plugin->$plugin_name . '</span>' . $description;

return $c[$this->_psType][$plugin->$idN];
}


How can I do to not have < working has html element ? 
should I report this as a bug that should impact others sites ? or Is this just my site ??

thanks

jenkinhill

Quote from: serge-web54 on September 23, 2018, 20:03:03 PM
( france < 3kg )

What happens if that is entered as   ( france &lt; 3kg )  ?
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

serge-web54

yes it works when entering that.
I have to change all my shipments in database.
I think this behaviour is not normal

kishoreonwork

you need to use php 'htmlentities' function . See below modified code for the same.



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 = '<span class="' . $this->_type . '_description">' . htmlentities($plugin->$plugin_desc ). '</span>';
}
$c[$this->_psType][$plugin->$idN] = $return . '<span class="' . $this->_type . '_name">' . htmlentities($plugin->$plugin_name) . '</span>' . $description;

return $c[$this->_psType][$plugin->$idN];
}




Thanks
Kishore
I am available for paid joomla and virtuemart consulting.
http://www.kishoreweblabs.com/
skype kishore2607