Jump to content

[Resolved] Order stuck on "pending," smarty syntex error in error log


alipitt13

Recommended Posts

I noticed an order was stuck on pending in my client's storefront, so I took at look at the error log. There were four duplicate errors at the time of the purchase that all read the following:

[Exception] /home1/chargonc/public_html/buy/includes/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:82 - Syntax error in template "string:

Thank You {$DATA.first_name}!

)}

" - Unexpected ")"

Any ideas? I'm not sure if this order was paid for and needs to be sent, but never switched to processing?

Link to comment
Share on other sites

The order was probably paid for (see the order's Transaction Logs and History tabs). This email is sent when the order goes to Processing.

Have you edited the email templates? If so, we need to either find and fix, or have CubeCart reload (all) the default templates into the database, overwriting what is currently being used.

To reload all templates, in admin, Email Templates, Import tab, choose the language under Import and click Save.

Link to comment
Share on other sites

Thanks bsmither, I have edited the email templates quite a bit, so I don't want to reload them. The error line ( Thank You {$DATA.first_name}! ) appears in my Cart: Order Confirmed template, but I have no idea how to pinpoint the issue. I don't think I made many edits to that template, if any. Is there a way to reload just one template, or see the default template to compare?

I checked the order's history and it said "processing" four times, the same time as the four errors. I tried to update the order from pending to processing twice, and it won't go through. It takes me to a blank white screen. When I reload the admin, the order still says pending, but records the processing in the order history. 

processing-order-history.png

Link to comment
Share on other sites

Please view this template in the editor. Since I do not see any HTML markup, I will guess the problem is in the content showing on the Plain Text tab.

So, please copy a few lines of an area where you made edits. We should be able to spot the erroneous parenthesis.

Link to comment
Share on other sites

Here's the whole template, I can't for the life of me remember where I made edits. 

 

<p>Thank You {$DATA.first_name}!</p>

<p>Your order {$DATA.cart_order_id} has been received. Please keep this email for your records. It is possible to view the status of your order online.</p>

<p><a href="{$DATA.link}">{$DATA.link}</a></p>

<table width="100%">
    <tbody>
        <tr>
            <td valign="top" width="50%"><strong>Billing address:</strong><br />
            {$BILLING.first_name} {$BILLING.last_name}<br />
            {if !empty({$BILLING.company_name})}{$BILLING.company_name}<br />
            {/if} {$BILLING.line1}<br />
            {if !empty({$BILLING.line2})}{$BILLING.line2}<br />
            {/if} {$BILLING.town}<br />
            {$BILLING.state}<br />
            {$BILLING.postcode}<br />
            {$BILLING.country}<br />
            {$BILLING.phone}<br />
            <br />
            <strong>Email:</strong><br />
            {$BILLING.email}</td>
            <td valign="top" width="50%"><strong>Shipping address:</strong><br />
            {$SHIPPING.first_name} {$SHIPPING.last_name}<br />
            {if !empty({$SHIPPING.company_name})}{$SHIPPING.company_name}<br />
            {/if}{$SHIPPING.line1}<br />
            {if !empty({$SHIPPING.line2})}{$SHIPPING.line2}<br />
            {/if}{$SHIPPING.town}<br />
            {$SHIPPING.state}<br />
            {$SHIPPING.postcode}<br />
            {$SHIPPING.country}</td>
        </tr>
    </tbody>
</table>

<table border="0" cellpadding="3" cellspacing="0" width="100%">
    <tbody>
        <tr>
            <td><strong>Item</strong></td>
            <td><strong>Quantity</strong></td>
            <td><strong>Cost</strong></td>
        </tr>
        <!--{foreach from=$PRODUCTS item=product}-->
        <tr>
            <td>{$product.name}<br />
            {$product.product_options}</td>
            <td>{$product.quantity}</td>
            <td>{$product.price}</td>
        </tr>
        <!--{/foreach}-->
        <tr>
            <td>&nbsp;</td>
            <td>{if !empty($DATA.ship_method)}{$DATA.ship_method|replace:'_':' '}:{if !empty($DATA.ship_product)} ({$DATA.ship_product}){/if}{else}Shipping:{/if}</td>
            <td>{$DATA.shipping}</td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td>Discount:</td>
            <td>{$DATA.discount}</td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td>Subtotal:</td>
            <td>{$DATA.subtotal}</td>
        </tr>
        <!--{foreach from=$TAXES item=tax}-->
        <tr>
            <td>&nbsp;</td>
            <td>{$tax.tax_name}: ({$tax.tax_percent}%)</td>
            <td>{$tax.tax_amount}</td>
        </tr>
        <!--{/foreach}-->
        <tr>
            <td>&nbsp;</td>
            <td><strong>Order Total: </strong></td>
            <td><strong>{$DATA.total}</strong></td>
        </tr>
    </tbody>
</table>
{if !empty({$DATA.note_to_customer}

<p>)}</p>

<p>&quot;{$DATA.note_to_customer}&quot;</p>
{/if}

Link to comment
Share on other sites

This has HTML markup in it. This should be the content on the HTML tab. We need to see the content on the Plain Text tab.

However, this part of the above:

At the end:
</table>
{if !empty({$DATA.note_to_customer}

<p>)}</p>

<p>&quot;{$DATA.note_to_customer}&quot;</p>
{/if} 

Should be:
</table>
{if !empty({$DATA.note_to_customer})}
<p>&quot;{$DATA.note_to_customer}&quot;</p>
{/if} 

Be sure to fix the above in the editor's Source mode.

And also check for the same on the Plain Text tab. The content on the Plain Text tab does NOT have HTML markup.

Link to comment
Share on other sites

Sorry about that, here's the plain text:

Thank You {$DATA.first_name}!
        
        Your order {$DATA.cart_order_id} has been received which was placed on {$DATA.order_date}. Please keep this email for your records. It is possible to view the status of your order online. 
        
        {$DATA.link}
        
        ----------------------------------------------------------------------
        Billing address:
        {$BILLING.first_name} {$BILLING.last_name}
        {if !empty({$BILLING.company_name})}{$BILLING.company_name}
        {/if}{$BILLING.line1}
        {if !empty({$BILLING.line2})}{$BILLING.line2}
        {/if}{$BILLING.town}
        {$BILLING.state}
        {$BILLING.postcode}
        {$BILLING.country}
        {$BILLING.phone}
        
        Email:
        {$BILLING.email}
        
        Shipping address:
        {$SHIPPING.first_name} {$SHIPPING.last_name}
        {if !empty({$SHIPPING.company_name})}{$SHIPPING.company_name}
        {/if}{$SHIPPING.line1}
        {if !empty({$SHIPPING.line2})}{$SHIPPING.line2}
        {/if}{$SHIPPING.town}
        {$SHIPPING.state}
        {$SHIPPING.postcode}
        {$SHIPPING.country}
        
        ----------------------------------------------------------------------
        Items in Your Order
        
        {foreach from=$PRODUCTS item=product}
        -----------------------------------
        {$product.name}
        {$product.product_options}
        
        Part Number: {$product.product_code}
        Unit Price: {$product.price}
        Qty: {$product.quantity}
        
        {/foreach}
        -----------------------------------
        Subtotal: {$DATA.subtotal}
        Discount: {$DATA.discount}
        {if !empty($DATA.ship_method)}{$DATA.ship_method|replace:'_':' '}:{if !empty($DATA.ship_product)} ({$DATA.ship_product}){/if}{else}Shipping:{/if} {$DATA.shipping}
        {foreach from=$TAXES item=tax}{$tax.tax_name} ({$tax.tax_percent}%): {$tax.tax_amount}
        {/foreach}
        --------------------------
        Order Total: {$DATA.total}
        ==========================
        {if !empty({$DATA.note_to_customer})}
        "{$DATA.note_to_customer}"{/if}

Link to comment
Share on other sites

Be sure to fix what was pointed out on the HTML tab.

On the Plain Text tab, let's make this fix. Near the bottom, find:

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

Replace that with:

{$DATA.ship_method}

I see nothing else wrong with the Plain Text content.

Link to comment
Share on other sites

I fixed the HTML and Plain Text issues, cleared cache and tried to manually change the order to "processing" again, but same blank white screen, same error in the error log and the order is still "pending."  

So this is weird... My changes to the HTML template aren't saving. It keeps reverting back to:

</table>
{if !empty({$DATA.note_to_customer}

<p>)}</p>

<p>&quot;{$DATA.note_to_customer}&quot;</p>
{/if}

I've tried changing it as you suggested several times and it simply won't save. 

Link to comment
Share on other sites

For testing purposes, I removed the following code entirely, and the order was able to change to "processing." Is the note to customer field crucial or required?

{if !empty({$DATA.note_to_customer}

<p>)}</p>

<p>&quot;{$DATA.note_to_customer}&quot;</p>
{/if}

Link to comment
Share on other sites

It is not crucial nor required. But the content should be able to be saved.

Stupid question, but: are you making this edit in the editor's Source mode?

If so, before saving, switch the editor back to WYSIWYG mode, make sure that the )} is directly at the end of customer}. Then save. Reload the template back into the editor to make to sure the edit was applied.

Link to comment
Share on other sites

I had this same problem with my new CC6 store and Al corrected the template for me, as I had edited some of the content.

But I'm pretty sure that I didn't edit anything at the bottom of the template page, I just added a couple of paragraphs of plain text at the top about how I respond to orders.

I wonder if this is one of the times CC6 puts in its own edits/overwrites what you added, the same way it perpetually adds blank paragraphs into my site documents against my will, messing up page spacing?

Link to comment
Share on other sites

  • 3 weeks later...

In another conversation, the suggestion is to make this edit:

From:
{if !empty({$DATA.note_to_customer})}

To:
{if !empty($DATA.note_to_customer)}

By eliminating the nesting of braces, the editor will not corrupt the code.

Link to comment
Share on other sites

  • 2 weeks later...

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