Zen Cart Logo
Forums / Managing Customers and Orders / Add Product Description to Invoice/orders/emails ect;

Add Product Description to Invoice/orders/emails ect;

Views: 17,719

Results 21 to 40 of 41
10 Jun 2010, 12:28 PM
#21
bhadz08 avatar

bhadz08

New Zenner

Join Date:
Jun 2009
Posts:
41
Plugin Contributions:
0

Add Product Description to Invoice/orders/emails ect;

additional...

how did you get this "'products_description' => zen_get_products_description($this->products[$i]['id']),
"

i want to replace this with products_url but cant insert the data to the orders_products_table that have field name products_url.

thanks..

11 Jun 2010, 12:17 AM
#22
golowenow avatar

golowenow

New Zenner

Join Date:
Jul 2006
Location:
Washington State
Posts:
78
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

Hi,
Been a long time since seeing a post here. This was developed only to add the products description to emails, invoices and packing slips. It was made to replace the model number as many carts sell items that use descriptions of usually unique items that do not have model numbers. A for instance is....I sell collector stamps. There are no model numbers for those. But in my descriptions I note things like flaws and conditions of the stamps. So I developed this "mod" to add them to emails etc. It still works great with the newest Zencart by the way..:smile: As to adding URL's unless maybe the URL is written into the items description this will not work.
An idea may be to write the html code in your descriptions and thus when it produces an email the link would be created. Hope that helps you!
Regards.
J

11 Jun 2010, 1:39 AM
#23
bhadz08 avatar

bhadz08

New Zenner

Join Date:
Jun 2009
Posts:
41
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

thanks for the reply...

i dont think html in the description is a good idea.. coz it gives the user where the files are located. the purpose of this Product URL is an email that contains a link of the image for the printer to print. i also have 2 different order confirmations for the printer and for the customer. only lacking is the file of the product to be printed or made in the order confirmation. this way, it would make my orders automatic and dont have a hard time sending the product files for the printer and would be easy for the printer also.

so all i want is how to get the value in the field product_url of the table products_description and insert it in the orders_products table where i added a field products_url.

products_url are added during adding new products in the admin.

any help is appreciated.

11 Jun 2010, 4:34 AM
#24
golowenow avatar

golowenow

New Zenner

Join Date:
Jul 2006
Location:
Washington State
Posts:
78
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

ummm, why can't you just use downloadable products? The cart is designed for it.:clap:

11 Jun 2010, 10:44 AM
#25
bhadz08 avatar

bhadz08

New Zenner

Join Date:
Jun 2009
Posts:
41
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

i dont think download can be use for the purpose because download files are only available in the customers account..

thank you for some insights..

hope someone there has solutions..

15 Jun 2010, 5:40 AM
#26
bhadz08 avatar

bhadz08

New Zenner

Join Date:
Jun 2009
Posts:
41
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

thanks to all..

i just figured it out my own way... :smartalec:

15 Jun 2010, 12:35 PM
#27
golowenow avatar

golowenow

New Zenner

Join Date:
Jul 2006
Location:
Washington State
Posts:
78
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

bhadz08:

thanks to all..

i just figured it out my own way... :smartalec:

Be nice if you posted your solution for others to use.:yes:

21 Jun 2010, 8:35 AM
#28
bhadz08 avatar

bhadz08

New Zenner

Join Date:
Jun 2009
Posts:
41
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

ok.. i can post as soon as i can arrange how to do it..

22 Jun 2010, 12:14 AM
#29
golowenow avatar

golowenow

New Zenner

Join Date:
Jul 2006
Location:
Washington State
Posts:
78
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

Thank you bhadz08. A true zenner!:clap:

22 Jun 2010, 5:24 AM
#30
bhadz08 avatar

bhadz08

New Zenner

Join Date:
Jun 2009
Posts:
41
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

you are welcome... :yes:

here is what i did:

step 1:

in includes/functions/functions_lookups.php, add the code at the bottom but before the '?>'

/*
 *  Return products url, based on specified language (or current lang if not specified)
 */
  function zen_get_products_url($product_id, $language = '') {
    global $db;

    if (empty($language)) $language = $_SESSION['languages_id'];

    $product_query = "select products_url
                      from " . TABLE_PRODUCTS_DESCRIPTION . "
                      where products_id = '" . (int)$product_id . "'
                      and language_id = '" . (int)$language . "'";

    $product = $db->Execute($product_query);

    return $product->fields['products_url'];
  }
22 Jun 2010, 5:32 AM
#31
bhadz08 avatar

bhadz08

New Zenner

Join Date:
Jun 2009
Posts:
41
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

cont'd:

step 2:

in includes/classes/order.php find

  $sql_data_array = array('orders_id' => $zf_insert_id,
                              'products_id' => zen_get_prid($this->products[$i]['id']),
                              //'products_model' => $this->products[$i]['model'],
                              'products_name' => $this->products[$i]['name'],
                              'products_description' => zen_get_products_description($this->products[$i]['id']),
                             
                              'products_price' => $this->products[$i]['price'],
                              'final_price' => $this->products[$i]['final_price'],
                              'onetime_charges' => $this->products[$i]['onetime_charges'],
                              'products_tax' => $this->products[$i]['tax'],
                              'products_quantity' => $this->products[$i]['qty'],
                              'products_priced_by_attribute' => $this->products[$i]['products_priced_by_attribute'],
                              'product_is_free' => $this->products[$i]['product_is_free'],
                              'products_discount_type' => $this->products[$i]['products_discount_type'],
                              'products_discount_type_from' => $this->products[$i]['products_discount_type_from'],
                              'products_prid' => $this->products[$i]['id']);
      zen_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);

to this:

  $sql_data_array = array('orders_id' => $zf_insert_id,
                              'products_id' => zen_get_prid($this->products[$i]['id']),
                              //'products_model' => $this->products[$i]['model'],
                              'products_name' => $this->products[$i]['name'],
                              'products_description' => zen_get_products_description($this->products[$i]['id']),
                              [B]'products_url' => zen_get_products_url($this->products[$i]['id']),[/B]
                              'products_price' => $this->products[$i]['price'],
                              'final_price' => $this->products[$i]['final_price'],
                              'onetime_charges' => $this->products[$i]['onetime_charges'],
                              'products_tax' => $this->products[$i]['tax'],
                              'products_quantity' => $this->products[$i]['qty'],
                              'products_priced_by_attribute' => $this->products[$i]['products_priced_by_attribute'],
                              'product_is_free' => $this->products[$i]['product_is_free'],
                              'products_discount_type' => $this->products[$i]['products_discount_type'],
                              'products_discount_type_from' => $this->products[$i]['products_discount_type_from'],
                              'products_prid' => $this->products[$i]['id']);
      zen_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);

and find the line:

$this->products_ordered_attributes = '';

and change to this :

//-----------$this->products_ordered_attributes = '';
      $this->products_ordered_attributes = "\n\n" . "Product Link: " . zen_get_products_url($this->products[$i]['id']) . "\n\n" . "Product Details: " ;

thats it. works perfect!! :smartalec:

22 Jun 2010, 5:36 AM
#32
bhadz08 avatar

bhadz08

New Zenner

Join Date:
Jun 2009
Posts:
41
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

please remove the unnecessary "**... **"

or this one. sorry for that:

 $sql_data_array = array('orders_id' => $zf_insert_id,
                              'products_id' => zen_get_prid($this->products[$i]['id']),
                              //'products_model' => $this->products[$i]['model'],
                              'products_name' => $this->products[$i]['name'],
                              'products_description' => zen_get_products_description($this->products[$i]['id']),
                              'products_url' => zen_get_products_url($this->products[$i]['id']),
                              'products_price' => $this->products[$i]['price'],
                              'final_price' => $this->products[$i]['final_price'],
                              'onetime_charges' => $this->products[$i]['onetime_charges'],
                              'products_tax' => $this->products[$i]['tax'],
                              'products_quantity' => $this->products[$i]['qty'],
                              'products_priced_by_attribute' => $this->products[$i]['products_priced_by_attribute'],
                              'product_is_free' => $this->products[$i]['product_is_free'],
                              'products_discount_type' => $this->products[$i]['products_discount_type'],
                              'products_discount_type_from' => $this->products[$i]['products_discount_type_from'],
                              'products_prid' => $this->products[$i]['id']);
      zen_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
22 Jun 2010, 7:56 AM
#33
bhadz08 avatar

bhadz08

New Zenner

Join Date:
Jun 2009
Posts:
41
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

ok, i have this one up and running..

maybe someone knows how to make 2 different confirmation emails to admin and customer...

all i want for the admin is having the "Product URL" and for the customer would only be the standard format.

so this way i can automatically forward the confirmation to the printer.

any help is much appreciated..

21 Jul 2010, 8:41 PM
#34
mmwilcox avatar

mmwilcox

New Zenner

Join Date:
Nov 2007
Location:
Huntington, Indiana
Posts:
67
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

golowenow,

I've been wanting to add the product description to our docs for months (everytime the packing lists printed with the meaningless 'model'). I recently found your most thorough walk-through (perfect, i might add) on doing this. Granted, Dr. Byte helped jump start it with the database mod, but your tutorial above was really good.

Thank you for taking the time to document this on-line for others.

Matt

26 Jul 2010, 2:12 AM
#35
bhadz08 avatar

bhadz08

New Zenner

Join Date:
Jun 2009
Posts:
41
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

your welcome.

6 Jun 2011, 9:04 PM
#36
mmwilcox avatar

mmwilcox

New Zenner

Join Date:
Nov 2007
Location:
Huntington, Indiana
Posts:
67
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

I noted a formatting issue with the product description in my i pad emails where the product description will not wrap to the next line.

Eventually, the solution that I implemented was to rem out the <nobr> and </nobr> tags on lines 899 and 901, respectively, of the \includes\classes\order.php file. It fixed the i pad email formatting by allowing the description to wrap. I have not found any unwanted side effects anywhere else...so far.

      //'<nobr>' .
      '<small><em> '. nl2br($this->products_ordered_attributes) .'</em></small>' .
      //'</nobr>' .

Thought I'd put this out there for anyone else to use.

Matt

11 Jan 2012, 6:12 PM
#37
mercurioservice avatar

mercurioservice

New Zenner

Join Date:
Jan 2012
Posts:
2
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

Hi everyone!
I have followed the steps written here below but i have no results:
After i have insert the code mentioned when I click on buy button I have back a blank page. I use Zen-Cart 1.3.9e italian version.
There's anyone that understand what I'm wrong??

Thanks in advanced.

Bye bye

16 Jan 2012, 4:57 PM
#39
mercurioservice avatar

mercurioservice

New Zenner

Join Date:
Jan 2012
Posts:
2
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

Thanks for reply!!! I just made it and it's working!!
Now i have to insert the same field in online order that the customer can see after login. I see that the file maybe is tpl_account_history_info_default.php but i do know the code to insert to show the field 'products_description' .

Thanks in advanced

27 Jun 2014, 5:44 AM
#40
townsend2009 avatar

townsend2009

New Zenner

Join Date:
Nov 2008
Posts:
93
Plugin Contributions:
0

Re: Add Product Description to Invoice/orders/emails ect;

Is there an updated code for V151?