Jump to content

Orders without product


Recommended Posts

Hello,

I have installed prestashop and I face a problem. When I receive an order, this order appears in my Backoffice without products and I can´t see which products have been bought. I can´t change the order status either.


Does anyone knows how to solve this?


Thanks!

Link to comment
Share on other sites

  • 2 weeks later...

Hi Zenith,

I am using Prestashop 1.3.2.3.
I have done as you suggested, but the orders are still not being populated with products.

I have commented out this line from modules/mailalerts/mailalerts.php
'{product_link}' => $link->getProductLink($product)

Orders are still empty of products.

This is the whole picture:

1. Order email notification is received with products
See attached image on left below.

2. Front end shows order with correct amount, but order does not contain products. If you download order PDF, it also shows correct amount but no products.
See attached image in the center below.

3. Back end also shows order with correct amount but also no products.
See attached image on right below.

Is there any other quick fix I can try?
What exactly is your suggestion trying to fix?

Thank you.

34647_GTojuqG7wLNYhxkrpElp_t

34648_RDaZAgylulz598SP5Mqd_t

34649_sRMeoBvRX8FV3FSE7pHL_t

Link to comment
Share on other sites

jfacero

Do you have a template installed?

Test without template.

I have the same problem, but it seems that only happens with a template.
I am looking into it.

Link to comment
Share on other sites

I'm having the same problem. And it persists even with the default theme.

Hi jayflash,
When you say it persists even with the default theme, do you mean you have made a fresh Prestashop install or you just de-selected the current theme and selected the default theme in the back-end?

I have noticed that, in my case, it is the theme installation process that creates this problem. More specifically, in my case, it is after importing the mySQL dump that comes with the theme into the MySQL database that the problem starts happening.

If you installed a template and imported a mySQL dump that came with the theme, would you please try this
1.- do a fresh Prestashop install,
2.- install the theme, without importing the mySQL dump,
3.- test the order-product issue

If the order-product is working ok, then import the mySQL dump and test again. If your case is like mine, you will see the problem happening now.
Link to comment
Share on other sites

Change the mailalerts.php code to look like this (I'm thinking you have only commented out the line so it will produce an error being in the middle of the array.

        $templateVars = array(
           '{product}' => (is_array($product->name) ? $product->name[(int)(Configuration::get('PS_LANG_DEFAULT'))] : $product->name)
       );
/*        $templateVars = array(
           '{product}' => (is_array($product->name) ? $product->name[(int)(Configuration::get('PS_LANG_DEFAULT'))] : $product->name),
           '{product_link}' => $link->getProductLink($product)
       );
*/



My temp fix skips getting the product link for the e-mail notification template, this is what is causing an error. When the error occurs on the first product the product is not added and the process is stopped, thus no items get added to the database as part of the order. Removing this line lets the order go through without an error and be entered into the database.

The notification e-mail that gets sent out is sent without a working link, but this is really not an issue compared to no products in the order being added to the database.

Link to comment
Share on other sites

I have the original theme modified, no no SQL injection from here. But I do have installed the iPrestashop theme. I'll install the store from scratch, and activate addons one -by-one to try to trace the problem.

Please, do let me know if you find what is causing it in your case.
Link to comment
Share on other sites

Thank you Zenith,
I have tried what you suggest, but it is not working for me.

This is the code in my mailalerts.php;

        $templateVars = array(
           '{product}' => (is_array($product->name) ? $product->name[(int)(Configuration::get('PS_LANG_DEFAULT'))] : $product->name)
       );

//     
// the third line below is commented out following instructions from http://www.prestashop.com/forums/member/35794/zenith/
// See http://www.prestashop.com/forums/viewthread/79640/#337733
//   
//  $templateVars = array(
//      '{product}' => (is_array($product->name) ? $product->name[intval(Configuration::get('PS_LANG_DEFAULT'))] : $product->name),
//            '{product_link}' => $link->getProductLink($product)
//        );



but I still have empty orders in front and backend. See attachment.

By the way, what version of Prestashop are you running?
Mine is 1.3.2.3.

34752_MD4s1VAE1DWDNnxwktP0_t

Link to comment
Share on other sites

I'm using the SVN, but the same code applies from 1.3.2.3.

Do you have a PHP "error_log" file in the root directory of your site....this may shed some light on what error exactly you have.

Hi, thanks.
I had a huge error_log. I have deleted it and repeated the order process to get a smaller file. See attached error_log files:

- error_log 06.txt this contains error logs for 6 steps in the process.

- error_log-just-confirm-order.txt this contains error logs for only the last step in the process - Confirm order.

From what I can see, there is no error directly related to mailalerts.php.
There seems to be a problem with homefeatured.tpl.php, and some problem related to GD and

These two lines keep repeating in all error logs:
[07-dic-2010 17:55:22] PHP Warning:  Division by zero in /home/queorigi/public_html/tools/smarty/compile/%�^EB1^EB1BCB1C%%homefeatured.tpl.php on line 17
[07-Dec-2010 17:55:34] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/php_gd2.dll' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613/php_gd2.dll: cannot open shared object file: No such file or directory in Unknown on line 0

error_log 06.txt

error_log-just-confirm-order.txt

Link to comment
Share on other sites

Are either of you using a language that is not English?

Maybe the email template is missing in another language?

Also, turn on debugging in "config/config.inc.php" line 4
@ini_set('display_errors', 'on');


Hi, I am using Spanish !
How can I test whether a missing email template is the cause?
I just turned display_errors on.
Link to comment
Share on other sites

I have turned errors on

/* Debug only */
ini_set('display_errors', 'on');
define('_PS_DEBUG_SQL_', false);


but I see no error messages on any pages while ordering. The error log keeps collecting warning, but there are no errors on screen while going through the order process. Is this normal?

Link to comment
Share on other sites

Contact your host regarding the gd error, they should be able to help fix that.

The division by zero relates to I think the image size of the homeSize image. In BO check that all image names have sizes assigned to them. (these two may be related as gd is used to create the resized images).

Spanish is included and I've just checked it and all templates exist so that is not the issue I don't think.

It does not look like these errors would effect the order process though. Hmmmm

If you PM me your store URL I'll take a look for you quickly.

Link to comment
Share on other sites

I have turned errors on
/* Debug only */
ini_set('display_errors', 'on');
define('_PS_DEBUG_SQL_', false);


but I see no error messages on any pages while ordering. The error log keeps collecting warning, but there are no errors on screen while going through the order process. Is this normal?



That's normal. It's a good thing if there are no errors on the screen.

I didn't realize you aren't using the default template. The division errors are related to the template you are using.
Link to comment
Share on other sites

I solved my problem.

The template I am using must have been created using a previous version of Prestashop, not 1.3.2.3, which is the one I installed. The template came with a dump.sql to quickly recreate the look of the template demo. The database created by importing this dump.sql into MySQL was different from a fresh install of current version of Prestashop.

Table ps_order_detail was missing two fields: reduction_percent and reduction_amount. This was causing the order detail not to be recorded and therefore Prestashop could not show the products in the orders.

I fixed this by running the following SQL queries on the database:

ALTER TABLE `ps_order_detail` ADD `reduction_percent` decimal(10,2) NOT NULL DEFAULT '0.00';
ALTER TABLE `ps_order_detail` ADD `reduction_amount` decimal(20,6) NOT NULL DEFAULT '0.000000';

Link to comment
Share on other sites

  • 2 months later...
I solved my problem.

The template I am using must have been created using a previous version of Prestashop, not 1.3.2.3, which is the one I installed. The template came with a dump.sql to quickly recreate the look of the template demo. The database created by importing this dump.sql into MySQL was different from a fresh install of current version of Prestashop.

Table ps_order_detail was missing two fields: reduction_percent and reduction_amount. This was causing the order detail not to be recorded and therefore Prestashop could not show the products in the orders.

I fixed this by running the following SQL queries on the database:

ALTER TABLE `ps_order_detail` ADD `reduction_percent` decimal(10,2) NOT NULL DEFAULT '0.00';
ALTER TABLE `ps_order_detail` ADD `reduction_amount` decimal(20,6) NOT NULL DEFAULT '0.000000';


man, it really works!!! thank you a lot!
Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...