Import | Sorting Issues

(1/1)

gtechnology:
I need help getting an issue resolved. I'm almost positive someone else has gone through it and others will so getting it answered will benefit more than just myself. So all the help that I can get would be appreciated.

Here is the issue:
I am importing files to my Joomla site using as csv file. The products being imported are shoes. So I have the main product then the sub categories. I have placed them on the CSV file the way I want them to display. The weird part is that most them get posted exactly the way I ented them in the CSV file, but others sort at random. Taking this a step further: if I delete the products and categories then re-import the file the previous ones that weren't sorted are no sorted and others lose the sort. If I keep importing the sort is done at random.

To see exactly what I mean you would need to import the file (attached to this post inside the zip file) into joomla then go virtuemart > product list > click more information > on the products till you find a difference in the sorting. If you keep an eye on that product then deleted the info and re-import then go back to that same product most likely you will see the difference.


I don't want to rename the attributes as the way they are is what the client wants.

If someone has an answer to the issue please help. I am attaching a sample so that the issue can be duplicated. RolandD tested the issue and also came across the same results by the way.



Specs:

Joomla 1.5.8
Virtuemart 1.1.3 Stable
CSVI Improved 0.9
Open Office (used to modify file)
CSVI Settings: Field Delimiter ^ and the Text Delimiter "





I will keep testing and I find the answer before anyone else I will post it here.

gtechnology:
I found the necessary hack to fix this on the front end. Thanks to a post that I found in the VM Forum and some help from RolandD. The field that needed to be hacked was the product_id. Even though VM changes the sort, the import parses the data the way it was entered. The product_id is assigned according to the way the data was entered in the CSV. To fix the sorting on the front end I modified the following file that can be found in the following location:

administrator > components > com_virtuemart > classes > ps.product.attribute.php

line modified:

From This:

// Get list of children
$q = "SELECT product_id,product_name FROM #__{vm}_product WHERE product_parent_id='$product_id' AND product_publish='Y'" ;

To this:
// Get list of children
$q = "SELECT product_id,product_name FROM #__{vm}_product WHERE product_parent_id='$product_id' AND product_publish='Y' Order by product_id" ;

Added this to the end: Order by product_id (keep in mind that you can order by any field that is in the VM Table)

I hope this helps others that have struggled with this issue.

Navigation

[0] Message Index