Jump to content

urgent help needed: order creation failed


Recommended Posts

Hallo, I need your help, my customers can not complete orders, because this message "order creation failed" appears every time when they attempt to choose any of the payment options, please see attachment. My e-shop was working without any difficulties before and suddenly this error occured without even me having made any changes to the settings. Thank you for your prompt help I hope.

4964_nfebqThc251W7WB82CCe_t

Link to comment
Share on other sites

Hi,

Well first, bugs are not magic, it does not appear without an prior action or cause.

This need debugging of the function validateOrder in the class PaymentModule.

It does not go through this condition

if ($result AND isset($order->id))



meaning the order can not be registered in database.

You have to debug during an order by printing out what is in the order....typically

Tools::dieObject($order);




just before this if above statement.


Regards

  • Like 1
Link to comment
Share on other sites

Hi Zatras,

In simple words what Gregory means is that you need to check whats happening before that if statement.

He has provided with a piece of code which you need to put just before the if condition to check whats the output COMING UNTIL THAT POINT.

Just paste the
Tools::dieObject($order);

above the if condition in the Payment Module which resides at RootFolder\classes\PaymentModule.php (line 112)

Try to place an order and check the output to know where things are going wrong in the function validateOrder ();

Cheers..
Cronos

Link to comment
Share on other sites

  • 1 month later...

I have the same problem. Inserting the suggested dump command gives:

Order Object
(
   [id_address_delivery] => 3
   [id_address_invoice] => 3
   [id_cart] => 5
   [id_currency] => 1
   [id_lang] => 3
   [id_customer] => 2
   [id_carrier] => 3
   [secure_key] => 13eb87d15ed2f55c75cb3b3fcd70aeca
   [payment] => Overschrijving
   [module] => bankwire
   [recyclable] => 0
   [gift] => 0
   [gift_message] => 
   [shipping_number] => 
   [total_discounts] => 0
   [total_paid] => 730
   [total_paid_real] => 730
   [total_products] => 730
   [total_shipping] => 0
   [total_wrapping] => 0
   [invoice_number] => 
   [delivery_number] => 
   [invoice_date] => 
   [delivery_date] => 
   [date_add] => 2009-04-07 12:47:18
   [date_upd] => 2009-04-07 12:47:18
   [tables:protected] => Array
       (
           [0] => orders
       )

   [fieldsRequired:protected] => Array
       (
           [0] => id_address_delivery
           [1] => id_address_invoice
           [2] => id_cart
           [3] => id_currency
           [4] => id_lang
           [5] => id_customer
           [6] => id_carrier
           [7] => payment
           [8] => total_paid
           [9] => total_paid_real
           [10] => total_products
       )

   [fieldsSize:protected] => Array
       (
           [payment] => 32
       )

   [fieldsValidate:protected] => Array
       (
           [id_address_delivery] => isUnsignedId
           [id_address_invoice] => isUnsignedId
           [id_cart] => isUnsignedId
           [id_currency] => isUnsignedId
           [id_lang] => isUnsignedId
           [id_customer] => isUnsignedId
           [id_carrier] => isUnsignedId
           [secure_key] => isMd5
           [payment] => isGenericName
           [recyclable] => isBool
           [gift] => isBool
           [gift_message] => isMessage
           [total_discounts] => isPrice
           [total_paid] => isPrice
           [total_paid_real] => isPrice
           [total_products] => isPrice
           [total_shipping] => isPrice
           [total_wrapping] => isPrice
           [shipping_number] => isUrl
       )

   [table:protected] => orders
   [identifier:protected] => id_order
   [id] => 
   [fieldsRequiredLang:protected] => Array
       (
       )

   [fieldsSizeLang:protected] => Array
       (
       )

   [fieldsValidateLang:protected] => Array
       (
       )

)

END



What is wrong?

Discovered that [id] is empty resulting in an empty $result. Any idea?

Regards, Bart

Link to comment
Share on other sites

  • 3 months later...

Hi all,

I also got the same problem. Tried the debug and below is what I got. I'm not really sure how to interpret it though. But my ps_orders do exist and all other orders placed have no problem.
I tried different account to order the same items and it still give me error.
I also tried deleting the products, re-added, and re-ordered, still gives the same error.

Could anybody help me here?

Thanks!



Order Object
(
   [id_address_delivery] => 76
   [id_address_invoice] => 76
   [id_cart] => 132
   [id_currency] => 2
   [id_lang] => 1
   [id_customer] => 67
   [id_carrier] => 31
   [secure_key] => 22060ced49950b08ff52a682160d0a89
   [payment] => Western Union / Moneygram
   [module] => bankwire
   [recyclable] => 0
   [gift] => 0
   [gift_message] => 
   [shipping_number] => 
   [total_discounts] => 0
   [total_paid] => 14.48
   [total_paid_real] => 14.48
   [total_products] => 9.98
   [total_shipping] => 4.5
   [total_wrapping] => 0
   [invoice_number] => 
   [delivery_number] => 
   [invoice_date] => 
   [delivery_date] => 
   [date_add] => 2009-07-17 14:32:02
   [date_upd] => 2009-07-17 14:32:02
   [tables:protected] => Array
       (
           [0] => orders
       )

   [fieldsRequired:protected] => Array
       (
           [0] => id_address_delivery
           [1] => id_address_invoice
           [2] => id_cart
           [3] => id_currency
           [4] => id_lang
           [5] => id_customer
           [6] => id_carrier
           [7] => payment
           [8] => total_paid
           [9] => total_paid_real
           [10] => total_products
       )

   [fieldsSize:protected] => Array
       (
           [payment] => 32
       )

   [fieldsValidate:protected] => Array
       (
           [id_address_delivery] => isUnsignedId
           [id_address_invoice] => isUnsignedId
           [id_cart] => isUnsignedId
           [id_currency] => isUnsignedId
           [id_lang] => isUnsignedId
           [id_customer] => isUnsignedId
           [id_carrier] => isUnsignedId
           [secure_key] => isMd5
           [payment] => isGenericName
           [recyclable] => isBool
           [gift] => isBool
           [gift_message] => isMessage
           [total_discounts] => isPrice
           [total_paid] => isPrice
           [total_paid_real] => isPrice
           [total_products] => isPrice
           [total_shipping] => isPrice
           [total_wrapping] => isPrice
           [shipping_number] => isUrl
       )

   [table:protected] => orders
   [identifier:protected] => id_order
   [id] => 
   [fieldsRequiredLang:protected] => Array
       (
       )

   [fieldsSizeLang:protected] => Array
       (
       )

   [fieldsValidateLang:protected] => Array
       (
       )

)


END

Link to comment
Share on other sites

  • 2 weeks later...

I have de same problem, but I do not resolve, Please, help me!! I revise the table and exist

[quote]Order Object
(
   [id_address_delivery] => 17
   [id_address_invoice] => 17
   [id_cart] => 20
   [id_currency] => 1
   [id_lang] => 1
   [id_customer] => 12
   [id_carrier] => 2
   [secure_key] => 1d55b4130999f96d6d8930b892f12def
   [payment] => Bank Wire
   [module] => bankwire
   [recyclable] => 1
   [gift] => 0
   [gift_message] => 
   [shipping_number] => 
   [total_discounts] => 0
   [total_paid] => 21.58
   [total_paid_real] => 21.58
   [total_products] => 11.88
   [total_shipping] => 7.8
   [total_wrapping] => 0
   [invoice_number] => 
   [delivery_number] => 
   [invoice_date] => 
   [delivery_date] => 
   [date_add] => 2009-07-27 18:51:39
   [date_upd] => 2009-07-27 18:51:39
   [tables:protected] => Array
       (
           [0] => orders
       )

   [fieldsRequired:protected] => Array
       (
           [0] => id_address_delivery
           [1] => id_address_invoice
           [2] => id_cart
           [3] => id_currency
           [4] => id_lang
           [5] => id_customer
           [6] => id_carrier
           [7] => payment
           [8] => total_paid
           [9] => total_paid_real
           [10] => total_products
       )

   [fieldsSize:protected] => Array
       (
           [payment] => 32
       )

   [fieldsValidate:protected] => Array
       (
           [id_address_delivery] => isUnsignedId
           [id_address_invoice] => isUnsignedId
           [id_cart] => isUnsignedId
           [id_currency] => isUnsignedId
           [id_lang] => isUnsignedId
           [id_customer] => isUnsignedId
           [id_carrier] => isUnsignedId
           [secure_key] => isMd5
           [payment] => isGenericName
           [recyclable] => isBool
           [gift] => isBool
           [gift_message] => isMessage
           [total_discounts] => isPrice
           [total_paid] => isPrice
           [total_paid_real] => isPrice
           [total_products] => isPrice
           [total_shipping] => isPrice
           [total_wrapping] => isPrice
           [shipping_number] => isUrl
       )

   [table:protected] => orders
   [identifier:protected] => id_order
   [id] => 
   [fieldsRequiredLang:protected] => Array
       (
       )

   [fieldsSizeLang:protected] => Array
       (
       )

   [fieldsValidateLang:protected] => Array
       (
       )

)

END[/quote]

Link to comment
Share on other sites

Hi. I kinda hacked it, but here is (hopefully) a solution.

1. You open the [root]/classes/PaymentModule.php file;
2. You go to line 108, right above the $order-> add() call;
3. You put 2 more check-ups:

            /* script-kiddie fix */
           if(!sizeof($order->invoice_date))
               $order->invoice_date = '2009-07-27 00:00:00';

           if(!sizeof($order->delivery_date))
               $order->delivery_date = '2009-07-27 00:00:00';



This is the script-kiddie way, cause i'm under deadline.
Query was this:

#1292 - Incorrect datetime value: '' for column 'invoice_date' at row 1
INSERT INTO `ps_orders` ( `id_address_delivery` , `id_address_invoice` , `id_cart` , `id_currency` , `id_lang` , `id_customer` , `id_carrier` , `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` , `date_add` , `date_upd` )
VALUES (
'2', '2', '4', '1', '1', '2', '3', '3bfb2c388c7b6d51855977ccce64f0e2', 'Cash on delivery (COD)', 'cashondelivery', '0', '0', '', '', '0', '20', '20', '20', '0', '0', '0', '0', '', '', '2009-07-27 20:21:10', '2009-07-27 20:21:10'
)
Link to comment
Share on other sites

  • 6 months later...

I am also stuck with this "problem / bug".
From the dump i can see the invoice id is empty (also in the other dumps from previous posters).

When you change the invoice option in the Order statuses (connected with a payment module) the error disappears.
For me it also worked and then it didnt anymore. But i was changing a lot of things, so i kind of blame me.

But it seems the invoice nrs do not match/are created.
And the temporary hack looks weird to install.

Link to comment
Share on other sites

  • 1 year later...

Hola:

Tengo el error ORDER CREATION FAILED. He mirado toda la información que he encontrado en el foro y no he conseguido nada. He obtenido siguiendo las instrucciones que por aquí se dan, la siguiente información:

Order Object
(
   [id_address_delivery] => 318
   [id_address_invoice] => 318
   [id_cart] => 8799
   [id_currency] => 2
   [id_lang] => 3
   [id_customer] => 30
   [id_carrier] => 27
   [secure_key] => 7e35b6186cfb5c6f21d01288d3282b6e
   [payment] => Trasferencia bancaria
   [module] => bankwire
   [recyclable] => 0
   [gift] => 0
   [gift_message] => 
   [shipping_number] => 
   [total_discounts] => 0
   [total_paid] => 95
   [total_paid_real] => 95
   [total_products] => 80.51
   [total_products_wt] => 95
   [total_shipping] => 0
   [total_charger] => 
   [total_deposit] => 
   [total_resto] => 
   [total_wrapping] => 0
   [invoice_number] => 
   [delivery_number] => 
   [invoice_date] => 0000-00-00 00:00:00
   [delivery_date] => 0000-00-00 00:00:00
   [valid] => 
   [date_add] => 2011-03-27 20:05:13
   [date_upd] => 2011-03-27 20:05:13
   [tables:protected] => Array
       (
           [0] => orders
       )
   [fieldsRequired:protected] => Array
       (
           [0] => id_address_delivery
           [1] => id_address_invoice
           [2] => id_cart
           [3] => id_currency
           [4] => id_lang
           [5] => id_customer
           [6] => id_carrier
           [7] => payment
           [8] => total_paid
           [9] => total_paid_real
           [10] => total_products
           [11] => total_products_wt
       )
   [fieldsSize:protected] => Array
       (
           [payment] => 32
       )
   [fieldsValidate:protected] => Array
       (
           [id_address_delivery] => isUnsignedId
           [id_address_invoice] => isUnsignedId
           [id_cart] => isUnsignedId
           [id_currency] => isUnsignedId
           [id_lang] => isUnsignedId
           [id_customer] => isUnsignedId
           [id_carrier] => isUnsignedId
           [secure_key] => isMd5
           [payment] => isGenericName
           [recyclable] => isBool
           [gift] => isBool
           [gift_message] => isMessage
           [total_discounts] => isPrice
           [total_paid] => isPrice
           [total_paid_real] => isPrice
           [total_products] => isPrice
           [total_products_wt] => isPrice
           [total_shipping] => isPrice
           [total_charger] => isPrice
           [total_deposit] => isPrice
           [total_resto] => isPrice
           [total_wrapping] => isPrice
           [shipping_number] => isUrl
       )
   [table:protected] => orders
   [identifier:protected] => id_order
   [_taxCalculationMethod:private] => 0
   [id] => 
   [fieldsRequiredLang:protected] => Array
       (
       )
   [fieldsSizeLang:protected] => Array
       (
       )
   [fieldsValidateLang:protected] => Array
       (
       )
)
END



Pero no sé interpretarlo. ¿Podéis ayudarme?

Gracias y saludos

papuki

Link to comment
Share on other sites

×
×
  • Create New...