avatarusswtor Posted November 7, 2015 Share Posted November 7, 2015 Witam Mam problem z webservices., tworze sobie zamówienie (Order) a do niego oczywiście Adres, klienta i koszyk. Wszystko ładnie się tworzy, ale coś dziwnego dzieje się z parametrem id_carrier w Order. Nieważne co tam ustawie, to zawsze zamówienie jest tworzone z opcją domyślnego przewoźnika (w moim wypadku Odbiór osobisty) Nie wiem jak to obejść. Wklejam kod odpowiedzialny za tworzenie zamówienia $webService = new PrestaShopWebservice(PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG); $xml = $webService->get(array('url' => PS_SHOP_PATH .'api/orders/?schema=synopsis')); $xml->order->id_address_delivery = $id_adresu; $xml->order->id_address_invoice = $id_adresu; $xml->order->id_cart = $id_koszyka; $xml->order->id_currency = 1; $xml->order->id_lang = 1; $xml->order->id_customer = $id_klienta; $xml->order->id_carrier = 25; //$xml->order->current_state = $current_state; //$xml->order->order_states = $current_state; $xml->order->module = $module; $xml->order->valid = 0; //$xml->order->id_shop_group = 1; //$xml->order->id_shop = 1; $xml->order->payment = $payment; $xml->order->total_discounts = 0; $xml->order->total_discounts_tax_incl = 0; $xml->order->total_discounts_tax_excl = 0; $xml->order->total_paid = $total_paid; $xml->order->total_paid_tax_incl = $total_paid_tax_incl; $xml->order->total_paid_tax_excl = 0; $xml->order->total_paid_real = $total_paid_real; $xml->order->total_products = $total_products; $xml->order->total_products_wt = $total_products_wt; $xml->order->total_shipping = $total_shipping; $xml->order->total_shipping_tax_incl = $total_shipping_tax_incl; $xml->order->total_shipping_tax_excl = 0; $xml->order->conversion_rate = 1; $opt = array('resource' => 'orders'); $opt['postXml'] = $xml->asXML(); $xml = $webService->add($opt); a to zrzut ekranu z listą przewoźników i ich IDami będę wdzięczny za pomoc. Link to comment Share on other sites More sharing options...
0 f31n Posted March 17, 2017 Share Posted March 17, 2017 I've got the same issue - did you found a solution for that? Link to comment Share on other sites More sharing options...
0 f31n Posted March 17, 2017 Share Posted March 17, 2017 (edited) i found the bug marked here: http://forge.prestashop.com/browse/PSCSX-8448 and a workaround here: http://stackoverflow.com/questions/38982393/place-complete-order-in-prestashop-using-webservice Edited March 17, 2017 by f31n (see edit history) Link to comment Share on other sites More sharing options...
Question
avatarusswtor
Witam
Mam problem z webservices., tworze sobie zamówienie (Order) a do niego oczywiście Adres, klienta i koszyk.
Wszystko ładnie się tworzy, ale coś dziwnego dzieje się z parametrem id_carrier w Order.
Nieważne co tam ustawie, to zawsze zamówienie jest tworzone z opcją domyślnego przewoźnika (w moim wypadku Odbiór osobisty)
Nie wiem jak to obejść.
Wklejam kod odpowiedzialny za tworzenie zamówienia
a to zrzut ekranu z listą przewoźników i ich IDami
będę wdzięczny za pomoc.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now