Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2012
    Posts
    26
    Plugin Contributions
    0

    bug Order email editing question

    PLEASE, do not move this post. My other post about this got taken down a dead end. Moving it only buries it deeper.

    I have followed ALL of the tutorials and forum post on this site and others but I believe that the ability to edit the order.php file with additional features is simply broken in Zen-Cart v1.5

    No matter what variable(s) I add to the order.php file nothing ever changes in my emails (plain text or html). It's like this feature is being ignored somewhere.

    I have tried the following on two completely separate installs of Zencart v1.5 with two separate hosting companies. The second being a completely fresh install with no mods, additional templates, plug-ins, etc.

    I have replaced line 895 in order.php from this:

    $this->products_ordered_attributes .= $custom_insertable_text;

    to this:
    $this->products_ordered_attributes .= $EMAIL_INTRO;

    and even tried this:
    $this->products_ordered_attributes .= $custom_insertable_text;$EMAIL_INTRO;

    AND tried MANY other variables found here: http://www.zen-cart.com/content.php?...te-system-work
    I even defined some of my own in email_extras.php NOTHING ever shows up on the email!

    I have tried the following:
    Use MIME HTML When Sending Emails to: True and False
    Email types of: PHP, SMTPAUTH (SMTP is also not working but that's another post)
    Set Admin emails to TEXT and HTML

    NOTHING works as described in the tutorials or forums.

    Can one of the devs PLEASE simply confirm or deny that it is broken? If it's me OK, I'll keep digging (hopefully with some more hints on what to try next) but if it's broken at least I can let my client know.

    Thank you!

  2. #2
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    831
    Plugin Contributions
    6

    Default Re: Order email editing bug

    Maybe it's just me being stupid (again), but can you clarify the situation at hand, please? Is this the original thread? http://www.zen-cart.com/showthread.p...ting&p=1119911

    If so, and IF I understand correctly, you're just trying to get the admin email to have some formatting like you require it, nothing else? Please correct me if I'm mistaking.
    What I've done lately: AMCS | Goatee Saver | JonaMaria | LBB Adult Shop | Finntimo
    Zen Cart with Layered Navigation? Sure: DQT
    My site - Pro ZC Help | My portfolio

  3. #3
    Join Date
    Mar 2012
    Posts
    26
    Plugin Contributions
    0

    Default Re: Order email editing bug

    Quote Originally Posted by balihr View Post
    Maybe it's just me being stupid (again), but can you clarify the situation at hand, please? Is this the original thread? http://www.zen-cart.com/showthread.p...ting&p=1119911

    If so, and IF I understand correctly, you're just trying to get the admin email to have some formatting like you require it, nothing else? Please correct me if I'm mistaking.
    I really don't think it's you. :) Here's what I'd like to do if possible.

    1. Order email to customer can stay as-is in HTML format. (But I'm even having trouble getting that email to show up in HTML format. If I turn on HTML for admin, the admin email appears in HTML but the customer emails still only show in plain text.)

    2. Email to admin with order info to be in TEXT only format. BUT, I need to rearrange the fields and add some of my own field title variables so it looks something like this:

    Order Date: April 11, 2012 14:48:01
    first: Joe
    last: smith
    addr1: 123 Any Street
    addr2: Apt 6A
    city: Philadelphia
    etc.
    etc.

    If I could just get it started I know I could muddle my way through it and get it close enough to what my client needs.

    (The reason I need it this is that my client has a prebuilt system that looks for certain fields in a certain order and then checks to see if the product requires a software license key and if so, it emails it to the customer. Zencart 1.5 has no working plugins for this and I don't have the time or skill set to either write a new one or fix the one that works in older versions. Yes, there are forum posts about doing but they all seem to refer to each other with no solution provided. I also haven't seen any commercial plugins that do this either.)

    Any guidance would be greatly appreciated.

  4. #4
    Join Date
    Jan 2004
    Posts
    60,302
    Blog Entries
    4
    Plugin Contributions
    51

    Default Re: Order email editing bug

    There's no "Zen Cart Order email editing bug" here at all. It's user error on your end.

    I'm rather frustrated by the multitude of different threads you're starting on the same matter. It is indeed the same matter.

    And your "problem" is that you're using empty variables to add to other variables, and that just won't work.

    I was hoping to actually sit down and write a complete working set of code for you, but I've been a little busy with the migration of this support forum to a new version and haven't had the time to write code for you. And now all these new threads and posts have just kinda rubbed me the wrong way, making me feel much less interested in writing the complete solution for you.

    A few things you need to learn before you can write the code you're trying:

    a) $EMAIL_INTRO does NOT exist as a PHP variable anywhere. You're trying to use something that's a syntax tool for email replacements, and that only works INSIDE the HTML email templates. So, any of those $EMAIL_FOO things is useless because they don't exist.
    ie: $this->products_ordered_attributes .= $EMAIL_INTRO;
    Since $EMAIL_INTRO isn't a variable that even exists, the $this->products_ordered_attributes gets nothing added to it.

    b) The variable that you need is $this->customer ... which is an array of several components which you'll need to add separately, along with the text prefixes that you have mentioned. And then you'll need to add the appropriate $this->products['id'] as well, and probably the appropriate attribute value.

    c) And doing all this inside the order class is just going to make your life difficult when it comes time to upgrade versions. That's why I strongly recommend using the observer/notifier system as discussed in your other thread which you so vehemently seem to want to abandon.

    Putting the business logic for all the processing of this into an observer class will not only keep all the code much cleaner, but will also result in a better end-user/customer experience since they'll get one email with all the relevant details, not multiple separate emails which they have to wade through, understand, file, etc. And also minimizes the amount of needless outgoing email hits which also helps prevent your email server from getting blacklisted for sending too much stuff especially if it comes from an unauthenticated source which I suspect your parsing script does.

    The observer would pull in the order's info from variables that it has available, it would give you the current product and attribute which you could then pass to your licensing system to look up the code that needs to be supplied to the customer, and then that code is used by the observer class to send back the appropriate license key string to show up on the order-confirmation email. The additional benefit to all this is that the license key/code is then also stored in your store's Admin screen directly in the customer's order details, and also available to the customer in their My Account section where they can access all their order history and download the virtual products to which the license key (shown right next to the download link) applies.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    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.



  5. #5
    Join Date
    Mar 2012
    Posts
    26
    Plugin Contributions
    0

    Default Re: Order email editing bug (NOT A BUG)

    Thank you DrByte! I'm sorry if I rubbed you the wrong way as that was not my intent. Personally, I would much rather do it the right way and have a plugin or some other system within ZenCart handle the license keys issues. But my client is very impatient at this point (which I apologize for passing that along in the form of my multiple posts).

    I truly appreciate the help of you, the many others in the forums and those who write the tutorials (and of course the entire ZenCart team). As far as I'm concerned, ZenCart is a brilliant ecommerce platform.

    With your latest response I now have a fresh starting point. I fully understand agree with you as why this is not the preferred method but at this point I'm under a deadline. I'm hoping after the site is launched that I can spend a little more time on alternate solution.

    Once again, that's for your help and apologies for my impatiences.

  6. #6
    Join Date
    Jan 2004
    Posts
    60,302
    Blog Entries
    4
    Plugin Contributions
    51

    Default Re: Order email editing bug (NOT A BUG)

    I'll try to post something on Thursday or Friday.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    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.



  7. #7
    Join Date
    Mar 2012
    Posts
    26
    Plugin Contributions
    0

    Default Re: Order email editing bug (NOT A BUG)

    Thanks again!

  8. #8
    Join Date
    Jan 2004
    Posts
    60,302
    Blog Entries
    4
    Plugin Contributions
    51

    Default Re: Order email editing bug (NOT A BUG)

    You said the "prebuilt system" takes a bunch of inputs from an email and "checks to see if a license key is needed, and emails it".

    Is it possible to extract just the "checks to see if a license key is needed" logic from that system? What "inputs" does it take? ie: can it work based on the Zen Cart product ID and attribute ID numbers?
    Is it necessary to give that other system all the purchaser's information too? or is it enough just to pick/generate a key and have it sent?

    Also, how often do customers in *this* store order more than one item requiring a serial number?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    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.



  9. #9
    Join Date
    Mar 2012
    Posts
    26
    Plugin Contributions
    0

    Default Re: Order email editing bug (NOT A BUG)

    Quote Originally Posted by DrByte View Post
    You said the "prebuilt system" takes a bunch of inputs from an email and "checks to see if a license key is needed, and emails it".

    Is it possible to extract just the "checks to see if a license key is needed" logic from that system? What "inputs" does it take? ie: can it work based on the Zen Cart product ID and attribute ID numbers?
    Is it necessary to give that other system all the purchaser's information too? or is it enough just to pick/generate a key and have it sent?
    All good questions. I do not have access at this time to the system as my client is out of town. But here is my understanding of how it works:
    Originally it would gather all of the data from the email order (this is a really old hand-built system) and enter that data into a customer database. Then it would check and see if the product required a key and then it would send out the link and the key. That same database was then used for order management.

    I'd really like to talk my client out of doing it this way as zencart does such a beautiful job of gathering and storing customer and order info as well as order management. I still agree that figuring out how to let zencart generate (or simply distribute) the keys would be the far better alternative.

    I did finally figure out how to edit the order.php file to make it look like he wants so I bought some time there. It's not pretty but it works and also has the issue of customers who choose to receive text only emails will get the really ugly one.

    Thanks!
    David

 

 

Similar Threads

  1. v150 Order confirmation email editing
    By Daviator in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 20 Apr 2012, 08:51 PM
  2. Editing Order Confirmation Email
    By JGiacchi in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Mar 2009, 11:16 PM
  3. Editing order confirmation email
    By KTNaturals in forum General Questions
    Replies: 6
    Last Post: 10 Feb 2008, 04:57 AM
  4. Editing email order confirmation
    By chronister in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 30 Nov 2007, 03:43 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
  •