Jump to content

Need help about payment process


renaud2263

Recommended Posts

Dear All,

I'm actually buiding a module to manage drop-ship products. That mean's these products are not in stock but directly shipped by the supplier to the customer.

My problem is that the class PaymentModule and the method validateOrder updates the order_state (and history) to 9 which is "out of stock" status. Even if I declared that the product can be shipped whith stock at 0 and minimal_quantity set to 0.

I tryed to override this file to avoid the automatic backorder, but nothing changes. So the customer receives the "outofstock" email and it's not good at all !

Here are the lines:

					$prod = new Product($product['id_product']);
					$is_drop_ship = $prod->is_drop_ship;

                    if (Configuration::get('PS_STOCK_MANAGEMENT') && ($order_detail->getStockState() || $order_detail->product_quantity_in_stock <= 0) && $is_drop_ship == 0 && !$virtual_product) {
                        $history = new OrderHistory();
                        $history->id_order = (int)$order->id;
                        $history->changeIdOrderState(Configuration::get($order->valid ? 'PS_OS_OUTOFSTOCK_PAID' : 'PS_OS_OUTOFSTOCK_UNPAID'), $order, true);
                        $history->addWithemail();
                    }

Normally if the $is_drop_ship var is set to 0 the action must no be executed. But it's executed.

So my questions are:

- In the 1.7.2 the class PaymentModule is overridable or not ?

- I checked in the payments module as Paypal if the method validateOrder do something more but I dis not found.

- In my module which actionHook I can use to set the order with the proper status (and avoid the outofstock email) ? hookActionOrderStatusUpdate ? hookActionOrderStatusPostUpdate ?

Could you help me ?

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