Jump to content
xt:Commerce Community Forum
Sign in to follow this  
Mlmsoft

Ean Barcode

Recommended Posts

Hi all

I have in the file order_mail.html one ean barcode font. Under product modell I have something like that: 3819877897654

I have expected that email notification (about order) will contain this modell written in the barcode format, but displayed is only big font (Arial 28 px).

Is it possible, that product modell will be displayed on the barcode format? I know that customer must have this TTF installed.

Thank you

Share this post


Link to post
Share on other sites

Originally posted by khan_thep@Feb 26 2005, 20:10 PM

I would suggest to create a barcode image on-the-fly

=>http://pear.php.net/package/Image_Barcode

also there are many available php-classes to do that job easily for different barcode-standards

Thank you.

I have found one sample here: http://www.nieko.net/?view=barcode.php

and now, how can this be included? Is there some gurus?

Cheers

Share this post


Link to post
Share on other sites

This is just a rough advice:

=> send_order.php

most interesting part...

   $order_query=xtc_db_query("SELECT

      products_id,

      orders_products_id,

      products_model,

      products_name,

      final_price,

      products_quantity

      FROM ".TABLE_ORDERS_PRODUCTS."

      WHERE orders_id='".$insert_id."'");



    $order_data=array();

    while ($order_data_values = xtc_db_fetch_array($order_query)) {

    	$attributes_query=xtc_db_query("SELECT

      products_options,

      products_options_values,

      price_prefix,

      options_values_price

      FROM ".TABLE_ORDERS_PRODUCTS_ATTRIBUTES."

      WHERE orders_products_id='".$order_data_values['orders_products_id']."'");

    	$attributes_data='';

    	$attributes_model='';

    	while ($attributes_data_values = xtc_db_fetch_array($attributes_query)) {

    	$attributes_data .=$attributes_data_values['products_options'].':'.$attributes_data_values['products_options_values'].'<br />';

    	$attributes_model .=xtc_get_attributes_model($order_data_values['products_id'],$attributes_data_values['products_options_values']).'<br />';

    	}

    $order_data[]=array(

     'PRODUCTS_MODEL' => $order_data_values['products_model'],

     'PRODUCTS_NAME' => $order_data_values['products_name'],

     'PRODUCTS_SHORT_DESCRIPTION' => xtc_get_short_description($order_data_values['products_id']),

     'PRODUCTS_ATTRIBUTES' => $attributes_data,

     'PRODUCTS_ATTRIBUTES_MODEL' => $attributes_model,

     'PRODUCTS_PRICE' => $xtPrice->xtcFormat($order_data_values['final_price'],true),

     'PRODUCTS_QTY' => $order_data_values['products_quantity']);

    }

=> take note: $oder_data is an array!!!

1. resolve the products EAN for each products_id by sending a second SQL-Query to TABLE_PRODUCTS or by doing a cartesian join in the regular SQL-Query...

2. call your barcode generator with the EAN code. save the generated image to a public folder (a simple cache can easyly be programmed (file_exists()) before calling the gd-functions, that will create the image...)

3. assign the barcode-image-links to the smarty-template ($smart->assign("barcode",$barlink);

4. include the new Variable (note => array!!!) in your order_mail.html template

=> Voila!

Share this post


Link to post
Share on other sites

Hi all

I have tryed this:

Look for the line (in your templates/language/mail/language directory)

<td style="border-right: 2px solid; border-bottom: 2px solid; border-color: #ffffff;">{$order_values.PRODUCTS_NAME}

{$order_values.PRODUCTS_ATTRIBUTES}</td>

and replace that line with this:

<td style="border-right: 2px solid; border-bottom: 2px solid; border-color: #ffffff;">barcode.php?barcode={$order_values.PRODUCTS_MODEL}&coding=EAN-13</a>

{$order_values.PRODUCTS_ATTRIBUTES_MODEL}</td>

Voila !

P.S. problem is voucher code, ie: GIFT_3818876789876 makes not a png picture. GIFT_ must somehow be stripped. Does have anybody a Idea?

Cheers

Share this post


Link to post
Share on other sites
Sign in to follow this  

×
×
  • Create New...