icreator Posted February 7, 2015 Share Posted February 7, 2015 (edited) in ver 1.5 how make order with state "Awaiting payment" ? If I call validateOrder with amount_paid = 0 $amount_paid = 0; $dont_touch_amount = TRUE; $id_order_state = Configuration::get('PS_OS_MY_STATE'); $this->module->validateOrder($cart->id, $id_order_state, $amount_paid, $this->module->name, $message, $mailVars, (int)$currency->id, $dont_touch_amount, $customer->secure_key ); then getCurrentState() => ERROR PAYMENT why? I want make simple order with state "awaiting..." Edited February 7, 2015 by icreator (see edit history) Link to comment Share on other sites More sharing options...
las3r Posted February 7, 2015 Share Posted February 7, 2015 What version of prestashop is this? In this code sample you are getting PS_OS_MY_STATE from the DB. Does this state match "awaiting payment"? If no, try and get the right id to work with. This code, in theory, should work if the right orderstate is provided. Link to comment Share on other sites More sharing options...
icreator Posted February 7, 2015 Author Share Posted February 7, 2015 what order->value I need test for get a total price of order for make a payment for it order? total_products or total_products_wt or any else? Link to comment Share on other sites More sharing options...
las3r Posted February 7, 2015 Share Posted February 7, 2015 Depends on your use case. _wt = with tax, I'd choose for the last one - total_products_wt Link to comment Share on other sites More sharing options...
icreator Posted February 7, 2015 Author Share Posted February 7, 2015 I use 1.5 ver why "total_paid" equal price of order??? in order details I see that total of order = if I set total_paid = 0 why?? Link to comment Share on other sites More sharing options...
icreator Posted February 7, 2015 Author Share Posted February 7, 2015 What version of prestashop is this? In this code sample you are getting PS_OS_MY_STATE from the DB. Does this state match "awaiting payment"? If no, try and get the right id to work with. This code, in theory, should work if the right orderstate is provided. it mean -> order is paid - because: total_paid = total_products why? Link to comment Share on other sites More sharing options...
icreator Posted February 7, 2015 Author Share Posted February 7, 2015 REFERENCE PRODUCT QUANTITY UNIT PRICE TOTAL PRICE Total products (tax excl.) $0.10 Total products (tax incl.): $0.10 Total shipping (tax incl.): $0.00 Total $0.00 If I set total_paid = 0 Link to comment Share on other sites More sharing options...
las3r Posted February 7, 2015 Share Posted February 7, 2015 Hm that's strange. I think your calculations are going wrong somewhere. Is thisa a custom payment module? Maybe the variables {order} is not loaded in smarty -> This will make it turn to 0 (I think), which is default for a formatted number. In your template, add {$order|var_dump} -> this should output the value of the order object in smarty templating - this shoudl give you more info. Link to comment Share on other sites More sharing options...
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