X-Cart Mods, X-Cart Addons - WebsiteCM
Did you know...
You can filter x-cart mods
displayed by selecting an x-cart version filter from the left navigation.
X-Cart Excellence eZine
Subscribe for proven tips and special discounts!
Cart is empty
X-Cart Services
X-Cart Customization X-Cart Optimization
X-Cart Mods
Recommended Packages Must Have Mods Reseller Program
Filter Mods By Version
Mods By Purpose
X-Cart Administration X-Cart Packages X-Cart Appearance X-Cart Conversion X-Cart Customers X-Cart Integration X-Cart Marketing X-Cart Navigation X-Cart Search X-Cart SEO X-Cart Shopping Feeds X-Cart Upselling X-Cart Templates
Mods By Firm
WebsiteCM BCSE Firetank

WebsiteCM on Twitter

X-Cart Product Images on X-Cart Invoices and Order Confirmation Emails

X-Cart Product Images on X-Cart Invoices and Order Confirmation Emails
Category: Articles
Posted: Feb 2, 2010
Synopsis: X-Cart how-to provides a solution to a long standing x-cart problem of wanting to display product images on x-cart invoices and in order confirmation emails.

Recently we received a request for product images to appear on x-cart order invoices as well as in the x-cart order confirmation emails. As this is not a default x-cart feature, I had to wonder why. I hit the x-cart forums to see what if anything had been done, and found a four-year-old topic with no resolution. Hmm. I grabbed my 10pm cup of coffee and started code digging.

I quickly found that the thmb_url x-cart variable was not passed to the x-cart order confirmation page so any image displayed would use a dynamic php link, which would then not appear in the order confirmation email. The last thing I wanted to do was add another foreach loop to x-cart, so I added the existing "func_translate_products" function and created a solution as follows:

Open include/func/func.order.php

FIND:

$products[$k] = func_array_merge($products[$k], preg_grep("/\S/S", $local));

AFTER ADD:

// WCM - Invoice Images
$products[$k]['tmbn_url'] = func_get_image_url($pid, "T");

Open skin1/mail/html/order_data.tpl

<td><font style="FONT-SIZE: 11px">{$product.product}</font>

AFTER ADD:

{* WCM - Invoice Images *}
{if $product.tmbn_url ne ""}
<br />
{include file="product_thumbnail.tpl" full_url=Y productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="T"}
<br />
{/if}
{* / WCM - Invoice Images *}




Site Map