I have been able to correct errors shown readed here doing the following:
Modifying the API call like this:
//API URL to get product by ID. Use https!
$requestURL = "https://" . $url . "/api/products/". $id . "&ws_key=" . $webservice_key;
Adding the API KEY to the image call:
$image_id = sanitize_text_field((string)$parse_data->product->id_default_image);
$image_url = $url . "/api/images/products/" . $id . "/" . $image_id . "&ws_key=" . $webservice_key;
Plus if you want your prices shown TAX included, modify like this:
function ps_product_display_price($price)
{
setlocale(LC_MONETARY, 'es_ES');
return money_format('%.2n', $price*1.21);
}
]]>
Hi, thank you for this plugin – FINALLY something that actually works, when adding the webservice the correct way.
It seems I have problems with my https://
Everytime I load the WP-page containing the PS products, it asks the visitor for a username and password for the prestashop-store-domain. https://www.myshop.com.
In the code for this plugin it says:
//API URL to get product by ID. Use https!
$requestURL = "https://" . $webservice_key . "@" . $url;
$requestURL .= "/api/products/" . $id;
So I can’t quite figure out what’s the problem. Maybe you can?
And the image is not there, I changed the path in the product_display_for_prestashop.php to work with my image-path, but the image id’s are not handled correctly in the script itself.
Product id 41 will not be images/41/image-id, it will be a completely different path.
E.g https://yourdomain.com/1981-large_default/name-of-your-product.jpg
Where the 1981 is the ID of the image, and this image-id can differ from the actual product-ID. The images have their own id’s.
Any chance you will update this nice plugin, so it’s usable? ??
Prestashop 1.6.1.16
]]>Hi, i have the same problem of @friksos . How did you solve it then?
]]>Hi, i am using prestashop 1.6.1.16 and i followed the installation guide but when i try to display a product a get this message “Product query unexpected return: Unauthorized”.
If i go to https://mydomain.com/api there is a http authentication box asking for username and password so i think the plugin can not communicate with prestashop because of that. Can you help?
Thank you.