Jump to content

Error when linking from outside the site


Recommended Posts

Hi

So 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 56

When 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

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-sharing
and
http://mystore.com/store/healing-altars/18-energy-sharing.html
They both create the same error:
Warning: Invalid argument supplied for foreach() in /home/heali40/public_html/store/modules/productscategory/productscategory.php on line 56

Thank you in advance for any ideas you might have

15901_NOFYVHjVLl8h7wHQDJg0_t

Link to comment
Share on other sites

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

  • 3 weeks later...

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...