Jump to content

how make order with state "Awaiting payment" ?


icreator

Recommended Posts

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 by icreator (see edit history)
Link to comment
Share on other sites

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...