keat Posted March 5, 2016 Share Posted March 5, 2016 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. Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 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 Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 5, 2016 Share Posted March 5, 2016 Have you run the email test on the Advanced tab in Admin>Store Settings. What email settings are you using? Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 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. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 5, 2016 Share Posted March 5, 2016 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. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 5, 2016 Share Posted March 5, 2016 Let's have a look at PHP's error_log. Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 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 Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 5, 2016 Share Posted March 5, 2016 "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? Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 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 Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 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 Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 5, 2016 Share Posted March 5, 2016 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. Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 templates.bmp I'm ok with PHP admin, but that's about as far is it goes Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 5, 2016 Share Posted March 5, 2016 Cart: Order Confirmed and Admin: Order Received. I was close. Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 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 ? Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 5, 2016 Share Posted March 5, 2016 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().) Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 Sorry Brian, I'm not sure I understand what you just said :-) Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 5, 2016 Share Posted March 5, 2016 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. Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 That probably made less sense to me. I took out '|replace:'_':' '', but don't have a clue. 1. what it does 2. why it wasn't doing it 3. what the implications are of removing it. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 5, 2016 Share Posted March 5, 2016 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. Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 makes much more sense when you put it like that. Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 any ideas why this didn't work at all ? Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 5, 2016 Share Posted March 5, 2016 I do not why or when Smarty started not liking using this modifier in this way. When Smarty does not like something about a template, Smarty crashes PHP. That results in a blank white page. Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 So there's potential for others to suffer the same fate. Or is there something wrong with my install. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 5, 2016 Share Posted March 5, 2016 The database upgrade step at CC606 was supposed to have removed the replace modifier. According to: https://github.com/cubecart/v6/issues/884 the problem surfaces when the template eventually gets edited. There is nothing wrong with your installation, per se. Just bugs in the code the programmers are still fixing. Quote Link to comment Share on other sites More sharing options...
Lucky Phil Posted April 4, 2016 Share Posted April 4, 2016 (edited) 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 April 4, 2016 by Lucky Phil saved message twice? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.