Jump to content

[SOLVED] How to correctly import categories that contain numbers?


Gipielle

Recommended Posts

I have many many categories. Each of the categories contain a code. The code has numbers, letters and special characters. All toghether are very long (more than 64/128 characters).

Now my question is: how can I import these categories exactly as they are in my database?

I tried to use the import tool, but prestashop 1.4.1.0 gives me strange behaviour because of the numbers contained in the names of my categories: PS once you click on a product in one of these categories it gets the number as an ID and it goes back to the category linked to that ID and not to the right product or category.

Post Scriptum: I head the 1.4.2.0 may solve this problem but i cannot find it: when does it go out ?

Link to comment
Share on other sites

This is the link of a product in my front office:

http://www.betafer.it/ps/101511-6600-m221-assortimento-77-utensili-con-ganci-senza-pannell

If you click on the product or view it, prestashop goes to an unknow category because of the url rewriting. in the url rewrite there is the name of the product and a code composed by numbers and letters. Prestashop gets that code as category ID and in this case it is not a category.

In this case our (product's prestashop ID = 66000221, category's ID 101511).
PrestaShop gets 6600 as category from the url rewriting giving an error.

In case the code would have been a valid prestashop category ID clicking the product link would put the custumer in a completely different category.

Because we have all our sub-subcategories (third level category) made of code and name, most of the links are wrong.

In the import csv file we gave as URL Rewrite a unique number (Each one of our products has its own number).

Link to comment
Share on other sites

Try this:
find in your prestashop installation file .htaccess and swap this two lines:

RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]* /foto/ua/category.php?id_category=$1 [QSA,L]
RewriteRule ^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /foto/ua/product.php?id_product=$1 [QSA,L]

Please let me know what happened.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...