Jump to content

hardyahir

Members
  • Posts

    12
  • Joined

  • Last visited

About hardyahir

  • Birthday 07/22/1990

Contact Methods

Profile Information

  • Location
    India
  • First Name
    Hardik
  • Last Name
    Karmur

Recent Profile Visitors

243 profile views

hardyahir's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. hello, thank you for your valuable reply, but i already done all of my web services working which require to run android apps likewise any other eCommerce. Thanks Hardy
  2. hello there, i created web service to signup,login,change password etc and get categories, products, cart all this works fine with latest 1.7.1.1 but m unable to create order so i switched to 1.6.1.13 and test my web services, but any services which use webservice->edit() method are start giving errors here is simple change password of customer web service which stop working now , kindly help me and also explain how to create order and which are required things to pass when creating order , i show my code for both creating order and change password both not working earlier only create order had issue now all the service which use edit() method are stop working Note:- only edit() method services stop working, add(), get() , delete() works fine with both latest 1.6 and 1.7 // Call to retrieve specific customer $xml = $this->webService->get(array('resource' => 'customers','display' => 'full','filter[email]' => '['.$this->input->post("email").']')); // Retriving custom id $id = (int) $xml->customers->customer->id; if ($id > 1) { // Retrieve resource elements in a variable (table) $resource = $xml->children()->children(); $resource->passwd = $this->input->post("password"); $opt_update['resource'] = 'customers'; $opt_update['id'] = (int) $id; $opt_update['putXml'] = $resource->asXML(); $update = $this->webService->edit($opt_update); // here it failed echo (int)$update->customers->customer->id."is updated successfully"; } else { echo "no customer found"; } and here are the error i got on debugger Array ( [status_code] => 400 [response] => <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <errors> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on id_default_group is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): lt_group xlink:href="localhost/prestashop/api/groups/3" (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ^ (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on id_lang is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): _lang xlink:href="localhost/prestashop/api/languages/1" (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ^ (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on group is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): <group xlink:href="localhost/prestashop/api/groups/1"> (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ^ (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[90]]> </code> <message> <![CDATA[id is required when modifying a resource]]> </message> </error> </errors> </prestashop> [header] => HTTP/1.1 400 Bad Request Date: Mon, 29 May 2017 04:19:53 GMT Server: Apache/2.4.17 (Unix) OpenSSL/1.0.1q PHP/5.6.15 mod_perl/2.0.8-dev Perl/v5.16.3 Vary: Authorization X-Powered-By: PrestaShop Webservice Access-Time: 1496031593 PSWS-Version: 1.6.1.13 Execution-Time: 0.006 Set-Cookie: PrestaShop-34fc132eb07fcac1f8df1b6451ffd56c=A2u1uV1bPapPwjDhn52LPDjFsAr0k7nIjkHo%2B6QOM4GHc0J3oiWyg4S7m60ksLakLLcoEGP73qra3m3VcgTKkypn5CuJxJva9X0Ok54yBZA%3D000080; expires=Sun, 18-Jun-2017 04:19:53 GMT; Max-Age=1728000; path=/php_actionware_ecommerce/; httponly Content-Length: 2964 Connection: close Content-Type: text/xml;charset=utf-8 ) <br /> <b>Fatal error</b>: Uncaught exception 'PrestaShopWebserviceException' with message 'This call to PrestaShop Web Services failed and returned an HTTP status of 400. That means: Bad Request.' in /opt/lampp/htdocs/prestashop/web_services/application/third_party/PrestaShopWebservice.php:91 Stack trace: #0 /opt/lampp/htdocs/prestashop/web_services/application/third_party/PrestaShopWebservice.php(364): PrestaShopWebservice->checkStatusCode(400) #1 /opt/lampp/htdocs/prestashop/web_services/application/modules/ws/controllers/ws.php(291): PrestaShopWebservice->edit(Array) #2 [internal function]: Ws->changePassword() #3 /opt/lampp/htdocs/prestashop/web_services/system/core/CodeIgniter.php(359): call_user_func_array(Array, Array) #4 /opt/lampp/htdocs/prestashop/web_services/index.php(202): require_once('/opt/lampp/htdo...') #5 {main} thrown in <b>/opt/lampp/htdocs/prestashop/web_services/application/third_party/PrestaShopWebservice.php</b> on line <b>91</b> <br /> Now here is create order code // Get customer details $customer = $this->webService->get(array('url' => $this->config->item("PS_SHOP_PATH").'api/customers?display=full&filter[id]='.$this->input->post("id_customer"))); $customer = $customer->customers->customer; // Updating cart details first (update address for both delivery and invoice) $res = NULL; if($this->input->post("id_cart") && (int)$customer->id) { // Get cart $cart_opt['resource'] = 'carts'; $cart_opt['display'] = 'full'; if($this->input->post("id_cart")) $cart_opt['filter[id]'] = $this->input->post("id_cart"); if($this->input->post("id_customer")) $cart_opt['filter[id_customer]'] = $this->input->post("id_cart"); if($this->input->post("id_customer") && $this->input->post("id_cart")) $cart_opt['filter[id]'] = $this->input->post("id_cart"); $cart_opt['filter[id_customer]'] = $this->input->post("id_customer"); $get_cart = $this->webService->get($cart_opt); $carts = $get_cart->carts; if (isset($get_cart->carts->cart->id) && (int)$get_cart->carts->cart->id) { // Update the cart details $carts->cart->secure_key = $customer->secure_key; $carts->cart->id_address_delivery = $this->input->post("id_address_delivery"); $carts->cart->id_address_invoice = $this->input->post("id_address_invoice"); $carts->cart->id_customer = $customer->id; $carts->cart->id_carrier = $this->input->post("id_carrier"); // Counting cart rows $row_count = count($get_cart->carts->cart->associations->cart_rows->cart_row); // Cart row data $cart_rows = ($row_count > 0)? (array) $get_cart->carts->cart->associations->cart_rows : ''; $cart_rows = ($row_count > 0)? json_encode($cart_rows['cart_row']) : ''; $cart_rows = ($row_count > 0)? json_decode($cart_rows,TRUE) : ''; //$carts = $carts->carts; $flag = ''; if($row_count > 1){ foreach($cart_rows as $key => $value) { $carts->cart->associations->cart_rows->cart_row[$key]->id_address_delivery = $this->input->post("id_address_delivery"); } } else if($row_count == 1) { $carts->cart->associations->cart_rows->cart_row->id_address_delivery = $this->input->post("id_address_delivery"); } $carts->cart->id_carrier = $this->input->post("id_carrier"); $carts->cart->secure_key = $customer->secure_key; $update_cart_opt['resource'] = 'carts'; $update_cart_opt['id'] = $this->input->post("id_cart"); $update_cart_opt['putXml'] = $carts->asXML(); $update_cart = $this->webService->edit($update_cart_opt); // Details of updated cart $id['cart'] = (int) $update_cart->cart->id; $id['delivery'] = (int) $update_cart->cart->id_address_delivery; $id['carrier'] = (int) $update_cart->cart->id_carrier; $id['customer'] = (int) $update_cart->cart->id_customer; // Switching to main Database mysql_select_db('xxxxxxxxx'); $sql = "UPDATE `ps_cart` SET `delivery_option`='a:1:{i:".$id['delivery'].";s:".$id['customer'].":\"".$id['carrier'].",\";}' WHERE id_cart='" . $id['cart'] . "'"; $res = $this->db->query($sql); }else { $result['status'] = 'error'; $result['msg'] = 'No cart details found for the given id'; } } // if cart data updated then creating order if ($res){ try{ // Get empty schema of order $order_xml = $this->webService->get(array('url' => $this->config->item("PS_SHOP_PATH").'api/orders?schema=blank')); // Generating order data $order_xml->orders->order; $order_xml->order->id_customer = (int)$customer->id; $order_xml->order->id_address_delivery = (int) $id['delivery']; $order_xml->order->id_address_invoice = $this->input->post("id_address_invoice"); $order_xml->order->id_cart = $id["cart"]; $order_xml->order->id_currency = (int)$customer->id_currency; $order_xml->order->id_lang = (int)$customer->id_lang; $order_xml->order->id_shop = (int)$customer->id_shop; $order_xml->order->id_shop_group = (int)$customer->id_shop_group; $order_xml->order->id_carrier = $id["carrier"]; //$order_xml->order->current_state = 3; $order_xml->order->secure_key = $customer->secure_key; $order_xml->order->valid = 0; $order_xml->order->payment = $this->input->post("payment"); $order_xml->order->module = $this->input->post("module"); $order_xml->order->total_paid = (float) $this->input->post("total_paid"); $order_xml->order->total_paid_real = (float) $this->input->post("total_paid"); $order_xml->order->total_products = (float) $this->input->post("total_paid"); $order_xml->order->total_products_wt = (float) $this->input->post("total_paid"); $order_xml->order->total_discounts = (float) 0; $order_xml->order->total_discounts_tax_incl = (float) 0; $order_xml->order->total_discounts_tax_excl = (float) 0; $order_xml->order->total_shipping = (float) 0; $order_xml->order->total_shipping_tax_incl = (float) 0; $order_xml->order->total_shipping_tax_excl = (float) 0; $order_xml->order->conversion_rate = (float) 1; $order_xml->order->associations->order_rows->order_row->product_id = $this->input->post("product_id"); $order_xml->order->associations->order_rows->order_row->product_attribute_id = $this->input->post("product_attribute_id"); $order_xml->order->associations->order_rows->order_row->product_quantity = $this->input->post("product_quantity"); $order_xml->order->associations->order_rows->order_row->product_name = "Amazing Funky Jeans for men"; $order_xml->order->associations->order_rows->order_row->product_price = "494.38"; $order_xml->order->date_add = curdate(); unset($order_xml->children()->children()->id); // Creating order $create_order_opt = array('resource' => 'orders'); $create_order_opt['postXml'] = $order_xml->asXML(); $order_insert = $this->webService->add(array( 'resource' => 'orders?sendmail=1', 'postXml' => $order_xml->asXML() )); print_r($order_insert); exit; // here it failed to create order with latest ps 1.7.x.x // Details of created order $id['order'] = (int) $order_insert->order->id; $id['secure_key'] = $order_insert->order->secure_key; // Create Order History $order_history_xml = $this->webService->get(array('url' => $this->config->item("PS_SHOP_PATH").'api/order_histories?schema=synopsis')); $order_history_xml = $order_history_xml->children()->children(); $order_history_xml->id_order = $id['order']; $order_history_xml->id_order_state = '3'; $order_history_opt = array('resource' => 'order_histories'); $order_history_opt['postXml'] = $order_history_xml->asXML(); $order_history = $this->webService->add($order_history_opt); // Details of created order history $id['order_history'] = (int) $xml->order_history->id; here are the errors i got while creating order and updating carts Array ( [status_code] => 500 [response] => <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <errors> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on id_address_delivery is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ivery xlink:href="localhost/prestashop/api/addresses/4" (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ^ (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on id_address_invoice is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): voice xlink:href="localhost/prestashop/api/addresses/4" (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ^ (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on id_currency is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ency xlink:href="localhost/prestashop/api/currencies/1" (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ^ (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on id_customer is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): tomer xlink:href="localhost/prestashop/api/customers/1" (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ^ (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on id_guest is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): id_guest xlink:href="localhost/prestashop/api/guests/1" (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ^ (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on id_lang is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): _lang xlink:href="localhost/prestashop/api/languages/1" (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ^ (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on id_product is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): roduct xlink:href="localhost/prestashop/api/products/2" (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ^ (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on id_product_attribute is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): e xlink:href="localhost/prestashop/api/combinations/10" (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ^ (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on id_address_delivery is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ivery xlink:href="localhost/prestashop/api/addresses/3" (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ^ (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on id_product is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): roduct xlink:href="localhost/prestashop/api/products/3" (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ^ (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on id_product_attribute is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): e xlink:href="localhost/prestashop/api/combinations/13" (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ^ (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on id_address_delivery is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ivery xlink:href="localhost/prestashop/api/addresses/3" (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> <error> <code> <![CDATA[3]]> </code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): ^ (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> </errors> </prestashop> any help is really appreciate please team prestashop guide me
  3. i created web service for my mobile app with latest prestashop 1.7.1.1 each and every works fine except create order one, now i switched to prestashop 1.6.1.13 to check if creating order is working with this version , but each web service request which use edit() method give me error , while they all works fine with latest 1.7.1.1 version . here is my customer password update request which give me this types error now // Filtering customer by email $xml = $this->webService->get(array('resource' => 'customers','display' => 'full','filter[email]' => '['.$this->input->post("email").']')); // Retriving customer id $id = (int) $xml->customers->customer->id; // Retrieve resource elements $resource = $xml->customers; $resource->customer->passwd = $this->input->post("password"); $opt_update['resource'] = 'customers'; $opt_update['id'] = $id; $opt_update['putXml'] = $resource->asXML(); $update = $this->webService->edit($opt_update); **Note :-** **This request works very fine with prestashop 1.7.1.1 for changing customer password. but not working with Prestashop 1.6.1.13 ** please help me solve this issue. here is error code and details i face : **Error :-** Fatal error: Uncaught exception 'PrestaShopWebserviceException' with message 'This call to PrestaShop Web Services failed and returned an HTTP status of 500. That means: Internal Server Error.' **Debug Result:-** RETURN HTTP BODY <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <errors> <error> <code><![CDATA[3]]></code> <message> <![CDATA[[PHP Warning #2] SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on id_default_group is not defined (/opt/lampp/htdocs/prestashop/classes/webservice/WebserviceRequest.php, line 1374)]]> </message> </error> </errors> </prestashop>
  4. hey i dint find what is this ? (a:1:{i:6;s:2:"1,";} ) but i know what is secure_key The SECURE_KEY is the secure_key field value of the customer both in cart and in order you have to fill this field using customer secure_key field. so get your customer data using customer id or email then store it in variable and then fill it while creating cart and order . Regard, Hardik
  5. is this working? its not working for me
  6. hey sorry for late reply but it might help others once you got id_image you can generate image url this way foreach ($combinations as $key => $val ) { $images[] = $link->getImageLink($product_array['link_rewrite'], [id_image] => 58 , 'large_default'); } /* this will generate array of URL for each id_image getImageLink() arguments are as explain below : first argument is 'link_rewrite' field from product_lang table for the given id_product, second argument is id_image so here as per above foreach its $val['id_image'], third argument is default image type you want to get from directory. usually large-default/medium-default used */ i hope this will solve you issue
  7. m on latest 7.1.1.1 of prestashop i want to configure some of my installed module but m unable to access the installed module it show me this error Whoops, looks like something went wrong. 2/2ConnectException in RequestException.php line 49:cURL error 6: name lookup timed out in RequestException.php line 49 at RequestException::wrapException(object(Request), object(ConnectException)) in RequestFsm.php line 104 at RequestFsm->__invoke(object(Transaction)) in RequestFsm.php line 132 at RequestFsm->GuzzleHttp\{closure}(array('transfer_stats' => array('url' => 'https://api-addons.prestashop.com/?format=json&iso_lang=en&iso_code=IN&version=1.7.1.1&method=listing&action=categories' 'content_type' => null, 'http_code' => '0', 'header_size' => '0', 'request_size' => '0', 'filetime' => '-1', 'ssl_verify_result' => '0', 'redirect_count' => '0', 'total_time' => '0', 'namelookup_time' => '0', 'connect_time' => '0', 'pretransfer_time' => '0', 'size_upload' => '0', 'size_download' => '0', 'speed_download' => '0', 'speed_upload' => '0', 'download_content_length' => '-1', 'upload_content_length' => '-1', 'starttransfer_time' => '0', 'redirect_time' => '0', 'redirect_url' => '', 'primary_ip' => '', 'certinfo' => array(), 'primary_port' => '0', 'local_ip' => '', 'local_port' => '0', 'error' => 'name lookup timed out', 'errno' => '6'), 'curl' => array('error' => 'name lookup timed out', 'errno' => '6'), 'effective_url' => 'https://api-addons.prestashop.com/?format=json&iso_lang=en&iso_code=IN&version=1.7.1.1&method=listing&action=categories' 'status' => null, 'reason' => null, 'body' => null, 'headers' => array(), 'error' => object(ConnectException))) in FulfilledPromise.php line 25 at FulfilledPromise->then(object(Closure), null, null) in CompletedFutureValue.php line 55 at CompletedFutureValue->then(object(Closure), null, null) in FutureResponse.php line 43 at FutureResponse::proxy(object(CompletedFutureArray), object(Closure)) in RequestFsm.php line 135 at RequestFsm->__invoke(object(Transaction)) in Client.php line 165 at Client->send(object(Request)) in Client.php line 125 at Client->get(null, array('query' => array('format' => 'json', 'iso_lang' => 'en', 'iso_code' => 'IN', 'version' => '1.7.1.1', 'method' => 'listing', 'action' => 'categories'))) in ApiClient.php line 170 at ApiClient->getResponse() in ApiClient.php line 124 at ApiClient->getCategories() in CategoriesProvider.php line 48 at CategoriesProvider->getCategories() in CategoriesProvider.php line 108 at CategoriesProvider->getParentCategory('') in AdminModuleDataProvider.php line 188 at AdminModuleDataProvider->generateAddonsUrls(array(object(Module), object(Module), object(Module), object(Module), object(Module),object(Module), object(Module), object(Module), object(Module), object(Module), object(Module), object(Module), object(Module),object(Module), object(Module), object(Module), object(Module), object(Module), object(Module))) in ModuleController.php line 235 at ModuleController->manageAction() at call_user_func_array(array(object(ModuleController), 'manageAction'), array()) in bootstrap.php.cache line 3247 at HttpKernel->handleRaw(object(Request), '1') in bootstrap.php.cache line 3206 at HttpKernel->handle(object(Request), '1', false) in bootstrap.php.cache line 3360 at ContainerAwareHttpKernel->handle(object(Request), '1', false) in bootstrap.php.cache line 2562 at Kernel->handle(object(Request), '1', false) in index.php line 86 please help.
  8. if you looking for controller (for customer) then here it is where default schema for fields define for Prestashop V 1.7.1.0 Prestashop/Classes/FormFiled.php i don't know the exact path of template but it might be this one Prestashop/admin/themes/(your theme)/template/controllers/customer/helpers/view/view.tpl if the above one is not what you looking for then check the main Template directory under your THEME folder which have all the templates as .tpl hope it will help you
  9. here you go this will 100% solve the issue of mine with latest Prestashop 1.7.1.0 https://www.prestashop.com/forums/topic/564209-modules-and-services-are-inaccessible/?do=findComment&comment=2431747 give it a try Regard, Hardik
  10. this will 100% solve the issue of mine with latest Prestashop 1.7.1.0 https://www.prestashop.com/forums/topic/564209-modules-and-services-are-inaccessible/?do=findComment&comment=2431747 give it a try Regard, Hardik
  11. this will 100% solve the issue of mine with latest Prestashop 1.7.1.0 https://www.prestashop.com/forums/topic/564209-modules-and-services-are-inaccessible/?do=findComment&comment=2431747 give it a try Regard, Hardik
  12. i read the official documentation parts this http://doc.prestashop.com/display/PS14/Chapter+8+-+Advanced+Use and trying to get the employees using filter here is my code $opt = array( 'resource' =>'employees', 'display' =>'[full]', 'filter' =>['[email protected]'], 'filter[password]' =>['xxxxxxxxxxxxxxxx'] ); $data = $webService->get($opt); it generate url like this myhop_url/api/employees?filter%5Bemail%5D=demo%40demo.com&filter%5Bpassword%5D=xxxxxxxxxxxxxxxx&display=%5Bfull%5D but it should be like this as shown in official documents myhop_url/api/employees?filter=['[email protected]]&filter['password']=['xxxxxxxxxxxxxxxx']&display=['full'] what is the problem i didn't get it? please help me to solve this bug. Thanks i advance. Update :- got a way to solve this decoding issue here is my code $url = $this->url.'/api/'.$options['resource']; $url_params = array(); if (isset($options['id'])) { $url .= '/'.$options['id']; } $params = array('display', 'filter', 'sort', 'limit', 'id_shop', 'id_group_shop'); foreach ($params as $p) { foreach ($options as $k => $o) { if (strpos($k, $p) !== false) { $url_params[$k] = $options[$k]; } } } if (count($url_params) > 0) $url .= '/?'.utf8_decode(urldecode(http_build_query($url_params) ) ); but still no data found when the url is called.
  13. i search for the web service in forums got many things , many can use custom curl methods and many use prestashop official library. my point is which is recommended by Prestashop team ? m using latest 1.7.1.0 stable version , my shop already setup in local server . moving forward for web service once done i want to launch it. please reply fast as possible. Thanks in advance.
×
×
  • Create New...