VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: lindapowers on March 07, 2017, 21:10:43 PM

Title: Custom fields assigned to all products in order 3.0.19.8
Post by: lindapowers on March 07, 2017, 21:10:43 PM
Hi

Testing latest package 3.0.19.8 I encountered an issue where orders which contain a product with a field of type string are showing that custom field below every product in the order.

If you watch the image only the first product "naranjas de zumo (kg) has that custom field of type string "caliber standard" but is showing in all. The rest of the products don't even have that custom field assigned in the backend and of course is not chooseable from the frontend either.

(https://s22.postimg.org/n5fd2iifl/caliber.jpg)

I have updated from beta 3.0.19.4 where the issue does not happen.

Have no clue if this is a cache issue or how could it happen.

Regards

Title: Re: Custom fields assigned to all products in order 3.0.19.8
Post by: AH on March 08, 2017, 14:46:04 PM
Confirmed as a bug in the order line storage.

administrator\components\com_virtuemart\models\orders.php

Adjust the file to this:


private function _createOrderLines($virtuemart_order_id, $cart)
{
$_orderItems = $this->getTable('order_items');

foreach ($cart->products  as $priceKey=>$product) {

if(!empty($product->customProductData)){
$_orderItems->product_attribute = vmJsApi::safe_json_encode($product->customProductData);
} else {
$_orderItems->product_attribute = '';
}


This change will NOT affect orders already raised.

Title: Re: Custom fields assigned to all products in order 3.0.19.8
Post by: Milbo on March 08, 2017, 23:27:27 PM
Thanks for your missing Kudos