VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: blackjet9999 on December 12, 2012, 00:47:52 AM

Title: False rendering with the product name that has quotation mark in vmprices.js
Post by: blackjet9999 on December 12, 2012, 00:47:52 AM
I'm using Joomla 2.5 and Virtuemart 2.0.6

If the item title has a quotation mark, the title will only show the characters before the quotation.

For example, if a product name is 42" LED TV, the popup shows only 42.

How would I fix this?

I've known this bug by
jQuery(document).ready(function($) {

for (var i = 0; i < $("form.product").length; i++){
var cart = $("form.product")[i];
cart = jQuery(cart);
console.log(cart.find(".pname"));
}

Virtuemart.product($("form.product"));

$("form.js-recalculate").each(function(){
if ($(this).find(".product-fields").length) {
var id= $(this).find('input[name="virtuemart_product_id[]"]').val();
Virtuemart.setproducttype($(this),id);

}
});
});
Title: Re: False rendering with the product name that has quotation mark in vmprices.js
Post by: blackjet9999 on December 12, 2012, 01:40:15 AM
This has been fixed by replacing this code in this file: com_virtuemart/virtuemart/default_products.php
from:
<input type="hidden" class="pname" value="<?php echo $product->product_name ?>">
to:
<input type="hidden" class="pname" value="<?php echo htmlentities($product->product_name?>">

Cheers!
Title: Re: False rendering with the product name that has quotation mark in vmprices.js
Post by: Milbo on December 18, 2012, 03:17:17 AM
Thanks