News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Custom fields assigned to all products in order 3.0.19.8

Started by lindapowers, March 07, 2017, 21:10:43 PM

Previous topic - Next topic

lindapowers

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.



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


AH

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.

Regards
A

Joomla 3.10.11
php 8.0

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/