PrestaShop Forums: 1.3 Attribute Order Update - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


1.3 Attribute Order Update


1.3 Attribute Order Update

#1 sgtbash

    PrestaShop Apprentice

  • 08 Oct 2009
  • Members
  • PipPip
  • 98 posts

Posted 01 June 2010 - 12:54 PM

Hi All,

Just updated my first of 5 shops to 1.3 and noticed that my attributes are now ordered in alphabetical order and not by the order entered as in 1.2.5.

This is great for most attributes, but makes a Small/Medium/Large/X Large/XX Large list look horrible putting large first.

Where has the change been made? and can it be reversed?

Dan
Nineplus Wetsuits & Surfboards (Happily using PS)
Nineplus Australia First of our global sites to be moved from Actinic to PrestaShop

#2

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 14 June 2010 - 09:01 AM

did you find any solution? I'm the same as you...

#3

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 14 June 2010 - 09:31 AM

Nope, it still is ordered like this:

Large
Medium
Small
X Large
XX Large

I've got no idea how to solve it =(

#4

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 02 July 2010 - 07:12 PM

Try this out - http://www.presto-ch...bute-order.html

Works flawless, i just brought this literally 2 mins ago, installed and bobs your uncle. Simple drag and order.

He has some really great other modules too, i think he should work for prestashop :)

#5

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 02 July 2010 - 08:04 PM

Hi,

You are right I have it and it's a real easy and effective module!

Regards.

#6

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 02 August 2010 - 07:18 AM

From 1275393277:

Hi All,

Just updated my first of 5 shops to 1.3 and noticed that my attributes are now ordered in alphabetical order and not by the order entered as in 1.2.5.

This is great for most attributes, but makes a Small/Medium/Large/X Large/XX Large list look horrible putting large first.

Where has the change been made? and can it be reversed?

Dan


This is bugging me out, anyone found a solution to this. I don't want to install a module for this. Would appreciate it if someone can point me in the right direction. Thanks

#7

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 30 August 2010 - 10:46 PM

**SOLVED* Hi sgtbash and everyone else looking for the same solution.

The attribute order of 1.3 can be reversed back to the order as in 1.2.5. To do this make the following changes;

1. In /classes/Product.php function: getAttributesGroups()

replace
ORDER BY al.`name`');

with
ORDER BY pa.`id_product_attribute`'); 


2. In /product.php

comment out the following on lines 285 and 286
foreach($groups AS &$group)
natcasesort($group['attributes']);

to
// foreach($groups AS &$group)
// natcasesort($group['attributes']);


Please Note: The order of attributes is the order in which you add them to each product. I will soon post a more elegant solution where you can set the order of the attributes in each group in the back office.

#8

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 24 September 2010 - 10:00 PM

Thank you justme54s !!!
It solved my problem too !!! I just been playing with Prestashop for a couple of days now, and it looks very promising !!
Your help is very much appreciated !!

Marcelo.

#9

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 20 October 2010 - 05:42 AM

HELP!

I tried the above but when I changed them and uploaded them my homepage goes completely blank.

I'm not sure if this matters but the lines that are supposed to be replaced, there is a space missing between foreach and the bracket. I.e. when you search:

foreach($groups AS &$group)
natcasesort($group['attributes']);

it can't find it, so you have to search for the same with a space, as in:

foreach ($groups AS &$group)
natcasesort ($group['attributes']);

I'm new to Prestashop, but I thought I followed this pretty closely

#10

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 26 October 2010 - 11:38 AM

Hi everyone.

First of all thank's to justme54s! It work's form me.
I think we all expecting your promised module.

Meanwhile I attached the two modified files. Just replace it, and it's done.
You will have the sort order by ID. In my case (s, m, l, xl, xxl).
Don't forget! The order of attributes is the order in which you add them to each product.

Replace the first file (Product.php) in root/classes/product.php
Replace the second file (product.php) in root/product.php

It's coded in prestashop version 1.3.2. Older versions are not tested!


classyjoes, indeed It have some space errors, so you can download the two file attached and it will work for you.

Attached File(s)



#11

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 17 December 2010 - 05:00 AM

@ Jeet Kune Do ... Worked great, thank you!!

#12

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 10 January 2011 - 05:06 PM

Hello

I have pretashop version 1.3.5 and tried to make the changes as suggested on here but i get a blank page. I downloaded the files and compared to make sure all spacing was correct etc and as far as im concerned they are exactly the same as suggested on here.

Could this be anything to do with me having a newer version? Or any ideas what I may be doing wrong please?

thanks

Rob

#13

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 08 February 2011 - 12:27 PM

I too get a blank page.
Messed about for ages to get it back to normal.
Can someone comment what could be going wrong here?
I am using the 1.3.6.0 version btw.

#14

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 March 2011 - 07:22 PM

Hi,

Who solved this? I have the same problem.

Ths

#15

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 12 March 2011 - 04:05 PM

Thank-You Very, Very much for posting a fix for the funky attributes order issue justme54s and to Jeet Kune Do for posting the files!!

I have been struggling with this attribute order for dang near half a day now and your fix seems to be working for me so far. I am running PrestaShop v.1.3.7 and so far I have not run across any errors.

So again I applaud you for finding a fix for the attribute order.

#16

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 22 March 2011 - 12:10 PM

Hi Dishpet,

How do you solvet this? I make the changes but I get a blank page. I am using with V.1.3.7. Can you help me please?

Ths

#17

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 29 March 2011 - 12:22 PM

In version 1.4 you have to change in classes/Product.php on line 2136:
ORDER BY agl.`public_name`, al.`name`');

to
ORDER BY agl.`id_attribute_group`, al.`name`');


and the same modifications must be made in classes/Cart.php, on line 420, for the attributes to be sorted in the same way in the shopping cart.

#18

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 17 April 2011 - 08:25 PM

Quote

In version 1.4 you have to change in classes/Product.php on line 2136:
ORDER BY agl.`public_name`, al.`name`);

to
ORDER BY agl.`id_attribute_group`, al.`name`);

and the same modifications must be made in classes/Cart.php, on line 420, for the attributes to be sorted in the same way in the shopping cart.


Only changing this line in the 1.4 will not disappear me 01. 02. etc.

Thanks in advance

#19

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 19 April 2011 - 09:24 AM

From 1303068357:

Quote

In version 1.4 you have to change in classes/Product.php on line 2136:
ORDER BY agl.`public_name`, al.`name`);

to
ORDER BY agl.`id_attribute_group`, al.`name`);

and the same modifications must be made in classes/Cart.php, on line 420, for the attributes to be sorted in the same way in the shopping cart.


Only changing this line in the 1.4 will not disappear me 01. 02. etc.

Thanks in advance


The solution that I was reffering to doesn't require adding numbers before the name of the attribute, it will sort the attributes by the order they were added in BO.

#20

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 19 April 2011 - 09:28 AM

The problem is that I'm adding to csv and I was not properly organized.

The combinations are dates in format 01-01-2011 02-01-2011.

Prestashop organize:

01-01-2011
01-02-2011
01-03-2011





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users