Page 1 of 5 123 ... LastLast
Results 1 to 10 of 41
  1. #1
    Join Date
    Jul 2006
    Location
    Washington State
    Posts
    77
    Plugin Contributions
    0

    Add Product Description to Invoice/orders/emails ect;

    I am a stamp dealer and am looking for the code changes needed to add the Products text description to invoices and orders and packing slips ect;. PRODUCTS_DESCRIPTION/PRODUCTS_DESCRIPTION_TEXT is the database table needed. Presently the Zencart only shows the NAME and MODEL and so forth. Would like to add DESCRIPTION after the NAME column on these. Text descriptions show pertinant information on condition of stamps flaws, types, ect;.
    Here is example:
    Present:
    NAME MODEL PRICE
    Scott#34 - .50

    Would like this:
    NAME DESCRIPTION MODEL PRICE
    Scott#34 F/VF MINT - .50

    Any help with getting the proper PHP pages to change this and the code to put into them would GREATLY be appreciated. Believe this may help many other merchants in the future as well. This ZENCART is a masterpiece!
    BEST!
    John
    http://golowesstamps.com
    Cart not live....YET! Will be soon linked to "SALES" links.

  2. #2
    Join Date
    Mar 2006
    Location
    Australia
    Posts
    289
    Plugin Contributions
    3

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

    Hi there
    Have a look at invoice.php and orders.php

  3. #3
    Join Date
    Jul 2006
    Location
    Washington State
    Posts
    77
    Plugin Contributions
    0

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

    These are in the admin folder correct? Have looked but still do not understand what to do. I know I need to add a couple of lines of code to them but am not sure what/how. Advise greatly appreciated.

  4. #4
    Join Date
    Jul 2006
    Location
    Washington State
    Posts
    77
    Plugin Contributions
    0

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

    Went into the Admin section. Found 2 invoice.php files. One is
    ADMIN/INVOICE.PHP
    The other I found in
    ADMIN/INCLUDES/LANGUAGES/ENGLISH/INVOICE.PHP
    I added the following line in the "define" section of the ENGLISH file:

    define('TABLE_HEADING_PRODUCTS_DESCRIPTION', 'Description');

    Then added the following line to the td class list in the ADMIN file before the "Model" class:

    <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_DESCRIPTION; ?></td>

    This put "description" perfectly in the title row on the invoices.

    I then researched into accessing the text data needed and to my dismay I see there is no PRODUCTS_DESCRIPTION table under the ORDERS_PRODUCTS section in the MySQL Database...thus I cannot call the description. It appears to be more complex than I thought to do this modification. The processes used when a customer orders a product need to be changed so that the database places the "TEXT" description into another table in the ORDERS_PRODUCTS CATEGORY of the MySQL database and then we can call it to be shown on invoices/orders/ect;

    Any advise and/or help with this would be greatly appreciated.
    Best regards.
    John(golowenow)

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

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

    There are a few ways to do this.

    First a comment: For shopowners who use the products-description field to show detailed, colorful, lengthy details about their products, this would be a bad idea. You don't want a 1/2 screen of information coming up under each product ... you'd annoy more customers than you'd please.
    However, in the case of your stamp store, you likely only need a small amount of information and likely rely more on images than text. Thus, perhaps the products-description content could be sufficient.

    Possible approaches:
    1. Use READONLY attributes to describe the components. This is ideal if there are common things that can be attributed to these products. It's not ideal for one-off details.

    2. Add a custom field to the product which is editable in the admin area when entering/editing products, and is optionally displayed in the shop. It would be primarily used for displaying order details on invoice/packing-slip etc.
    You would have to modify the order class to populate the orders_products.details field from the products_description.details field when the order is placed. The order class also sends the order-confirmation email, so would have to accomodate this as well. The invoice/packing-slip would need to pull the info for display too.

    3. Build information into the products_name. However, this is by default limited to 100 characters. This may not produce the desired visual. You could override the long name using per-product-metatags settings and set an override title for the product for more pleasant title display in browser and search engines.

    4. You could extend the orders_products.products_name field to much longer and then tell the order class to append the description to the name, up to a maximum of XX characters total. You'd need to do some special coding to handle the insertion of a suitable line-break character (emails vs browser issues) or other separator notation, and pull the description from the database (ie: zen_get products_description($products_id), etc).


    I think #4 is likely the least overall work but may produce some odd results in reports, etc.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Jul 2006
    Location
    Washington State
    Posts
    77
    Plugin Contributions
    0

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

    Thank you DrByte for this information! The 4th option is the key. I am pretty confused as to how to do this though. There are several order classes so do not know which to edit. Am not to concerned with reports ect; because the descriptions will not be very long at all. most would be like

    Scott #1113-34 VF MNH(1115 has a small crease)

    Temember I only want to pull
    PRODUCT_DESCRIPTION/PRODUCT_DESCRIPTION (TEXT)
    No images ect;

    I looked into the data base and the ORDER_PRODUCTS/PRODUCTS_NAME field is set at VARCHAR 64.
    Would I change it to say 150?

    I am not very good with PHP code. Most I copy and paste into apropriate areas. Could you please leave some examples I can insert and play aroud with? The breaking point issue really has me stumped. Also PRODUCT_DESCRIPTION($PRODUCT_ID).

    Really appreciate your time in this DrByte. I rhink this thread will help others with similar issues like mine. I sell stamps individually, not in bulk and my site is designed to be the most honest and descriptive on the web. Most I sell have no faults thus a DESCRIPTION noted on invoices, ect; looks like this:

    NAME:!970 Cayman Island 1113-34 FULL SET DESCRIPTION: Scott #1113-34 VF MNH

    BUT some require additional Descriptive content that needs to be printed out on invoices ect; to guarantee the invoice is accurate to protect me when someone purchases a single or set WITH a fault.

    I presently have PayPal shopping cart buttons that I put this into. It requires I type these descriptions twice(one for the page and one for the button) Zencart among MANY other things will solve that problem if I can get this one issue resolved.

    Once again, thank you for your responses to my issue.

  7. #7
    Join Date
    Jul 2006
    Location
    Washington State
    Posts
    77
    Plugin Contributions
    0

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

    OK, I am starting to get a grasp on this issue. I changed the Headings for "MODEL" to "DESCRIPTION" which positions everything perfectly. Before the "TAX" amount ect; were positioning under the headings in the wrong areas ie; tax was under model, price was under tax ect;.
    In my case I do not use "MODEL" numbers so this field is not needed on invoices ect;.

    I have created a new field in the ORDERS_PRODUCTS table called PRODUCTS_DESCRIPTION.

    What I need to know is WHERE/HOW when one places an order and/or adds to the cart a product.....WHAT file copies the said products information from the PRODUCTS table to the ORDERS_PRODUCTS table.Also need to know the line numbers in that file that do this. I use HTML kit to edit pages.

    I need to know the exact code to include transferring ONLY the PRODUCTS_DESCRIPTION("table")PRODUCTS_DESCRIPTION("field" text only) to ORDERS_PRODUCTS/(the new field)PRODUCTS_DESCRIPTION.

    Then I can change in invoice.php ect; instead of calling the "MODEL" field....call the "DESCRIPTION" field instead.

    Hopefully this description is more understandable of what I am trying to do. REALLY appreciate the help on this. Once I have this modification I can go live with Zencart at any time.

    P.S. Please do not take any offense to Capitalization and colors as I am only trying to make things clear, hehe I am NOT yelling.

  8. #8
    Join Date
    Jul 2006
    Location
    Washington State
    Posts
    77
    Plugin Contributions
    0

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

    Tinkered with the order.php class page in the INCLUDES folder again and actually got the thing to change the row in the database but still no text being populated into the products_description field in orders_products table. I am so close I can taste it! Gave up again tonight though. I don't have a lot of time to do this as I work and drive about 13 hours a day. Hopefully tommorrow night there will be a response to this. Thank you in advance for any help to my little dilema

  9. #9
    Join Date
    Jul 2006
    Location
    Washington State
    Posts
    77
    Plugin Contributions
    0

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

    OK I am totally confused. This seems to really be a simple process but I cannot figure out where the ORDER_PRODUCTS TABLE is being populated from... Like stated above I created a new FIELD called PRODUCTS_DESCRIPTION in the ORDER_PRODUCTS TABLE. We need to populate it at the same time that the PRODUCT_ID, PRODUCT_MODEL, ect; ect; is being populated into the ORDER_PRODUCTS TABLE during either when the customer ADDS a product or in the CHECK-OUT phase. I do not know when nor where this population is being activated. Once this new field is populated from PRODUCTS_DESCRIPTION/PRODUCTS_DESCRIPTION<-----this is the TEXT ONLY fieldno images,ect;....we can call this new field into INVOICES/PACKING SLIPS/EMAILS very easily!

    PLEASE PLEASE can anyone define where the code is that does this transfer of fields and present some lines of code to add to the new field? Judging by the number of views on this topic there are a lot of Zenners out there looking for answers on this. Thank you for any help on this

  10. #10
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

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

    Perhaps you may consider a friendly donation to the Zen Cart project for taking the time to come up with the answer for you:

    includes/classes/order.php
    line 692 has:
    PHP Code:
          $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_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); 
    change that to:
    PHP Code:
          $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); 
    And add an additional field in your orders_products table:
    Code:
    alter table orders_products add column products_description text NOT NULL;
    Now you can use the contents of that field in your invoice/packing-slip in the Admin.

    To include the info on your order-confirmation emails:
    includes/classes/order.php
    around line 718 you have:
    PHP Code:
          $this->products_ordered_attributes ''
    change to:
    PHP Code:
          $this->products_ordered_attributes .= "\n\t" zen_get_products_description($this->products[$i]['id']); 
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 5 123 ... LastLast

Similar Threads

  1. Add Product Image into orders emails
    By marknew in forum Managing Customers and Orders
    Replies: 1
    Last Post: 7 Oct 2010, 02:26 AM
  2. Order Invoice - Product Description
    By Failed_Attempt in forum Managing Customers and Orders
    Replies: 15
    Last Post: 8 Sep 2010, 04:41 PM
  3. Looking to add print invoice and shipp invoice from admin---> orders
    By r4fdud in forum Upgrading from 1.3.x to 1.3.9
    Replies: 0
    Last Post: 15 Mar 2009, 11:21 PM
  4. adding product description to emails problem
    By golowenow in forum Managing Customers and Orders
    Replies: 9
    Last Post: 24 Apr 2007, 02:54 AM
  5. Add Product Description to Orders
    By DiZZ in forum General Questions
    Replies: 1
    Last Post: 8 Nov 2006, 04:08 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR