0

I have created a new attribute which is going to help sort our products in the search, but when it comes to sorting the attribute by number it seems to only be taking in the first number for example i imported these numbers

SKU - Attribute number

0125 - 999

0126 - 78984

0127 - 89

0128 - 998

Then when i sort by attribute number it puts them in this order

SKU - Attribute number

0125 - 999

0128 - 998

0127 - 89

0126 - 78984

which as you see isnt correct the sku 0126 should be at the top followed by 0125 then 0128 then 0127.

So i tried a new method of giving them all the same length number ( a 4 digit number) however when i go to important the .xml file or the .csv file it is missing the first number because it is a zero

for example

Imported 0123 but when i look in the back end it display as 123 and i have to add the zero manually, is there a way round this as we have over 5000 products so i cant sit here and add a zero on all my products

How can i either get it to sort the product in the correct order and not go just by the first digit, or get the Zero to appear when i import a csv or xml file?

If you need for information or screenshots let me know.

Thank you

2

You new attribute must have type 'int'. I assume in your case is varchar or text.
It seams that the sorting work, but it sorts the numbers alphabetically. They are considered as text.

  • Yea the input field is text, if i set the input field to price could that work instead? – Adam Allen Dec 8 '14 at 10:50
  • it should...but only if the backend type is decimal in this case. – Marius Dec 8 '14 at 10:52
  • ok i will give a go, once again you save the day – Adam Allen Dec 8 '14 at 10:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.