Author Topic: Order of custom fields  (Read 22342 times)

cas

  • Jr. Member
  • **
  • Posts: 487
Re: Order of custom fields
« Reply #30 on: December 27, 2011, 22:04:23 pm »
Hi Electricity,

My post was from Dec 18th when RC3 was the latest version.   Did you check if it works now with VM2.0.0?  I just checked it and unfortunately the problem is still the same as I described in my Dec 18th post.  Any estimate when it will be fixed?   

Thanks,
Chuck

cas

  • Jr. Member
  • **
  • Posts: 487
Re: Order of custom fields
« Reply #31 on: February 05, 2012, 00:47:55 am »
Just updated to VM2.0.1.d and it still does not work.

cas

  • Jr. Member
  • **
  • Posts: 487
Re: Order of custom fields
« Reply #32 on: February 16, 2012, 07:22:06 am »
Just updated to VM2.0.1.K and it still does not work.

cvoogt

  • Jr. Member
  • **
  • Posts: 50
    • Plethora Design
Re: Order of custom fields
« Reply #33 on: March 20, 2012, 15:22:08 pm »
Not sure why this still hasn't been fixed but it's pretty simple;

Edit /administrator/components/models/custom.php

Right after this:
Code: [Select]
if($search){

$search = '"%' . $this->_db->getEscaped( $search, true ) . '%"' ;

$query .= 'AND `custom_title` LIKE '.$search;

}

Insert this (should be around line 191):

Code: [Select]
$query .= ' ORDER BY ordering ASC';
The custom fields list query had no ordering, and it was displaying them willy-nilly.

cas

  • Jr. Member
  • **
  • Posts: 487
Re: Order of custom fields
« Reply #34 on: March 20, 2012, 19:12:55 pm »
Thanks cvoogt.

VM team, can you let us know when this fix is implemented?

Actlas

  • Jr. Member
  • **
  • Posts: 69
Re: Order of custom fields
« Reply #35 on: April 26, 2012, 10:08:38 am »
Not sure why this still hasn't been fixed but it's pretty simple;

Edit /administrator/components/models/custom.php

Right after this:
Code: [Select]
if($search){

$search = '"%' . $this->_db->getEscaped( $search, true ) . '%"' ;

$query .= 'AND `custom_title` LIKE '.$search;

}

Insert this (should be around line 191):

Code: [Select]
$query .= ' ORDER BY ordering ASC';
The custom fields list query had no ordering, and it was displaying them willy-nilly.

This doesn't work for me? I added this code and I want to change the order of the custom fields of a product in the backend but they don't change in the frontend?!
Is there a workaround for this problem? I am using the latest version of Virtuenet.
This is a huge flaw imo

You can see an example here:
http://dev.actual-laser.be/index.php/e-shop/deurbellen-diepgegraveerd/california-cnc-detail

I also tried renaming the custom fields with aa and bb to check if it works in alfabethical order but it doesn't work either...

ash

  • Beginner
  • *
  • Posts: 43
Re: Order of custom fields
« Reply #36 on: May 15, 2012, 12:53:36 pm »
I have the same issue, latest version of Joomla and VM  I have a product with 6 custom fields, and regardless of the order in the back end the front end just shows them how ever it wants to, I try to change the order of the fields in the Joomla admin but the sort order or move up and down does not work.

Is there still not a fix for this as it would appear this issue has been around for a while now.

ash

  • Beginner
  • *
  • Posts: 43
Re: Order of custom fields
« Reply #37 on: May 15, 2012, 15:27:58 pm »
Well the only way to resolve this issue was to go to the database and edit the order numbers to the order i want them in

1 custom attribute
2 custom attribute
3 custom attribute
4 custom attribute
etc etc

In the front end my custom fields for my products are now ordered correctly so the shopper is now able to buy an item without being completely confused about the product asking them for their items colour before actually choosing the product style first.

Not being able to order this list is one of the biggest pitfalls in Virtuemart, i recommend that people with large stores with many attributes use another solution or think and plan very very carefully first.

The only issue i see is that if another attribute becomes available for a product and needs to slot in between two others, then this is going to either be practically impossible or take you a heck of a long time to do.

Serious thinking on this major issue needs to be thought through by the developers.

Gees lets make it a $10 component and get it working right, i would pay that all day long. Even better if it had dynamic attributes like many of the free wordpress stores or magento.

Bigfish

  • Beginner
  • *
  • Posts: 8
  • Joomla2.5.4 & VM2.0.6 (Fresh Installs) PHP5.2.17
Re: Order of custom fields
« Reply #38 on: May 16, 2012, 20:43:31 pm »
Have the same problem.
I loaded 19 custom fields & tried to sort etc but no luck so started a thread (http://forum.virtuemart.net/index.php?topic=102729.0) then found this one.


Joomla 2.5.4 & VM 2.0.6 (Fresh Installs) PHP 5.2.17

cas

  • Jr. Member
  • **
  • Posts: 487
Re: Order of custom fields
« Reply #39 on: July 17, 2012, 01:56:41 am »
VM Team,

Can you let us know when this will be fixed?

razor7

  • Jr. Member
  • **
  • Posts: 325
    • MGSCreativa - Professional VM!
Re: Order of custom fields
« Reply #40 on: July 17, 2012, 19:23:56 pm »
Hi, I have ran into this issue again, solved this way on VM 2.0.8c :
Changed administrator/components/com_virtuemart/models/customfields.php line 818
Quote
      $query .= ' and is_cart_attribute = 1 group by virtuemart_custom_id';
To this
Quote
      $query .= ' and is_cart_attribute = 1 group by virtuemart_custom_id order by C.ordering';

Missing ordering statement!

Also, in custom field administrator, there is no way to get the items ordered by ordering columnb, bacause no matter if you click the orering column title, there is no ordering performed.

Best regards!
MGS Creativa - VirtueMart Payment Plugin Experts
http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more!
http://www.mgscreativa.com/en/online-store

sleepigrl

  • Jr. Member
  • **
  • Posts: 50
Re: Order of custom fields
« Reply #41 on: August 07, 2012, 19:24:39 pm »
razor7, you and I were on the same track!

I was in the process of modifying some other queries for ordering when I found your post.  I've made some additional changes and the end result is that the custom fields for the product are be sorted by (1) custom field order then (2) order within the custom field.

I made the changes to administrator/components/com_virtuemart/models/customfields.php @ lines 418, 735, 819 and 854.  The following is a WinMerge generated patch file.

Code: [Select]
418c418
< Where `virtuemart_product_id` =' . $virtuemart_product_id . ' order by field.`ordering` ASC';
---
> Where `virtuemart_product_id` =' . $virtuemart_product_id . ' order by C.`ordering`, field.`ordering` ASC';
735c735
< $query .= ' and is_cart_attribute = 0 order by field.`ordering`,virtuemart_custom_id';
---
> $query .= ' and is_cart_attribute = 0 order by C.`ordering`, field.`ordering`,virtuemart_custom_id';
819c819
< $query .= ' and is_cart_attribute = 1 group by virtuemart_custom_id';
---
> $query .= ' and is_cart_attribute = 1 group by virtuemart_custom_id order by C.ordering';
854c854
< $query .= ' ORDER BY field.`ordering`';
---
> $query .= ' ORDER BY C.`ordering`, field.`ordering` ASC';


In the admin, clicking the ordering button still has no effect, but input into the ordering fields does seem to be saved. 

easy

  • Jr. Member
  • **
  • Posts: 69
Re: Order of custom fields
« Reply #42 on: August 07, 2012, 21:22:21 pm »
Thank you sleepgirl & razor7!
Great job - it works well!

cas

  • Jr. Member
  • **
  • Posts: 487
Re: Order of custom fields
« Reply #43 on: August 07, 2012, 22:22:13 pm »
VM team,

Any chance to fix this in the base so we don't have to hack the code? 

encreplus

  • Jr. Member
  • **
  • Posts: 198
    • Dr-ink
  • VirtueMart Version: 3.0.10
Re: Order of custom fields
« Reply #44 on: August 24, 2012, 16:15:09 pm »
Dont work on 2.0.10 ;(

Stefan