Posts

PrestaShop categories block empty after migrating from osCommerce

To migrate an osCommerce webshop to PrestaShop 1.5 I used the migration module from Presto Changeo. It worked just as specified, importing categories, products and customers from a running osCommerce webshop. One important thing before you start is that the module will empty all your existing customers, categories and products in your PrestaShop so make shure you are using it on a new shop.

I’ve been working on the PrestaShop installation for a while so it was not a fresh 1.5 install but had been upgraded from 1.3 to 1.4 and then 1.5 (yes it has not been in production before). This is probably the cause of my problems that occured.

The module works fine even if the osCommerce is running on a different servern than the PrestaShop. I small php file must be uploaded on the server running the osCommerce. The import can take several hours especially if there are many products and images. The script can be running in the background emailing you the progress each 5 minutes. If the mail stops coming or you get an error 500 when running in the foreground you simply must go into the module and click resume each time an error 500 occurs until the import is completed.

After the import I could see the categories, products and customers in the back office but the front office blockcategories didn’t show any products. I found that the problem probably was caused by the support for multistore introduced in PrestaShop 1.5.

Solution: 

  1. You need to access the PrestaShop MySQL databas using phpMyAdmin.
  2. Open the table ps_categories. The id_category 1 is the root category. Find which id the home category has (it will have the field is_root_category set to 1). The home category is probably id_category 2.
  3. Open the table ps_configuration and find the key PS_ROOT_CATEGORY and make shure it has value ‘1’ (the id_category of the root category).
  4. Find the key PS_HOME_CATEGORY and make shure it has the value of id_category for the home category, probably ‘2’.
  5. Go to the back office, in the preferences menu go to the general settings. Activate multi store.
  6. In the advanced parameters menu, go to Multi store. 
  7. Click on the default group and edit your store. Select the Home category as Root category. Save the store.
  8. Go back in the preferences menu general settings and disable the multi store.

Now the categories should display in the blockcategories in the front office. 

PrestaShop subcategories not visible in blockcategories

PrestaShop subcategoriesAfter upgrading to PrestaShop 1.5.3 (and 1.5.4) the subcategories where not showing up anymore in the categories block. The solution was quite simple: 

Just deinstall the categories block in the modules section and then install it again. After reinstalling, it will probably be necessary to adjust the block position. 

Getting “An error occurred while updating object. lang ()” in PrestaShop

If you get the error message "An error occurred while updating object. lang ()" when updating a language in PrestaShop, this is caused when the system doesn’t have permissions to write in the .htaccess-file in your root directory.

If the file does not exist, just create an empty .htaccess-file and make sure it is writeable by the user running the webserver process, for example by issuing: 

chmod 666 .htaccess

Moving a PrestaShop 1.4 webshop

 When moving a PrestaShop version 1.4 webshop to a new domain name (from a development server to a live site for example) you must do the following: 

  1. Make sure all directories are writeable according to the PrestaShop installation instructions.
    Don’t forget that the files in config directory must be writeable as well as the entire cache directory structure. All files and directories in tools/smarty/compiletools/smarty/cache, tools/smarty_v2/cache and smarty_v2/compile must also be writeable.
    Internal server error 500 is a sign that these directories or files are not writeable.
  2. Update the file config/settings.php regarding PS base URI (if that will change) and the database settings.
  3. After importing the database on the new server use a tool like phpMyAdmin to access the database.
  4. Login to the Back Office of your shop on the new domain and go to Settings -> SEO & URLS and update the domain name for the shop (two fields). If this is not successful use the steps 5-7, otherwise go to step 8.
  5. Find a table named ps_configuration.
  6. Find the records PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL
  7. Update the values with your new domain name. You should enter just the domain name, no leading http:// or trailing path to subirectories (if your shop is located in a subdirectory, that should be entered in the PS base URI in step 1).
  8. If you use .htaccess and robots.txt files, go to Tools -> Generators and regenerate them.

 

PrestaShop module TECHNICAL ERROR

On a PrestaShop 1.3.2.3 installation I purchased the One Page Checkout 1.2.2 and installed it. After that I got the following error message when trying to add a product to the basket in the shop front end: TECHNICAL ERROR: unable to add the product.

Details:
Error thrown: [object XMLHttpRequest]
Text status: parserror

Solution: The reason is the web server is running in SAFE MODE and the user owning all the PrestaShop files is the FTP user I use to upload the shop. When installing the One Page Checkout module it will be owned by the user running the web server process (in my case www-data:www-data). In SAFE MODE a php script is not allowed to execute a script owned by another user. The solution is to set the owner of all the order-files in the PrestaShop directory to my FTP-user (including the files installed by the OPC module). In a shell this is simply done by the chmod command: cd prestashop-installation-dir chown -R my-user:my-group order* (Replace prestashop-installation-dir with the real path where PrestaShop is installed and my-user:my-group to the userid:grouid owning the rest of the files in the Prestashop installation.)

Prestashop 1.2.x not showing Categories box

Problem: In the front system (FS) Prestashop is not showing the Categories box. In the back system (BS), clicking on the Catalog tab shows just a blank page, or an error message saying the page is unavailible. The probable reason is that your Home category is missing or messed up. The problem is that you can’t get into the Catalog tab in the backend system to fix it. I ended up in this situation by trying to import categories as a CSV (comma/semi colon separated file) and I had a category in that file with ID = 1. Category ID number 1 is reserved for the Home category. Prestashop did not filter this or issue a warning during the import. So take it from me – do not try to import a category with ID = 1. Prestashop table ps_category in phpmyadminSolution: I opened my database with phpmyadmin and went to the ps_category table. The row for id_category 1 was messed up and by comparing it to a backup I set it to: id_category = 1, id_parent = 0, level_depth = 0, active = 1. The dates I left as they were. Then I went into the table ps_category_lang and made sure that there were entries for id_category 1 for all languages that I had installed (I had two in my system). Voila, back and front system now works. By adjusting the ID:s in my category import file (making sure no ID was 1) it worked like a charm to import it.