Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2006
    Location
    Washington State
    Posts
    77
    Plugin Contributions
    0

    bug adding product description to emails problem

    Hello again,
    I think only Dr. Byte will have the answer to this.
    The code for adding product descriptions to the invoices/packing slips ect; runs beautifully. I have one slight bug that has developed it seems with the new upgraded version of ZC. The description field is being duplicated after every new item in the NEW ORDER confirmation emails sent to the customer. Here is an example.

    Products
    1 x Cuba Scott #165 mint
    Scott #165 F(gum thins,usual perf faults) MH $0.50

    1 x 1979 Turks and Caicos Islands Scott #386-9 MNH
    Scott #165 F(gum thins,usual perf faults) MH
    Scott #386-9 PAINTINGS FULL SET VF MNH $0.75

    1 x 1985 Tanzania Scott #271-4 MNH
    Scott #165 F(gum thins,usual perf faults) MH
    Scott #386-9 PAINTINGS FULL SET VF MNH
    Scott #271-4 TANZANIA RAILWAYS LOCOMOTIVES
    TRAINS FULL SET VF MNH $1.00

    1 x 1983 Niger Scott #614-21 FULL SET MNH
    Scott #165 F(gum thins,usual perf faults) MH
    Scott #386-9 PAINTINGS FULL SET VF MNH
    Scott #271-4 TANZANIA RAILWAYS LOCOMOTIVES
    TRAINS FULL SET VF MNH
    Scott #614-21 RAPHAEL PAINTINGS FULL SET VF MNH $5.50

    As you can see the descriptions are being duplicated after each new item. This can be quite lengthy...hehe

    It seems that there may be some changes in the includes\classes\orders.php file that may be effecting this? At about line 844 this code is written:

    $this->products_ordered .= $this->products[$i]['qty'] . ' x ' . $this->products[$i]['name'] . ($this->products[$i]['description'] != '' ? ' (' . $this->products[$i]['description'] . ') ' : '') . ' = ' .

    I have changed all "MODEL" to "description" to replace model numbers with the descriptions.
    I do not remember doing this in older versions though on this and other lines below it. Could this be causing the duplication?
    Any advise to this will be greatly appreciated.
    Thank you.
    JLowe

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

    Default Re: adding product description to emails problem

    Never got an answer on this. Would really like to know what is causing this duplication.

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

    Default Re: adding product description to emails problem

    Referencing a prior issue with a link to that discussion is always helpful.

    I think you're referring to this ... ?
    http://www.zen-cart.com/forum/showthread.php?t=42503

    The solution I posted there had nothing to do with the orders.php class. However, that is where your current problem exists.

    You asked:
    includes\classes\orders.php ..... At about line 844 this code is written:
    Code:
    $this->products_ordered .= $this->products[$i]['qty'] . ' x ' . $this->products[$i]['name'] . ($this->products[$i]['description'] != '' ? ' (' . $this->products[$i]['description'] . ') ' : '') . ' = ' .
    Could this be causing the duplication?
    No, that's not "directly" causing the duplication.

    You must have a line earlier that's causing $this->products[$i]['description'] to be concatenated repeatedly, probably with a .=
    .

    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.

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

    Default Re: adding product description to emails problem

    Hello Dr. Byte.
    OK here is the Build output for email notification section in its entire form as I have it written right now. Other than changing the MODEL to DESCRIPTION the only other changes on the ORDERS.PHP file are as per your instructions via this thread
    http://www.zen-cart.com/forum/showpo...2&postcount=10

    Here is the section:

    // build output for email notification
    $this->products_ordered .= $this->products[$i]['qty'] . ' x ' . $this->products[$i]['name'] . ($this->products[$i]['description'] != '' ? ' (' . $this->products[$i]['description'] . ') ' : '') . ' = ' .
    $currencies->display_price($this->products[$i]['final_price'], $this->products[$i]['tax'], $this->products[$i]['qty']) .
    ($this->products[$i]['onetime_charges'] !=0 ? "\n" . TEXT_ONETIME_CHARGES_EMAIL . $currencies->display_price($this->products[$i]['onetime_charges'], $this->products[$i]['tax'], 1) : '') .
    $this->products_ordered_attributes . "\n";
    $this->products_ordered_html .=
    '<tr>' .
    '<td class="product-details" align="right" valign="top" width="30">' . $this->products[$i]['qty'] . '&nbsp;x</td>' .
    '<td class="product-details" valign="top">' . $this->products[$i]['name'] . ($this->products[$i]['description'] != '' ? ' (' . $this->products[$i]['description'] . ') ' : '') . ' = ' .
    '<nobr><small><em> '. $this->products_ordered_attributes .'</em></small></nobr></td>' .
    '<td class="product-details-num" valign="top" align="right">' .
    $currencies->display_price($this->products[$i]['final_price'], $this->products[$i]['tax'], $this->products[$i]['qty']) .
    ($this->products[$i]['onetime_charges'] !=0 ?
    '</td></tr><tr><td class="product-details">' . TEXT_ONETIME_CHARGES_EMAIL . '</td>' .
    '<td>' . $currencies->display_price($this->products[$i]['onetime_charges'], $this->products[$i]['tax'], 1) : '') .
    '</td></tr>';
    }

    Hope we can figure this out as it is the final "bug" in this mod which perhaps I can donate in the near future for others to use. Thank you again Dr.Byte.

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

    Default Re: adding product description to emails problem

    please attach a copy of your /includes/classes/order.php file. Probably best to zip it first.
    .

    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

    Default Re: adding product description to emails problem

    Hello again Dr. Byte.
    Here is the full file zipped with Winzip.
    order.zip

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

    Default Re: adding product description to emails problem

    On line 741 you have this:
    Code:
          $this->products_ordered_attributes .= "\n\t" . zen_get_products_description($this->products[$i]['id']);
    the .= should just be =
    .

    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.

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

    Default Re: adding product description to emails problem

    This last change in code has done the trick! . The duplication has stopped. Am now perfecting the mod instructions so others may use it. Thank you Dr. Byte. You are a genius

  9. #9
    Join Date
    Feb 2007
    Posts
    73
    Plugin Contributions
    0

    Default Re: adding product description to emails problem

    HAs this Mod been completed yet? Just wondering.

    Thanks in Advance.
    RSprinkel

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

    Default Re: adding product description to emails problem

    Having issues with PayPal IPN module. Will post specific code changes in a while. Waiting for possible update for Zencart first.

 

 

Similar Threads

  1. Add Product Description to Invoice/orders/emails ect;
    By golowenow in forum Managing Customers and Orders
    Replies: 40
    Last Post: 8 Nov 2014, 09:13 PM
  2. Adding button to product description
    By rand486 in forum General Questions
    Replies: 5
    Last Post: 16 May 2011, 08:08 PM
  3. Adding MP3 file to Product Description
    By HandcraftedUK in forum General Questions
    Replies: 11
    Last Post: 30 Jan 2008, 05:53 PM

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