Jump to content

Not emailing orders


keat

Recommended Posts

I've just gone live with the V6 and for some reason, it doesn't appear to be sending order confirmation emails inhouse.

It's sending customers thier confirmation, but not notifying us of the order.

The test (after save) function passes.

As I've not had a live site until now, I've been unable to test this, is there something I need to set ?

I found the checkbox inside the admin details, which wasn't checked. I was hoping this was the issue, but alas not.

 

 

 

Link to comment
Share on other sites

If I change 'Order status for admin email notifications' to Pending and then try to checkout as a customer, i get a blank page on the gateway. It's as if the gateway hung.

If I change this to setting Processing, the gateway comes back.

Now what I find is if I manually change an order from Pending to Processing from the admin side, the page hangs again, much the same way as the gateway did.

So it seems that there is an issue it trying to send an admin email to self

Link to comment
Share on other sites

I've tried just about every email setting I could think of.

SSL, without SSL, with and without authentication, all the email tests pass.

As a customer placing an order, I get the store emails to say my order has been accepted etc.

I'm stumped.

At the moment, I have order notification set to 'Fraud' so the site will at least function.

Link to comment
Share on other sites

Hopefully someone will be along this morning with the skills to be of help. In the meantime, search here on the forum for email debug. It may be that one of those threads will give you some ideas to try. The first one that popped up for me looked promising.

Link to comment
Share on other sites

 

I added a string suggested by Brian in another thread to mailer.class.php, and got this in my error log.

Although I'm not sure if it's related.

 

 

[05-Mar-2016 15:01:56 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/xxxxx/public_html/modules/plugins/category_product_options/hooks/class.cubecart.pre_display_category.php on line 0
[05-Mar-2016 15:01:57 UTC] PHP Warning:  Shipping not setup or allow no shipping not enabled in /home/xxxxxx/public_html/classes/cubecart.class.php on line 1720
[05-Mar-2016 15:02:20 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/xxxxxxx/public_html/modules/plugins/category_product_options/hooks/class.cubecart.pre_display_category.php on line 0

Link to comment
Share on other sites

"On line 0"?

That tells me /modules/plugins/category_product_options/hooks/class.cubecart.pre_display_category.php could be ionCube encoded, and your PHP installation does not have a compatible version of the ionCube decoder installed.

"Shipping not setup" will want me to ask, do you have any shipping modules enabled?

Link to comment
Share on other sites

I have all in one shiiping set up, and I do have IonCube, The mod which requires IONCube HavenSwifts product options mod, sdeems to be working OK though.

 

Just in case it's got anything to do with this, I'll rebuild Apache/PHP

 

Link to comment
Share on other sites

I'm currently recompiling PHP just in case it has anything to do with the way I installed IONCube recently.

In the meantime, I also found these entries in the cubecart error log.

 

[Exception] /home/xxxxxxx/public_html/includes/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:62 - Syntax error in template "string:

{$DATA.first_name} {$DATA.last_name..." on line 62 "{if !empty($DATA.ship_method)}{$DATA.ship_method|replace:'_':' '}:{if !empty($DATA.ship_product)} ({$DATA.ship_product}){/if}{else}Shipping:{/if}
    Today, 15:40     [Exception] /home/xxxxxxx/public_html/includes/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:62 - Syntax error in template "string:

{$DATA.first_name} {$DATA.last_name..." on line 62 "{if !empty($DATA.ship_method)}{$DATA.ship_method|replace:'_':' '}:{if !empty($DATA.ship_product)} ({$DATA.ship_product}){/if}{else}Shipping:{/if}
    Today, 15:40     [Exception] /home/xxxxxxx/public_html/includes/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:62 - Syntax error in template "string:

{$DATA.first_name} {$DATA.last_name..." on line 62 "{if !empty($DATA.ship_method)}{$DATA.ship_method|replace:'_':' '}:{if !empty($DATA.ship_product)} ({$DATA.ship_product}){/if}{else}Shipping:{/if}
    Today, 15:37     [Exception] /home/xxxxxxx/public_html/includes/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:62 - Syntax error in template "string:

{$DATA.first_name} {$DATA.last_name..." on line 62 "{if !empty($DATA.ship_method)}{$DATA.ship_method|replace:'_':' '}:{if !empty($DATA.ship_product)} ({$DATA.ship_product}){/if}{else}Shipping:{/if}
    Today, 15:37     [Exception] /home/xxxxxxx/public_html/includes/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:62 - Syntax error in template "string:

{$DATA.first_name} {$DATA.last_name..." on line 62 "{if !empty($DATA.ship_method)}{$DATA.ship_method|replace:'_':' '}:{if !empty($DATA.ship_product)} ({$DATA.ship_product}){/if}{else}Shipping:{/if}
    Today, 15:37     [Exception] /home/xxxxxxx/public_html/includes/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:62 - Syntax error in template "string:

{$DATA.first_name} {$DATA.last_name..." on line 62 "{if !empty($DATA.ship_method)}{$DATA.ship_method|replace:'_':' '}:{if !empty($DATA.ship_product)} ({$DATA.ship_product}){/if}{else}Shipping:{/if}

 

 
     
     
     
     
 
   

So I recomplied Apache/PHP which made no difference.

I cleared error_log and placed an order, and this is what I got.

[05-Mar-2016 16:09:55 UTC] PHP Warning:  Shipping not setup or allow no shipping not enabled in /home/xxxxx/public_html/classes/cubecart.class.php on line 1720

 

Link to comment
Share on other sites

For some reason, the template rendering engine isn't liking this part of the email template:

{$DATA.ship_method|replace:'_':' '}

Please bring up for editing the email templates for Cart: Order Confirmation and Admin: New Order. Edit both the HTML and Plain Text tabs.

Replace:

{$DATA.ship_method|replace:'_':' '}

with:

{$DATA.ship_method}

If you are really good at making SQL queries, you can construct an UPDATE CubeCart_email_content replace() query and apply it directly to the database using a utility such as phpMyAdmin.

Link to comment
Share on other sites

I made those small edits, but nothing changed.

And the only thing written to error_log was this.

 

 

 

[05-Mar-2016 16:26:59 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/xxxxxxx/public_html/modules/plugins/category_product_options/hooks/class.cubecart.pre_display_category.php on line 0

 

 

 

Wait, I only edited the plain text, give me 5

 

 

 

Making edits in both HTML and plain text, and now my test order is emailed and the page didn't hang at the gateway, so I guess we are getting somewhere ?

Link to comment
Share on other sites

We are getting somewhere!!!

The "Invalid argument" may or may not be serious depending on what the foreach is attempting to list. If there are no options to list when this hook is called, then PHP will complain about the foreach having nothing listable to list. (The program should always test for something legitimate to list before giving the list to foreach().)

 

Link to comment
Share on other sites

The "Invalid argument" part?

PHP's foreach() statement wants to iterate (that is, work it's way through a list) an array.

foreach ($an_array_of_things as $the_thing) { do something with $the_thing); }

All of $the_things from $an_array_of_things will get seen and something will get done for each of them.

However, if $an_array_of_things is not actually an array, but rather a single value, or nothing at all, then PHP will complain that foreach() was given an invalid thing to iterate.

 

Link to comment
Share on other sites

The template rendering engine (Smarty) has a few "variable modifiers". A "variable modifier" will take what is assigned to the variable, {$DATA.ship_method}, and modify it somehow.

The modifier replace:"_":" " will find all occurrences of the underscore and replace each underscore with a space character.

The reason it was there is because the shipping modules have folder names that use underscores: All_In_One_Shipping, and Canada_Post, for example. CubeCart (used to, not anymore) uses the folder name for the name of the shipping method. But, showing the underscores was not looking professional, so CubeCart had Smarty replace them.

I do not why or when Smarty started not liking using this modifier in this way.

There shouldn't be any implications of having removed this modifier from {$DATA.shipping_method}, as CubeCart is supposed to do that in its code.

Link to comment
Share on other sites

  • 5 weeks later...
On 3/5/2016 at 0:23 AM, keat said:

I've tried just about every email setting I could think of.

SSL, without SSL, with and without authentication, all the email tests pass.

As a customer placing an order, I get the store emails to say my order has been accepted etc.

I'm stumped.

At the moment, I have order notification set to 'Fraud' so the site will at least function.

HI keat,

Sorry this wont help you, but I am having a similar problem.

Can you tell me how to access my shopping cart as customer?

When I try to checkout Paypal kicks me out.

Phil

 

Edited by Lucky Phil
saved message twice?
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...