-
Posts
66 -
Joined
-
Last visited
Profile Information
-
Location
italy
-
Activity
Web development agency
Recent Profile Visitors
743 profile views
massimopasquali's Achievements
-
Hello, I have the same problem with Prestashop 1.7.8.6 and lasta Sumup module. I put url redirect to home page. How have you checked if your Sumup profile is active? I have done a product for testing Sumup payment, but when I checked the checkbox for accept the condition, the module show me "Response error: request_not_allowed" and if I try to payment, Prestashop open the payment form, but it is closed immidiatly. Can you suggest me some tips? tnx in advace
-
Hello, my necessity is to searching an image using the webservice and searching image products looking for troughing id_product. can you suggest me how to do that? tnx
-
[SOLVED] byte[] ImageData; string filedto = FotoDto.UrlFolder; //FotoDto.Id_Product ResponseWebService = new ResponseWebServiceDto(); string webAddress = FotoDto.UrlPrestashop.Replace("languages", "images/products") + FotoDto.Id_Product + "?ws_key=" + key; ImageData = File.ReadAllBytes(filedto); using (var client = new HttpClient()) { var requestContent = new MultipartFormDataContent(); var imageContent = new ByteArrayContent(ImageData); imageContent.Headers.ContentType = MediaTypeHeaderValue.Parse("image/jpeg"); requestContent.Add(imageContent, "image", FotoDto.Name + ".jpg"); var response = client.PostAsync(new Uri(webAddress), requestContent).Result; ResponseWebService.HttpStatus = response.StatusCode; ResponseWebService.Xml = response.ReasonPhrase; } return ResponseWebService;
-
if i try to sending the request by postman <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <errors> <error> <code> <![CDATA[76]]> </code> <message> <![CDATA[Please set an "image" parameter with image data for value]]> </message> </error> </errors> </prestashop>
-
Hello, someone have developed a class for uploading product's photo in c# calling the webservice? My c# code string filedto = FotoDto.UrlFolder; string webAddress = FotoDto.UrlPrestashop.Replace("languages", "images/products") + FotoDto.Id_Product; var credentials = new NetworkCredential(key, ""); var handler = new HttpClientHandler { Credentials = credentials }; var client = new HttpClient(handler); var pairs = new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("image", filedto) }; var content = new FormUrlEncodedContent(pairs); content.Headers.ContentType.MediaType = @"multipart/form-data"; var response = client.PostAsync(webAddress, content).Result; ResponseWebService.HttpStatus = response.StatusCode; ResponseWebService.Xml = response.ReasonPhrase; return ResponseWebService; But prestashop give me an error "bad request". tnx
-
Hello, I have Created a new webservice resource, but I can't understood how to implement the request "schema=blank". I need to have CRUD operations e SCHEMA, the same functionality about at standard Prestashop's Webservice. tnx in advance
-
Hello, I'm trying to import a new image using webservice. The problem is that the webservice fails to create the folder and image of the cover but succes to create the folder and file about second image. I'm using the same code that we found at thi url https://devdocs.prestashop.com/1.7/webservice/tutorials/advanced-use/image-management/#using-an-html-form this is my code. can you suggest me ? Tnx in advance. // invio il link alla webservice $urlImage = "https://********/api/images/products/" . $id_product . "/"; $key = '*******************************************'; //Here you set the path to the image you need to upload $image_path = $PHOTO_LINK; $image_mime = 'image/jpg'; $name_image = basename($PHOTO_LINK); // folder on the app's server $image_path = $_SERVER["HOME"]."/web/********/api/object/img_tmp/" . $name_image; // copy image to server directory from remote if(copy($PHOTO_LINK, $image_path) == true){ $args['image'] = new CurlFile($image_path, $image_mime); $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLINFO_HEADER_OUT, 1); curl_setopt($ch, CURLOPT_URL, $urlImage); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_USERPWD, $key.':'); curl_setopt($ch, CURLOPT_POSTFIELDS, $args); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data_exec = curl_exec($ch); //$errno = (curl_errno($ch)); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); switch ($httpCode) { case 200: echo($response); default: throw new \Exception($response, $info['http_code']); } curl_close($ch); if (file_exists($image_path)) { //unlink($image_path); } }
-
Customer Address Save Action Hook
massimopasquali replied to Nishith Nesdiya's topic in Addons, modules and themes developers
solved, thanks. my hook was registered in my module, I don't know why the istruction into the install didn't work. In my override "AdminAddressController" into "ProcessSave" method at the end, before the istruction "return" I have putted $error = Hook::registerHook($this,"actionAdminAddressesControllerSaveAfter"); $resulttt = Hook::exec("actionAdminAddressesControllerSaveAfter",["panthera_id" => "10001"]); into the class "Hook" you can find alla methods to find all hook/module registered [SOLVED] -
Customer Address Save Action Hook
massimopasquali replied to Nishith Nesdiya's topic in Addons, modules and themes developers
Hi, for my first question I have registered the in the instal like that: public function install() { //hookActionCustomerGridDefinitionModifier return parent::install() && $this->registerHook('actionSendToPanthera') && $this->registerHook('actionObjectCustomerAddressUpdateAfter') && $this->registerHook('actionAddressGridDefinitionModifier') && $this->registerHook('actionCustomerGridDefinitionModifier') && $this->registerHook('actionCustomerGridQueryBuilderModifier') && $this->registerHook('actionCustomerFormBuilderModifier') && $this->registerHook('actionAfterCreateCustomerFormHandler') && $this->registerHook('actionAfterUpdateCustomerFormHandler') && $this->registerHook('actionAdminCustomersControllerSaveAfter'); // && //$this->installTables(); } and implement the test function public function hookActionObjectCustomerAddressUpdateAfter($parameters) { // This is where you can modify/alter the behavior of PrestaShop. // The content of $parameters will depend on what is sent when the hook is dispatched. $error = "hello world !!!"; } 2) I have called the hook in address funnction "PostProcess" at the end of the function, like that: public function processSave() { [ Hook::exec('actionObjectCustomerAddressUpdateAfter'); return $return; } I'm doing the same think, I'm doing a connecto between ERP Panthera and Prestashop, so when some one change the data Prestashop should call an hook that has the deal to call the ERP e send it the record modifiedhook that has the deal to call ERP e send it the record modified. The problem is that the doen't work. 3) I have to customize the grid and form and for the customer it was been easy using the hook: ) && $this->registerHook('actionAddressGridDefinitionModifier') && $this->registerHook('actionCustomerGridDefinitionModifier') && $this->registerHook('actionCustomerGridQueryBuilderModifier') && $this->registerHook('actionCustomerFormBuilderModifier') && $this->registerHook('actionAfterCreateCustomerFormHandler') && $this->registerHook('actionAfterUpdateCustomerFormHandler') && $this->registerHook('actionAdminCustomersControllerSaveAfter'); // && but when I try to use my customize hook or the hook how you wrote "$this->registerHook('actionObjectCustomerAddressUpdateAfter') &&" nothing happened can you pass me an example? tnx -
Customer Address Save Action Hook
massimopasquali replied to Nishith Nesdiya's topic in Addons, modules and themes developers
Hi Kbasotti, I have to do the same thing in prestashop 1.7.6. I want call an "actionObjectCustomerAddressUpdateAfter" after that address has been modified, so I have these question: 1) I registered the "actionObjectCustomerAddressUpdateAfter" in Install method module: " $this->registerHook('actionObjectCustomerAddressUpdateAfter') " 2) Where you call to the "actionObjectCustomerAddressUpdateAfter" in " public function processSave()" of override of "AdminAddressController"? 3) Have you customize de Address form in prestashop 1.7 without used "ovirrede", but used the hook like "actionCustomerFormBuilderModifier" and "actionCustomerGridDefinitionModifier" how we can do with the customer form? tnx -
Hello, I have to customize a backoffice of version 1.7.6. in a new Module. I haven't have problem to customize the "Customer" form using "hookActionCustomerGridDefinitionModifier", but now I have to customize "Address", "Produt" and "Cart". I have found this sample in official documentation "https://devdocs.prestashop.com/1.7/development/components/grid/tutorials/modify-grid-in-module/", but is not clear becouse it's not explain how to implement the config of route.yml and service.yml. have you an example about how to implent an exist grid like "Address" when you use an hookAction<form>GridDefinitionModifier? tnx in advance
-
Hello, is possible to intercetp this method "processFilter" in "adminController" extended from "adminAddressController", using an "Hook"? In particular becouse doesn't exist "hookActionAddressrGridDefinitionModifier" how can change the "renderList", "processFilter" ? tnx in advance
-
Hello, I did a module with Prestashop 1.7.6, for implement a Customer grid. So i have to remove "delete" option in "BulkAction" menu and also remove an option in "gridAction". I have found this sample https://devdocs.prestashop.com/1.7/development/components/grid/tutorials/work-with-bulk-actions/ I did but it's nothing appened. can you suggest me some solutions? tnx
-
massimopasquali started following doekia