Welcome, Guest. Please login or register.
Login with username, password and session length


Need help or want to talk to other developers? Join the VirtueMart Chat! Read more...

  Advanced search

247038 Posts in 67506 Topics- by 258314 Members - Latest Member: aniketana
Pages: [1] 2 3 4   Go Down
Print
Author Topic: Child Product Display Order  (Read 18778 times)
Linda24
Newbie
*
Posts: 2


« on: June 28, 2008, 11:36:53 AM »

I am new to virtuemart. Although I added my child products (parent = album cd, child = tracks) in order of track number, the ordering goes all funny when I try to assign the child product to the song the customer will be downloading. How do you manage the order of child products?
Logged
robiw
Newbie
*
Posts: 31


« Reply #1 on: July 29, 2008, 04:35:17 AM »

Have exactly the same problem with ordering the display of child products.

The child products were all entered in proper order of increasing size and the item id's are all consecutive. Products have varying nos of children from 2-8.

It's not so bad at the lower end but when 8 options are shown and customer has to search for the size from a list that follows no logic it is a serious usability problem.

Is there any sort of workaround?

--- RobiW
Logged
3by400, Inc.
Newbie
*
Posts: 5


« Reply #2 on: July 30, 2008, 20:36:53 PM »

Same problem here. I've tried controlling by order enter, SKU, and naming convention (alphabetical), but to no avail!

Please help!

Thanks,
Beth
Logged
samoht
Full Member
***
Posts: 104


« Reply #3 on: August 09, 2008, 20:19:05 PM »

I am having the same issue,

I solved it once with a hack - but now I cant remember where. What we need to do is find the query for the child products and add 'ORDER BY field_to_orderby; to the end.

Anybody have an idea where this query might be??

Logged

I use Joomla 1.5! and VM 1.1
samoht
Full Member
***
Posts: 104


« Reply #4 on: August 09, 2008, 20:46:44 PM »

ok,

I found what I was looking for and maybe it will help some of you.

in ps_product_attribute.php in the function list_attribute_drop after you see:
      
// Get list of children
then the sql query is there change from:
	
	
$q "SELECT product_id,product_name FROM #__{vm}_product WHERE product_parent_id='$product_id' AND product_publish='Y'" ;

to:

	
	
$q "SELECT product_id,product_name FROM #__{vm}_product WHERE product_parent_id='$product_id' AND product_publish='Y' Order By product_sku" ;

the last part is the important one - I set mine to product_sku because it makes adding and deleting easier to not mess up the order. Only problem is that this is a hack of the core code so if you do an update you will lose this! - So remember where it is : )
Logged

I use Joomla 1.5! and VM 1.1
haastyle
Newbie
*
Posts: 4


« Reply #5 on: August 24, 2008, 17:58:34 PM »

I want to be able to order it in anyway I want to. Right now on my page it puts the sizes all weird.
X-Large
Medium
Large
Small

I'd like to put that a nice order without have to edit my skus.  Right now the skus are like this T001XL, T001L, T001M, T001S.  If I were to order it by sku I would have to rename all the skus.
Logged
samoht
Full Member
***
Posts: 104


« Reply #6 on: August 26, 2008, 10:48:27 AM »

sku numbers dont have to make sense to everyone just you. If you 'Order by' sku number then that's exactly what you'll get - you can order by any of your fields on the table. If you have access to phpMyAdmin for the table you can even add a field called order then put your order in there. The problem would be not being able to update from the VM administration panel.

why not try sku's like: T001XL, T002L, T003M, T004S - this will give you the order you want? or if the 001 is something you desperately want to keep in your sku #'s then try: T0011XL, T0012L etc - you can even put a dash in your sku (e.g. T001-1-XL)
Logged

I use Joomla 1.5! and VM 1.1
haastyle
Newbie
*
Posts: 4


« Reply #7 on: August 26, 2008, 19:45:20 PM »

alright i did that code edit, hopefully they will add this an update
Logged
Invisible Inc
Newbie
*
Posts: 10


« Reply #8 on: January 20, 2009, 15:44:39 PM »

Thanks for the ideas on this. Problem solved. Just ask Martin!
Logged
lrawling
Newbie
*
Posts: 23


WWW
« Reply #9 on: January 20, 2009, 16:40:12 PM »

This solution didn't work for me as I have different display setups. Where I have a list order it worked beautifully but where the child products are listed in a dropdown box the dropdown box no longer appeared (only the qty and add to cart button).

Invisible Inc, who is Martin? Does he have a different solution?Huh

Cheers,

Liz
Logged
Andrew
Jr. Member
**
Posts: 73


« Reply #10 on: January 28, 2009, 19:51:36 PM »

This doesn't seem to work for me either. I have products with 2 child attributes, such as ABC-2, ABC-4, ABC-6...etc up to 14. But it displays in a very strange order (14, 2, 4, 10, 12, 6, Cool. I have tried the ORDER BY product_sku suggestion, but it did nothing. Anybody got any other ideas?
Logged
slappadudle
Newbie
*
Posts: 25


« Reply #11 on: February 03, 2009, 01:33:30 AM »

Thanks for the ideas on this. Problem solved. Just ask Martin!

Who's Martin? How did you resolve this issue? I tried the code entries above and they did nothing. I have been pulling my hair out for weeks trying to solve this one. It seems any solutions I find work for some people but not others and NOT ME!
Logged
macallf
Hero Member
*****
Posts: 2420



WWW
« Reply #12 on: February 03, 2009, 05:58:48 AM »

OK, I have been away! But since some one pm'd me I thought I had better give some insight into this.

ps_product_attribute.php has 2 routines for displaying child products.

1. for dropdown:
   function list_attribute_drop( $product_id, $cls_suffix ) {

2. for list with one add to cart button and 1 add to cart button for each child:
   function list_attribute_list( $product_id, $display_use_parent, $child_link, $display_type, $cls_sfuffix, $child_ids, $dw, $aw, $display_header, $product_list_type, $product_list ) {

There is a third, but that is still in development and is as such not used!

If you altering the sql's then you have to alter the correct one or ones that you are using. It is as easy as adding an ORDER_BY and then the field at the end of the sql's.

Now to ordering by size, sql orders either numerically or alphabetically. s, m, l, xl will never get sorted correctly because it is not alphanumerically sortable!

It will always come out l, m, s, xl or xl, s, m, l. Thats why using a recognised SKU that can be sorted. eg. prod_1_alt_1, prod_1_alt_2 etc these, e.g. would refer to the small and medium sizes and would always be sorted correctly.

I hope this explains and helps.
Logged

Mark
All of My old mods are now available on my website.
Mark Callf Designs

If you like the work I've done for VM please fell free to Donate

Please Note: I am no longer actively developing or involved with VM development.
bulesz
Full Member
***
Posts: 186



« Reply #13 on: March 03, 2009, 16:17:37 PM »

ACE! thanks!
Logged
EquiProVM
Jr. Member
**
Posts: 54



WWW
« Reply #14 on: April 27, 2009, 09:11:05 AM »

could you give an example as to how to do this (the correct text, for example).  I have found the code in the ps_product_attribute.php that you are discussing and I would like to have the children listed by the product_id.  What would I add to the code to have it do this, and where?

This is what I think I found in the ps_product_attribute.php file (hopefully this is the right place):

return $this->list_attribute_list( $product_id, $display_use_parent, $product_list_child, $display_type, $class_suffix, $child_option_ids, $dw, $aw, $display_header, $product_list_type, $product_list ) ;
         break ;
         case "YM" :
            return $this->list_attribute_list( $product_id, $display_use_parent, $product_list_child, $display_type, $class_suffix, $child_option_ids, $dw, $aw, $display_header, $product_list_type, $product_list ) ;
         break ;
         case "N" :
         default :
            return $this->list_attribute_drop( $product_id, $class_suffix ) ;
         break ;


This is a pretty complex code in this file (for me, anyway).  I definitely don't want to screw things up.  If someone could show me the EXACT way to have it order by product_id OR by SKU, that would be so great because I would almost be done with my site.  Keep in mind that I'm VERY inept with code, so you can't be too clear!  Thanks!
« Last Edit: April 27, 2009, 09:17:48 AM by EquiProVM » Logged
Pages: [1] 2 3 4   Go Up
Print
Jump to: