JulienHG Posted December 13, 2009 Share Posted December 13, 2009 HiSo When I link to a product page from an other website I get the following error message:Warning: Invalid argument supplied for foreach() in/home/heali40/public_html/store/modules/productscategory/productscategory.php on line 56When I go to that product page from the store no such error. Do I need to parse some kind of ID in the link?Thank you!Julien Link to comment Share on other sites More sharing options...
Martin Velikov Posted December 14, 2009 Share Posted December 14, 2009 Yes, the link to a product should contain an ID number. I am afraid I was not able to recreate the exact issue you described here but the link to a product should look like this:http://yourdomain.com/store/product.php?id_product=1Make sure links from the other web site look like this and you should not experience any troubles Link to comment Share on other sites More sharing options...
JulienHG Posted December 14, 2009 Author Share Posted December 14, 2009 Thank you. I get the same error when displaying the link in that way.You can see the problem in the attached screenshot. The product displays fine I just get that error only when I link from an outside site.I tried both formats:http://mystore.com/store/product.php?id_product=18-energy-sharingandhttp://mystore.com/store/healing-altars/18-energy-sharing.htmlThey both create the same error:Warning: Invalid argument supplied for foreach() in /home/heali40/public_html/store/modules/productscategory/productscategory.php on line 56Thank you in advance for any ideas you might have Link to comment Share on other sites More sharing options...
Martin Velikov Posted December 14, 2009 Share Posted December 14, 2009 Not really sure about a fix and what exactly is causing this behavior. You might try one of the following workarounds though:1. Delete the product and add it again. Check if it works now.2. Check the following tables in your prestashop database:ps_product - check "id_product" and "id_category_default" (you might have your product listed under several categories)ps_category_product - "id_category" and "id_product" (you will have one default category per product)id_product should point to the same category id (matching category IDs in those 2 tables) Link to comment Share on other sites More sharing options...
JulienHG Posted December 14, 2009 Author Share Posted December 14, 2009 I'll try that thank you.Just to add some info about this, this happens for every product, just tried it now.It does not happen when linking directly to a category or subcategory though. Link to comment Share on other sites More sharing options...
lynx887 Posted December 30, 2009 Share Posted December 30, 2009 I have the same issue, if you google this string it seems a lot of (Prestashop?) sites have it. productscategory/productscategory.php on line 56Any other ideas on how to fix?Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now