AlbertoV
Members-
Posts
25 -
Joined
-
Last visited
Profile Information
-
Location
Italia
-
Activity
Other
AlbertoV's Achievements
Newbie (1/14)
1
Reputation
-
Manually run product availability alerts
AlbertoV replied to jennywill's topic in Ecommerce x PrestaShop [ARCHIVE BOARD]
I'm also facing the same problem. I would like to manually trigger the script that will inform users about the new availability. -
Hello, I'm trying to edit a product image but it doesn't work. My code is: public function editImage($prod_id,$img,$img_id){ $img_url= (Yii::getAlias('@app').'/web/img/'.$img); $url = PS_SHOP_PATH. 'api/images/products/'.$prod_id.'/'.$img_id; //$cfile = curl_file_create($img_url,'image/png', 'image'); $cfile = new \CURLFile($img_url,'image/png', 'image'); //$data = array("image" => $cfile); $ch = curl_init(); $headers = array("Content-Type:multipart/form-data"); //curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_URL, $url); //curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_PUT, true); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 0); curl_setopt($ch, CURLOPT_HTTPAUTH, 'CURLAUTH_BASIC'); curl_setopt($ch, CURLOPT_USERPWD, PS_WS_AUTH_KEY.':'); curl_setopt($ch, CURLOPT_POSTFIELDS, $cfile); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); if(curl_exec($ch) === false) { echo "<br><br>Error : ".curl_error($ch)."<br>"; } else { echo '<br><br> Image added'; } curl_close($ch); //$result = curl_exec($ch); //curl_close($ch); //return($result); } Do you have any suggestion?
-
Add product image via webservice
AlbertoV replied to eggandspam's topic in Ecommerce x PrestaShop [ARCHIVE BOARD]
Does someone had success in editing the images using the webservice? I still trying to do that. I receive 200 response, but the image still the same. -
Per vedere l'errore devi modificare il parametro: define('_PS_MODE_DEV_', false); in define('_PS_MODE_DEV_', true); all'interno del file defines.inc.php
- 11 replies
-
- imagini
- web service
-
(and 2 more)
Tagged with:
-
Il path che indichi è il percorso fisico? /home/..../immagine.jpg oppure www.dominio.com/immagine.jpg ? Io uso il primo formato. Se non risolvi questo problema, temo tu sia già bloccato dall'inizio.
- 11 replies
-
- imagini
- web service
-
(and 2 more)
Tagged with:
-
Sicuro che il path sia corretto? Io posso solo dirti che così mi funziona...
- 11 replies
-
- imagini
- web service
-
(and 2 more)
Tagged with:
-
Io sono riuscito alla fine ad aggiornare le immagini con questo codice: $url = PS_SHOP_PATH. 'api/images/products/'.$prod_id.'/'.$img_id.'?ps_method=PUT'; $cfile = curl_file_create($img_url,'image/jpg'); $data = array('image' => $cfile); $ch = curl_init(); $headers = array("Content-Type:multipart/form-data"); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); curl_setopt($ch, CURLOPT_USERPWD, PS_WS_AUTH_KEY.':'); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_exec($ch); curl_close($ch); Ovviamente le variabili vanno opportunamente modificate.
- 11 replies
-
- 1
-
- imagini
- web service
-
(and 2 more)
Tagged with:
-
Penso tu abbia sbagliato forum. Qui non si sta parlando dell'utility imapsync per la migrazione di caselle, ma di una funzione di prestashop. Comunque il tuo problema è legato a qualche dipendenza che manca per far funzionare correttamente il programma...
-
Add product image via webservice
AlbertoV replied to eggandspam's topic in Ecommerce x PrestaShop [ARCHIVE BOARD]
In php>5.5 you have to use curl_file_create instead of this: curl_setopt($ch, CURLOPT_POSTFIELDS, array('image'=>"@".$img_path.";type=image/jpeg")); I've tried this: $cfile = curl_file_create($img_url,'image/jpg','image'); curl_setopt($ch, CURLOPT_POSTFIELDS, $cfile); but the response return me the error "Unable to save this image". Do you have an idea of how could I solve the problem? -
Avevi per caso risolto? Mi sto imbattendo nello stesso identico problema...
- 11 replies
-
- imagini
- web service
-
(and 2 more)
Tagged with:
-
[SOLVED]Can't add product to empty category using webservice
AlbertoV replied to tmackay's topic in Core developers
Hello, my problem is that I set di_category_default but the product isn't listed in that, none in the backend none in the fronted (the products is not visible). How do you set the category of each product? How do you set multiple categories? I have the same problem with the supplier field. Edit: I found how to associate categories to product but I still have to found how to associate with supplier $resources->associations->categories->category->id = category_id; -
Ciao Angela, non mi ci sono più dedicato poiché non era un problema critico. Spero tu abbia più fortuna di me.
-
Add new Product with WebService [400 Bad Request]
AlbertoV replied to ale93p's topic in Core developers
unset these variables: unset($resources->position_in_category); unset($resources->manufacturer_name); unset($resources->id_default_combination); unset($resources->quantity); -
I've fixed the problem today updating the zopim free module...
-
No... I didn't solved the problem. The only thing I notices is that when I try to install some new modules (released by prestashop), I'm getting the message: "this module is not available for your country". I really don't know what to try to find the problem...