Author Topic: when < in shipping mode , not working  (Read 236 times)

serge-web54

  • Beginner
  • *
  • Posts: 43
when < in shipping mode , not working
« on: September 23, 2018, 20:03:03 pm »
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

  • Global Moderator
  • Full Member
  • *
  • Posts: 1720
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: when < in shipping mode , not working
« Reply #1 on: September 23, 2018, 21:04:27 pm »
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.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

serge-web54

  • Beginner
  • *
  • Posts: 43
Re: when < in shipping mode , not working
« Reply #2 on: September 24, 2018, 10:37:06 am »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8183
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: when < in shipping mode , not working
« Reply #3 on: September 24, 2018, 12:28:17 pm »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

serge-web54

  • Beginner
  • *
  • Posts: 43
Re: when < in shipping mode , not working
« Reply #4 on: September 24, 2018, 13:51:25 pm »
Ok, i see it :

Code: [Select]
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26993
  • Always on vacation
    • Jenkin Hill Internet
Re: when < in shipping mode , not working
« Reply #5 on: September 24, 2018, 16:45:00 pm »
( france < 3kg )

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

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM 3.4.0.9935 on Joomla 3.8.12 PHP 7.0.31
Testing VM 3.4.0.9941 on Joomla 3.8.12

serge-web54

  • Beginner
  • *
  • Posts: 43
Re: when < in shipping mode , not working
« Reply #6 on: October 03, 2018, 06:01:53 am »
yes it works when entering that.
I have to change all my shipments in database.
I think this behaviour is not normal

kishoreonwork

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 52
  • Free Virtuemart Consulting For Non Profits
    • virtuemart expert
  • Skype Name: kishore2607
  • VirtueMart Version: 3
Re: when < in shipping mode , not working
« Reply #7 on: October 03, 2018, 10:29:11 am »
you need to use php 'htmlentities' function . See below modified code for the same.

Code: [Select]

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