Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Mar 2005
    Posts
    65
    Plugin Contributions
    0

    help question Custom email per product post-purchase

    I have a client that sells complex products. The cart needs to send, by email (not make available for download), an information packet upon completion of purchase. Look at http://tinyurl.com/4yr9n2l for the production example (side note - we tried using attributes to do the item variations but were not happy with the complexity from the customerś viewpoint).

    This packet will differ depending on the item ordered.

    I am designing a modification that would parse $this->products to use the (unused at this client's site) model number field to trigger the sending of the email, on the send_order_email function (...classes/order.php) sot that, for instance, if the field for an item contains "PKT20011201", the function would send an email to the customer with PKT20111201.pdf as an attachment. And use a new table to keep track of what order resulted in what packet(s) have been sent.

    Anybody have a better way?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Custom email per product post-purchase

    As far as sending the emails, that's the same approach I'd likely take.
    Your code would be somewhat more portable if you were to hook the NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL notifier point and write a custom observer class to do all your notifications. That way you're not editing core code files, and your upgrades will be potentially simpler down the road.
    .

    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.

  3. #3
    Join Date
    Mar 2005
    Posts
    65
    Plugin Contributions
    0

    Default Re: Custom email per product post-purchase

    TY for the quick response.

    Quote Originally Posted by DrByte View Post
    Your code would be somewhat more portable if you were to hook the NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL notifier point and write a custom observer class to do all your notifications. That way you're not editing core code files, and your upgrades will be potentially simpler down the road.
    I understand and this is yet another reason I wish I had not just dived into hacking mode 6 years ago.

    1. Assuming that 1.4 is dead (I do), does the same hook structure exist in 1.5 and wiil it in 2.x. Since I expect to be using one and/or the other before too many more years are gone, I want to make sure learning the current "hooking" will be an investment. In any case, what is the best current doc/tutorial/example for use of notifier points in zencart?

    2. This particular site is so modified (fortunately, well documented) that it is too late to make upgrading anything but tedious. Also, I already have mods to this class file so I am not shy about making more :)

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Custom email per product post-purchase

    There are many free addons that use observer/notifier hooks to do everything.
    Some documentation here: http://www.zen-cart.com/wiki/index.p...Observer_Class

    Some terms you might search the forum for include:
    sendGroupOrderNotices
    emailFor404
    .

    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.

  5. #5
    Join Date
    Mar 2005
    Posts
    65
    Plugin Contributions
    0

    Idea or Suggestion Re: Custom email per product post-purchase

    Quote Originally Posted by DrByte View Post
    hook the NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL notifier point
    I assume you meant NOTIFY_CHECKOUT_PROCESS_AFTER_SEND_ORDER_EMAIL?


    This looks very promising. TY for the pointer. One tricky part (seems to me) is getting the auto-load order right.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Custom email per product post-purchase

    No, I meant NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL.
    But your selection might work fine too.

    As for auto-load order, I'm not sure about what you really mean.
    You can load your stuff anytime after the normal stuff loads. Start at 200 and adjust if needed (unlikely).
    .

    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.

  7. #7
    Join Date
    Mar 2005
    Posts
    65
    Plugin Contributions
    0

    Default Re: Custom email per product post-purchase

    Quote Originally Posted by DrByte View Post
    No, I meant NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL.
    But your selection might work fine too.

    As for auto-load order, I'm not sure about what you really mean.
    You can load your stuff anytime after the normal stuff loads. Start at 200 and adjust if needed (unlikely).
    Re NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL: I just found the correct notify point in 1.3.9 - I guess it wasn't there in 1.3.7 when the doc was written. My most sincere apologies for doubting you :)

    BTW, in an interrupt-rich system, choosing the best point for inserting a custom handler can be an art. Sometimes it boils down to semantics. I suspect both notifies are occurring at almost the same logical point :)

    Re autoload order: The tutorial teaches some more precise loading order. I did think that, in my case, it didn't matter - I am happy to load last.
    Last edited by brandon; 12 Oct 2011 at 06:40 PM. Reason: I am finick about wording...

 

 

Similar Threads

  1. v153 Post custom product from 3rd party to Cart
    By Matt Staines in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 22 Sep 2014, 03:32 PM
  2. v151 Discount coupon offered on second purchase (per product)
    By sports guy in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 6 Mar 2013, 01:44 AM
  3. How can I set up post-sales autoresponders per product?
    By dawnlia in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 7 Aug 2012, 09:44 PM
  4. Minimum Product Count for purchase per subcategory
    By yinyang in forum Managing Customers and Orders
    Replies: 1
    Last Post: 20 Apr 2008, 10:15 PM
  5. [Newbie] Possible to Offer Custom Email Response After Product Purchase?
    By Anthony_Baker in forum Managing Customers and Orders
    Replies: 3
    Last Post: 28 Jul 2006, 01:33 AM

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