Jump to content

[Solved] Why I get 'We noticed a problem with your order...' after confirming order?


salko

Recommended Posts

I have copied payment module 'cheque' to 'paywithcash' module, replacing every names including the one in files. Everything is nearly ok, I still have one annoying issue: after order is confirmed using this 'paywithcash' payment option, 'paywithcash' mail is sent to the customer and order status is changed to 'Waiting for collection', which is generally ok, but I wanted order status to be 'In preparation' first and then I will manually change it to 'Waiting for collection'. So I have changed _PS_OS_PAYWITHCASH_ (new order state which I have created) to _PS_OS_PREPARATION_ in /modules/paywithcash/validate.php, but now when customer confirms order he get "We noticed a problem with your order. If you think this is an error, you can contact our customer support." page. I can see the order was placed anyway and it has 'In preparation' status, which is ok. So only thing annoys me now is this "We noticed a problem with your order..." page, which will clearly confuse customers not knowing if order is placed or not ... So why I get this page and how can I fix this?? Is there anything else beside '_PS_OS_PAYWITHCASH_ >> _PS_OS_PREPARATION_' I must change to replace automatic order status after order is confirmed? Thanks for any tips!

Link to comment
Share on other sites

I guess there is some wrong with your code in your module file.
Please check the hookPaymentReturn() function in your paywithcash.php file.

you need to change some code at line

       if ($state == _PS_OS_CHEQUE_ OR $state == _PS_OS_OUTOFSTOCK_)




below is sample from cheque module,

    public function hookPaymentReturn($params)
   {
       if (!$this->active)
           return ;

       global $smarty;
       $state = $params['objOrder']->getCurrentState();
       if ($state == _PS_OS_CHEQUE_ OR $state == _PS_OS_OUTOFSTOCK_)
           $smarty->assign(array(
               'total_to_pay' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false, false),
               'chequeName' => $this->chequeName,
               'chequeAddress' => nl2br2($this->address),
               'status' => 'ok',
               'id_order' => $params['objOrder']->id
           ));
       else
           $smarty->assign('status', 'failed');
       return $this->display(__FILE__, 'payment_return.tpl');
   }

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...