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

How to Order Cart Variant/Custom fields in product detail

Started by mronayne, January 31, 2015, 00:28:15 AM

Previous topic - Next topic

mronayne

In VirtueMart 3.0.4 how can I reorder the position of Cart Varient and Custom Fields in the addtocart "Layout position"?
I cannot find any way to place these cart variant and custom fields in a specific order on the product details page.
Is there a way to do that?

bluezeyes

Try to ordering them in the custom field list.

Kind regards,

Bluezeyes

mronayne


NielsJE

Hi,

I have VM2.6.14 but had the same problem and was able to solve it.
It is a bug in VM, maybe it is still in VM3.

It is function getProductCustomsFieldCart from administrator/components/com_virtuemart/models/customfields.php.

Around line 821 you find


// group by virtuemart_custom_id
$query = 'SELECT C.`virtuemart_custom_id`, `custom_title`, `show_title`, C.`custom_value`,`custom_field_desc` ,`custom_tip`,`field_type`,field.`virtuemart_customfield_id`,`is_hidden`
FROM `#__virtuemart_customs` AS C
LEFT JOIN `#__virtuemart_product_customfields` AS field ON C.`virtuemart_custom_id` = field.`virtuemart_custom_id`
Where `virtuemart_product_id` =' . (int)$product->virtuemart_product_id . ' and `field_type` != "G" and `field_type` != "R" and `field_type` != "Z"';
$query .= ' and is_cart_attribute = 1 group by virtuemart_custom_id ORDER BY field.`ordering`';


You only need to change the last row.
ORDER BY field.`ordering`
should be
ORDER BY C.`ordering`

It was first sorting on custom option level, not on custom level itself.

That solves the problem for me. Now its a hack, but maybe should solved in next version  ;)

Niels

sandstorm

I am using;
Virtuemart 3.0.8
Joomla 3.4.3

In Custom Fields, there is drag/drop ordering, but it seems a bit wonky. Upon saving, sometimes it saves OK & other times not.
If I go into each custom field manually and set the order number, this then shows in the back end as being ordered OK,

But in the front end, on a product page showing some String Custom Fields, the ordering is random, even after clearing all site & Browser cache.

Is there a bug/problem with ordering custom fields this way?

If not can anyone point me in the right direction of solving this.

Thanks

Andy

J3.6.4 / PHP7.0.12
VM3.0.16

jenkinhill

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