kernc Posted October 16, 2009 Share Posted October 16, 2009 As everybody knows, there is a bug somewhere in payment modules that prevents new orders from being shown in Back Office.[1, 2, 3, 4, 5, 6, 7, bug ... All unsolved! ]Specifically, I'm using Cash on Delivery (COD) payment module. Customer's order history is populated with the new order, however, PDF invoice is not available for download. Also, the quantity of the bought product does not decrease.But most importantly, there are no new orders in Back Office > Orders tab.Using PrestaShop1.2.4 on Ubuntu with PHP 5.2.6 and MySQL 5.0.75, with various preinstalled modules disabled.I have traced the error to /modules/cashondelivery/validation.php, where starting on line 9 /* Validate order */ if ($confirm) { $customer = new Customer(intval($cart->id_customer)); $cashOnDelivery = new CashOnDelivery(); $total = $cart->getOrderTotal(true, 3); $cashOnDelivery->validateOrder(intval($cart->id), _PS_OS_PREPARATION_, $total, $cashOnDelivery->displayName); $order = new Order(intval($cashOnDelivery->currentOrder)); Tools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?key='.$customer->secure_key.'&id;_cart='.intval($cart->id).'&id;_module='.intval($cashOnDelivery->id).'&id;_order='.intval($cashOnDelivery->currentOrder)); } the final Tools::redirectLink($url) function doesn't appear to be called (or is preceded by another redirect), because when I post the final step "I confirm my order", the 302 redirect Location header says "Location: ../", instead of "Location: /order-confirmation.php?key=....", as it was supposed to (?) (it says "../" once again for /modules/index.php, which gets me Home, but this is irrelevant).My point is that if in above source I move the Tools::redirectLink($url) up three lines, just below "$cashOnDelivery = new CashOnDelivery();", then the correct Location header is set and customer redirected to his order history. Orders then still don't show in BackOffice, but it is enough to know that somewhere between the$total = $cart->getOrderTotal(true, 3);andTools::redirectLink(__PS_BASE_URI__. ...);the script does something invalid, or so I suppose.May this be of help to you while eagerly debugging!Thanks! :cheese: Link to comment Share on other sites More sharing options...
ruilong Posted October 16, 2009 Share Posted October 16, 2009 hmm I remember that some other user had the ../ problem also, I think that was solved by him editing the settings.inc.php PS_BASE_URI value. Link to comment Share on other sites More sharing options...
kernc Posted October 16, 2009 Author Share Posted October 16, 2009 My __PS_BASE_URI__ is defined as '/', which seems alright.From that, one can also assume that the redirection function, as it is called, doesn't start its argument with __PS_BASE_URI__ (because then the erroneous Location would start with a forward slash, which does not). Link to comment Share on other sites More sharing options...
kernc Posted October 17, 2009 Author Share Posted October 17, 2009 Ok, I have now tested two nearly unmodified 1.2.4final installs, first one with modules and prepopulated products, and another completely blank.On both I enabled COD, on the blank one, I also enabled and randomly configured: Bank Wire, Mail alerts, Cart block, Categories block, Sales and orders.On both installs, the first order works, completes with "we will tend to this order shortly, if Qs, contact support". It also provides PDF invoice to be downloaded, and the order is visible in BO:Orders tab. All subsequent orders, even from another customer, fail miserably (as explained above), and no invoice printed or order visible in BO.Reproducible always. Why is this? Link to comment Share on other sites More sharing options...
KIH999 Posted October 17, 2009 Share Posted October 17, 2009 The "problem" seems to be that there is "no status" there.. Link to comment Share on other sites More sharing options...
kernc Posted October 17, 2009 Author Share Posted October 17, 2009 I have installed again on another host, this time Linux, PHP5.2.10, MySQL5.0.51a.Some orders work as evident from the enclosed pictures, sometimes yes and sometimes no. All payment modules are configured and enabled for test customer's country.In back office, all orders are shown, even invalid ones without invoices.The ps_orders table looks like this: INSERT INTO `ps_orders` (`id_order`, `id_carrier`, `id_lang`, `id_customer`, `id_cart`, `id_currency`, `id_address_delivery`, `id_address_invoice`, `secure_key`, `payment`, `module`, `recyclable`, `gift`, `gift_message`, `shipping_number`, `total_discounts`, `total_paid`, `total_paid_real`, `total_products`, `total_shipping`, `total_wrapping`, `invoice_number`, `delivery_number`, `invoice_date`, `delivery_date`, `valid`, `date_add`, `date_upd`) VALUES ( 1, 2, 2, 1, 1, 1, 2, 2, '47ce86627c1f3c792a80773c5d2deaf8', 'Chèque', 'cheque', 1, 0, '', '', '0.00', '625.98', '625.98', '516.72', '7.98', '0.00', 1, 0, '2008-09-10 15:30:44', '0000-00-00 00:00:00', 0, '2009-10-17 10:59:57', '2009-10-17 10:59:57'), ( 2, 2, 1, 2, 2, 1, 3, 3, 'e51a27df59daa6028d1646102249de20', 'Cash on delivery (COD)', 'cashondelivery', 1, 0, '', '', '0.00', '37.93', '37.93', '25.04', '7.98', '0.00', 2, 1, '2009-10-17 13:07:05', '2009-10-17 13:07:05', 1, '2009-10-17 13:07:05', '2009-10-17 13:07:05'), ( 3, 2, 1, 2, 3, 1, 3, 3, 'e51a27df59daa6028d1646102249de20', 'Bank Wire', 'bankwire', 1, 0, '', '', '0.00', '149.53', '149.53', '118.35', '7.98', '0.00', 0, 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, '2009-10-17 13:08:35', '2009-10-17 13:40:06'), ( 4, 2, 1, 2, 4, 1, 3, 3, 'e51a27df59daa6028d1646102249de20', 'Cash on delivery (COD)', 'cashondelivery', 1, 0, '', '', '0.00', '86.98', '86.98', '66.05', '7.98', '0.00', 3, 2, '2009-10-17 13:26:14', '2009-10-17 13:26:14', 1, '2009-10-17 13:26:14', '2009-10-17 13:26:14'), ( 5, 2, 1, 2, 5, 1, 3, 3, 'e51a27df59daa6028d1646102249de20', 'Cash on delivery (COD)', 'cashondelivery', 1, 0, '', '', '0.00', '156.98', '156.98', '124.58', '7.98', '0.00', 4, 3, '2009-10-17 13:27:19', '2009-10-17 13:27:19', 1, '2009-10-17 13:27:19', '2009-10-17 13:27:19'), ( 6, 2, 1, 2, 6, 1, 3, 3, 'e51a27df59daa6028d1646102249de20', 'Cheque', 'cheque', 1, 0, '', '', '0.00', '86.98', '86.98', '66.05', '7.98', '0.00', 0, 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, '2009-10-17 13:31:48', '2009-10-17 13:31:48'), ( 7, 2, 1, 2, 7, 1, 3, 3, 'e51a27df59daa6028d1646102249de20', 'Cheque', 'cheque', 1, 0, '', '', '0.00', '1799.00', '1799.00', '1504.18', '0.00', '0.00', 0, 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, '2009-10-17 13:41:05', '2009-10-17 13:41:05'), ( 8, 2, 1, 2, 8, 1, 3, 3, 'e51a27df59daa6028d1646102249de20', 'Cash on delivery (COD)', 'cashondelivery', 1, 0, '', '', '0.00', '1400.00', '1400.00', '1170.57', '0.00', '0.00', 5, 4, '2009-10-17 13:42:12', '2009-10-17 13:42:12', 1, '2009-10-17 13:42:12', '2009-10-17 13:42:12'); What catches attention is the valid bit, which is set to 0 for (check and wire) orders without invoices.I suspect whatever is loose, it is in the validateOrder() PaymentModule member function.Having suffered these (and various other reported) inexplicable inconsistencies, I will slowly have to going to start looking for another cart software. :blank: :long: Link to comment Share on other sites More sharing options...
KIH999 Posted October 17, 2009 Share Posted October 17, 2009 When you change status in back office (orders) when you get the money from check and Bank W., you will see it works..As you see, all "pending" payments have no invoice... COD is different, no risk to send/deliver you will get paid.On some payment modules you have to do manual operation to generate the invoice..-Seems like it works as intended. Link to comment Share on other sites More sharing options...
sahabat Posted October 21, 2009 Share Posted October 21, 2009 kernc is right, this is serious, many users including me having this problem. Each orders stopped in "I confirmed" page, the step looped to index page. In back office I can't see the order. Having suffered these (and various other reported) inexplicable inconsistencies, I will slowly have to going to start looking for another cart software. :blank: :long: I hope it will be solved in the next version.I said many times in this forum : Prestashop 1.0.8 is always best for me, its higher versions are painful. Link to comment Share on other sites More sharing options...
ruilong Posted October 21, 2009 Share Posted October 21, 2009 What languages are you using? I know that on 1.1 there was a problem with orders not getting created correctly if the product ordered was out of stock and the mail template for mail alerts was missing on the language used in the shop. Link to comment Share on other sites More sharing options...
sahabat Posted October 24, 2009 Share Posted October 24, 2009 Hi Ruilong!I use version 1.2.4, english language with complete mail template.Is there anything else I might miss? Link to comment Share on other sites More sharing options...
summer Posted October 24, 2009 Share Posted October 24, 2009 Sad but true. Mine too. Temporary I'm counting on BO>Customers>Carts which I can not count on. Do I have to move my site to Linux server? It must be another big work Link to comment Share on other sites More sharing options...
Mallee Boy Posted March 2, 2010 Share Posted March 2, 2010 Did anyone solve this? I am wanting to use COD on my existing shop 1.2.5 which has been running fine. However, when i confirm orders i get "no valid order state" appear on screen.Order appears in customer history, but without an order state and there is no evidence of the order in the BO - though it does show up in Database.Has anyone solved this? It looks to me like kernc was on the right track and i would love to solve it. Link to comment Share on other sites More sharing options...
Recommended Posts