Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 34
  1. #21
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Customizing confirmation e-mail

    Actually, since $custom_insertable_text is not added to the output in stock order.php (merely suggested that it could be added by editing order.php), I decided to drop it and use another, purely internal to the update, variable ($tag_formatted) to accumulate the text and (try to) append it to the attributes text.

    Checking 'products_prid", I see that it is in the orders_products_attributes table as (for example) 18:fb94464ad775ca11c76ad2eef8eafc88, and there does not appear to be another usable reference to the product id in that table. Casting it to an integer (which I have done) should take care of it, and 18 is in the list of desired product ids.

    For breakpoints, config.orderTagBuilder.php was operating, as when it was first uploaded it caused orderTagBuilder.php to be loaded and choke on the syntax errors, but when disabled by renaming to .bak, orderTagBuilder.php was ignored. Could there be a downside to loading orderTagBuilder at 0 instead of 10? What is the highest breakpoint you have ever seen used in stock ZC? Where does order.php get loaded? I couldn't find any mention of it in autoloaders. Does that mean that some code elsewhere tells it to load, at a place after all breakpoints? Perhaps in a page header? I'll look.

    If v1.5.0 really doesn't support modifiable parameters, I'm dead in the water and what I am doing can never work. The calling notifier includes passing the $sql_data_array parameter as if it should be modifiable, and if it isn't that is cruelly misleading. I may have to recast this code as edits directly in order.php.

  2. #22
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Customizing confirmation e-mail

    Update to the above:

    Maybe v1.5.0 doesn't support modifiable parameters. But $class->products_ordered_attributes is not a parameter and ought to be accessible, though. I don't actually try to modify $sql_data_array in my code, just read it.

  3. #23
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Customizing confirmation e-mail

    I find that /includes/modules/pages/checkout_process/header_php.php calls /includes/modules/checkout_process.php, which has on line 55:

    require(DIR_WS_CLASSES . 'order.php');
    $order = new order;

    Now how do I instantiate my class just after that? There's a notifier shortly after that on line 66:

    $zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_BEFORE_ORDER_TOTALS_PRE_CONFIRMATION_CHECK');

    Is there a way to use that to instantiate orderTagBuilder.php and attach it to order.php? Would the instantiation code from the config file work in a file called from this notifier? If so, how?

  4. #24
    Join Date
    Jul 2012
    Posts
    16,445
    Plugin Contributions
    17

    Default Re: Customizing confirmation e-mail

    Quote Originally Posted by gjh42 View Post
    Actually, since $custom_insertable_text is not added to the output in stock order.php (merely suggested that it could be added by editing order.php), I decided to drop it and use another, purely internal to the update, variable ($tag_formatted) to accumulate the text and (try to) append it to the attributes text.

    Checking 'products_prid", I see that it is in the orders_products_attributes table as (for example) 18:fb94464ad775ca11c76ad2eef8eafc88, and there does not appear to be another usable reference to the product id in that table. Casting it to an integer (which I have done) should take care of it, and 18 is in the list of desired product ids.

    For breakpoints, config.orderTagBuilder.php was operating, as when it was first uploaded it caused orderTagBuilder.php to be loaded and choke on the syntax errors, but when disabled by renaming to .bak, orderTagBuilder.php was ignored. Could there be a downside to loading orderTagBuilder at 0 instead of 10? What is the highest breakpoint you have ever seen used in stock ZC? Where does order.php get loaded? I couldn't find any mention of it in autoloaders. Does that mean that some code elsewhere tells it to load, at a place after all breakpoints? Perhaps in a page header? I'll look.

    If v1.5.0 really doesn't support modifiable parameters, I'm dead in the water and what I am doing can never work. The calling notifier includes passing the $sql_data_array parameter as if it should be modifiable, and if it isn't that is cruelly misleading. I may have to recast this code as edits directly in order.php.
    Hold on there buckaroo... first things first. The lack of $custom_editable_text from being directly modifiable does not cause any problems. If you notice, no matter what variable is used within your observer, the result is to be assigned to the class' variable. That is modifiable (mutable). So, the text that is being generated in your observer will get appended to $this->products_ordered_attributes (using $class->products_ordered_attributes) if executed.

    As to execution break points, the current highest breakpoint used in ZC 1.5.5 is 180 to load the init_header file. Suggestion in the includes/auto_loader/config.core.php file is for most plugin's to use 200 or higher. For the user tracking plugin, I think I set it at 999 for no particular reason, but it was high enough to not be in the way of anything else. The breakpoint of 0 has seemed appropriate for the purpose of just getting the class(es) out there and ready to do what is needed/asked of them. It is for the most part where other classes are defined though in newer ZC installations, the first class load could automatically occur at breakpoint 175 which for the most part/most plugin's is fine as the observer likely needs to use data that has already been established and is not trying to modify or take the place of other code that is loaded between 0 and 175.

    Now as for includes/classes/order.php not having a breakpoint... well, just because it has conveniently been made a class, doesn't mean that it should be loaded all the time or that it needs to load before being called or that it itself is listening for other actions. Meaning, it doesn't need to have a breakpoint and will be pulled into the code when/where it is needed. Ie. Includes/modules/pages/checkout_shipping/header_php.php for example. The order class is used here, but it isn't needed say in contact_us, or on the main page, that is unless something else is using it to display/obtain/etc information related to orders that can not be collected directly from the database.

    So, no, not going to find a load point for the order class. It will be called either as needed by other load points or upon completion of all auto_loaders and other code to be loaded as determined by the code being loaded/the flow of index.php and all of the sub-routines.

    What is important to know/realize is that anytime the code within the order class function of create_add_products is called, your code should also be called.

    Now, you brought up a little while ago about reverting back to $zco_notifier-> instead of $this->. Again, I suggest trying it as the only code change since the last attempt and seeing if it works now or not. In ZC 1.5.1 it hasn't been necessary when the observer class extends base like your code does.

    In somewhat closing, I want to revisit the "modifiable parameters" aspect. For a long time, ZC had offered the class, the notifier, and anything considered to be important to be used at that point to be passed to the observer class. The thing was, the only modifiable piece of data that was incorporated up to ZC 1.5.3 (1.5.2 first had some more of this, but it wasn't released for production) was the class itself. So if a class had a variable ($class->products_ordered_attributes) then that variable could be directly edited from within the observer. Any other "data" had to be sort of manipulated to maybe be included where needed/wanted possibly by holding the data for a while ($_SESSION) and inserting it elsewhere or by use of global to share the data back to the area that was in the global space. A header is in the global space, so you can get and modify anything that is provided to or from a header. Modules tend to be the same, but some modules are incorporated within some other compartmentalized code and if the module doesn't specifically make the variable global, then there is the possibility that it's data is unreachable in older versions of ZC. That all depends on how the code is used/incorporated and what the needs are.

    Anyways, I wouldn't go bizerk yet about this plugin and the older version of ZC. That's not the problem.

    I do see that if someone were to receive a text version of the email that they will get html code because of the strong, the breaks that are used, etc... but that's a different issue as well...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #25
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Customizing confirmation e-mail

    From "require(DIR_WS_CLASSES . 'order.php');" it is obvious that there will not be an autoload breakpoint for the order class; the question is how to instantiate orderTagBuilder.php in a way that it attaches to the order class. It seems like this can't be done until after the order class is instantiated. Can I use the notifier mentioned to activate it in some way, or will a super-high breakpoint that instantiates orderTagBuilder.php allow it to come after the order class is active (if it is)? If the order class never activates, my class can sit there with nothing to do without harming anything or taking up (much) processing time, right? Ideally I'd like to instantiate orderTagBuilder.php only if the order class is active.

    The last line in config.base.php is
    PHP Code:
      $autoLoadConfig[180][] = array('autoType'=>'init_script',
                                     
    'loadFile'=> 'init_header.php');
    ?> 
    Would a class referenced in another config file with a breakpoint of 180 fire after this, or would 190 be needed to reliably do so? I'll try 200 anyway. My copy of config.core.php doesn't say anything about mod breakpoint setup.

    The mention of non-modifiable parameters threw me for a few minutes, until I realized that it never had anything to do with what I was trying to do, but I didn't have enough time left to modify my original question.

    I have refactored my code after study of order.php for better output, changed the breakpoint to 200, tried using the zco_notifier version of the update, and I still get no result. My current orderTagBuilder.php:
    PHP Code:
    class orderTagBuilder extends base {
      public 
    $tag_info = array();
      public 
    $tag_qty 0;
      public 
    $tags_text '';
      public 
    $tags_html '';
      
      function 
    __construct() {
        
    //$this->attach($this, array('NOTIFY_ORDER_DURING_CREATE_ADDED_ATTRIBUTE_LINE_ITEM','NOTIFY_ORDER_DURING_CREATE_ADD_PRODUCTS','NOTIFY_ORDER_INVOICE_CONTENT_READY_TO_SEND'));
        
    global $zco_notifier;//alternate version of constructor
        
    $zco_notifier->attach($this, array('NOTIFY_ORDER_DURING_CREATE_ADDED_ATTRIBUTE_LINE_ITEM','NOTIFY_ORDER_DURING_CREATE_ADD_PRODUCTS','NOTIFY_ORDER_INVOICE_CONTENT_READY_TO_SEND'));
        
    //--------------------------^--to build tag info-----------------------------------^--to add tag text to content
      
    }
      
      function 
    update(&$class$eventID$paramsArray) {//$sql_data_array is loaded into $paramsArray
        //if(!isset($this->tag_qty)) $this->tag_qty = 0;
        
    if($eventID == 'NOTIFY_ORDER_DURING_CREATE_ADDED_ATTRIBUTE_LINE_ITEM') {
          if(
    in_array((int)$paramsArray['products_prid'], array(7,15,17,18,24,25))) {//process tag info
            
    if($paramsArray['products_options'] == 'Name') {
              
    $this->tag_info[$this->tag_qty] .= '<br /><strong>-----------------------------------<br />' $paramsArray['products_options_values'] . '</strong><br />';
              
    $this->tag_qty++;
            }
            if(
    in_array($paramsArray['products_options'], array('Dates','Onsite phone','Vehicle','Zone preference'))) {
              
    $this->tag_info[$this->tag_qty] .= $paramsArray['products_options'] . ': <strong>' $paramsArray['products_options_values'] . '</strong><br />';
            }
          }
        }
    //end build tag info

        
    if ($eventID == 'NOTIFY_ORDER_DURING_CREATE_ADD_PRODUCTS') {
          if(
    /*is_array ????????*/ !empty($this->tag_info)) {//add tags if they exist
            
    foreach($this->tag_info as $tag_qty_out=>$tag_text) {
              
    $this->tags_text .= '


    PLEASE PRINT THIS E-MAIL AND BRING IT WITH YOU FOR USE AS CAR AND TENT TAGS.


    '
    ;
              
    $this->tags_html .= '<br /><br /><br />PLEASE PRINT THIS E-MAIL AND BRING IT WITH YOU FOR USE AS CAR AND TENT TAGS.<br /><br /><br />';
              if(
    strpos($tag_text,'Vehicle') !== false) {//add car tag
                
    $this->tags_text .= '
                

    ------------------------------------------
    CAR TAG
    $tag_text '


    '
    ;
                
    $this->tags_html .= '<br /><br /><br /><h2><strong>------------------------------------------<br />CAR TAG</strong></h2><br />' $tag_text '<br /><br /><br />';
              }
              
    //add tent tag
              
    $this->tags_text .= '


    ------------------------------------------
    TENT TAG
    $tag_text '


    '
    ;
              
    $this->tags_html .= '<h2><strong>------------------------------------------<br />TENT TAG</strong></h2><br />' $tag_text '<br /><br /><br />';
            }
          }
        }
    //end create tag text

        
    if ($eventID == 'NOTIFY_ORDER_AFTER_ORDER_CREATE_ADD_PRODUCTS') {//attach welcome letter @ line 887
          
    $class->products_ordered .= 
    Tag text attaches here.
    $this->tags_text;
          
    $class->products_ordered_html .= '<br />Tag HTML attaches here.<br />' $this->tags_html;
          
    $class->products_ordered .= ' Camper welcome letter text attaches here. ';//CAMPER_WELCOME_LETTER;//todo - define a constant containing the welcome text (text version)
          
    $class->products_ordered_html .= ' Camper welcome letter HTML attaches here. ';//CAMPER_WELCOME_LETTER;//todo - define a constant containing the welcome text (HTML version)
          
    unset ($this->tag_info$this->tag_qty$tag_qty_out$tag_text$this->tags_text$this->tags_html);//in case the customer wants to make another order
        
    }//end add tags & welcome to content
        
    $class->products_ordered_attributes .=  ' <br />testing text output - method run.<br /> ';//debug
      
    }// /update
    }
    //eof 

  6. #26
    Join Date
    Jul 2012
    Posts
    16,445
    Plugin Contributions
    17

    Default Re: Customizing confirmation e-mail

    Quote Originally Posted by gjh42 View Post
    Update to the above:

    Maybe v1.5.0 doesn't support modifiable parameters. But $class->products_ordered_attributes is not a parameter and ought to be accessible, though. I don't actually try to modify $sql_data_array in my code, just read it.
    Sure would have been nice to have been able to see this one before writing my previous message. :) But, hope the information helped clarify a few things anyways.

    Quote Originally Posted by gjh42 View Post
    I find that /includes/modules/pages/checkout_process/header_php.php calls /includes/modules/checkout_process.php, which has on line 55:

    require(DIR_WS_CLASSES . 'order.php');
    $order = new order;

    Now how do I instantiate my class just after that? There's a notifier shortly after that on line 66:

    $zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_BEFORE_ORDER_TOTALS_PRE_CONFIRMATION_CHECK');

    Is there a way to use that to instantiate orderTagBuilder.php and attach it to order.php? Would the instantiation code from the config file work in a file called from this notifier? If so, how?
    Okay, so another explanation of how things work...

    Every time a web page is visited, the "entire" site is built based off the information that is available at that moment in time. Your code, which is intended be loaded any time the create_add_products function of the order class is called, will execute when that function is called because of the full load process that occurs on each page load. Everything pretty much always begins in index.php, it calls application_top (at least for now, though that seems like it is going to change in a more recent version), that file brings in all of the initial pieces to support using the database, referencing the files, and as part of that to load all of the includes/auto_loaders files that are expected to be loaded... Your config file is part of that, so regardless of whether order.php is ever called, your config file is considered and executed. It in turn loads the observer class that you have generated. The observer class establishes a "bookmark" you could say such that if the notifier system ever comes across either of the two notifiers that you have in the __construct (or however many you have there) then to do the notifier related action(s). For pre ZC 1.5.3, that was to attempt to access the update function and pass the update function the information previously described (modifiable class, the notifier in question, and whatever may have been included in the third parameter or NULL if none was included).

    So, there is no further action to "attach" your code to other "uses" of the order class... You have attached code specifically to the areas that you need it. Now of course you could try to confirm that the notifiers are present within your includes/classes/order.php file and spelt exactly the same as in your observer and the update function. That could be a reason for not triggering properly.

    The thing is, even if in the header of checkout_process you were to attach/modify the order class' products_ordered_attributes variable, as soon as the page loaded/redirected to checkout_success, those changes are lost, because again, the page loads which starts the whole load process over again to repopulate information. In order to preserve such information from page-to-page you have to store it in a session that is then translated back to a variable of use (and preferably to have the session information removed so that it doesn't take up unnecessary space or in some helpful case uses that it can not be reused by other code or abused but that's a different topic as well.)

    Now, the fact that config file loaded the observer class file is a good thing, it does mean that the file is loaded, whether anything within it is executed is another story. The errors that were basically seen before were up front processing errors that couldn't be ignored. There are some things in code that can be written incorrectly, but the processor won't really detect that until it attempts to execute the code, for example the forward slash that was before the double equals sign. No error was generated by it being there (thinking it was acting something like a pre-processing division of equality), but it likely would not work out in the end. Also, there has been discussion that there were some sort of previous/other modifications already made to the order class, so it could also be that the variable in question is re-established as blank sometime after the notifier and before the usage of the variable to present the information... Ie. might help to present the includes/classes/order.php file code within the create_add_products function so that we can see what is happening between the two notifiers that are being tracked and used. It seems that generally speaking that the observer class has come to what it likely needs to be, but it is interfacing with other code that we haven't seen as modified on your system. Ie. in a vanilla install, for the most part the observer as presented should do what you wanted it to do...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #27
    Join Date
    Jul 2012
    Posts
    16,445
    Plugin Contributions
    17

    Default Re: Customizing confirmation e-mail

    Quote Originally Posted by gjh42 View Post
    From "require(DIR_WS_CLASSES . 'order.php');" it is obvious that there will not be an autoload breakpoint for the order class; the question is how to instantiate orderTagBuilder.php in a way that it attaches to the order class. It seems like this can't be done until after the order class is instantiated. Can I use the notifier mentioned to activate it in some way, or will a super-high breakpoint that instantiates orderTagBuilder.php allow it to come after the order class is active (if it is)? If the order class never activates, my class can sit there with nothing to do without harming anything or taking up (much) processing time, right? Ideally I'd like to instantiate orderTagBuilder.php only if the order class is active.

    The last line in config.base.php is
    PHP Code:
      $autoLoadConfig[180][] = array('autoType'=>'init_script',
                                     
    'loadFile'=> 'init_header.php');
    ?> 
    Would a class referenced in another config file with a breakpoint of 180 fire after this, or would 190 be needed to reliably do so? I'll try 200 anyway. My copy of config.core.php doesn't say anything about mod breakpoint setup.

    The mention of non-modifiable parameters threw me for a few minutes, until I realized that it never had anything to do with what I was trying to do, but I didn't have enough time left to modify my original question.

    I have refactored my code after study of order.php for better output, changed the breakpoint to 200, tried using the zco_notifier version of the update, and I still get no result. My current orderTagBuilder.php:
    PHP Code:
    class orderTagBuilder extends base {
      public 
    $tag_info = array();
      public 
    $tag_qty 0;
      public 
    $tags_text '';
      public 
    $tags_html '';
      
      function 
    __construct() {
        
    //$this->attach($this, array('NOTIFY_ORDER_DURING_CREATE_ADDED_ATTRIBUTE_LINE_ITEM','NOTIFY_ORDER_DURING_CREATE_ADD_PRODUCTS','NOTIFY_ORDER_INVOICE_CONTENT_READY_TO_SEND'));
        
    global $zco_notifier;//alternate version of constructor
        
    $zco_notifier->attach($this, array('NOTIFY_ORDER_DURING_CREATE_ADDED_ATTRIBUTE_LINE_ITEM','NOTIFY_ORDER_DURING_CREATE_ADD_PRODUCTS','NOTIFY_ORDER_INVOICE_CONTENT_READY_TO_SEND'));
        
    //--------------------------^--to build tag info-----------------------------------^--to add tag text to content
      
    }
      
      function 
    update(&$class$eventID$paramsArray) {//$sql_data_array is loaded into $paramsArray
        //if(!isset($this->tag_qty)) $this->tag_qty = 0;
        
    if($eventID == 'NOTIFY_ORDER_DURING_CREATE_ADDED_ATTRIBUTE_LINE_ITEM') {
          if(
    in_array((int)$paramsArray['products_prid'], array(7,15,17,18,24,25))) {//process tag info
            
    if($paramsArray['products_options'] == 'Name') {
              
    $this->tag_info[$this->tag_qty] .= '<br /><strong>-----------------------------------<br />' $paramsArray['products_options_values'] . '</strong><br />';
              
    $this->tag_qty++;
            }
            if(
    in_array($paramsArray['products_options'], array('Dates','Onsite phone','Vehicle','Zone preference'))) {
              
    $this->tag_info[$this->tag_qty] .= $paramsArray['products_options'] . ': <strong>' $paramsArray['products_options_values'] . '</strong><br />';
            }
          }
        }
    //end build tag info

        
    if ($eventID == 'NOTIFY_ORDER_DURING_CREATE_ADD_PRODUCTS') {
          if(
    /*is_array ????????*/ !empty($this->tag_info)) {//add tags if they exist
            
    foreach($this->tag_info as $tag_qty_out=>$tag_text) {
              
    $this->tags_text .= '


    PLEASE PRINT THIS E-MAIL AND BRING IT WITH YOU FOR USE AS CAR AND TENT TAGS.


    '
    ;
              
    $this->tags_html .= '<br /><br /><br />PLEASE PRINT THIS E-MAIL AND BRING IT WITH YOU FOR USE AS CAR AND TENT TAGS.<br /><br /><br />';
              if(
    strpos($tag_text,'Vehicle') !== false) {//add car tag
                
    $this->tags_text .= '
                

    ------------------------------------------
    CAR TAG
    $tag_text '


    '
    ;
                
    $this->tags_html .= '<br /><br /><br /><h2><strong>------------------------------------------<br />CAR TAG</strong></h2><br />' $tag_text '<br /><br /><br />';
              }
              
    //add tent tag
              
    $this->tags_text .= '


    ------------------------------------------
    TENT TAG
    $tag_text '


    '
    ;
              
    $this->tags_html .= '<h2><strong>------------------------------------------<br />TENT TAG</strong></h2><br />' $tag_text '<br /><br /><br />';
            }
          }
        }
    //end create tag text

        
    if ($eventID == 'NOTIFY_ORDER_AFTER_ORDER_CREATE_ADD_PRODUCTS') {//attach welcome letter @ line 887
          
    $class->products_ordered .= 
    Tag text attaches here.
    $this->tags_text;
          
    $class->products_ordered_html .= '<br />Tag HTML attaches here.<br />' $this->tags_html;
          
    $class->products_ordered .= ' Camper welcome letter text attaches here. ';//CAMPER_WELCOME_LETTER;//todo - define a constant containing the welcome text (text version)
          
    $class->products_ordered_html .= ' Camper welcome letter HTML attaches here. ';//CAMPER_WELCOME_LETTER;//todo - define a constant containing the welcome text (HTML version)
          
    unset ($this->tag_info$this->tag_qty$tag_qty_out$tag_text$this->tags_text$this->tags_html);//in case the customer wants to make another order
        
    }//end add tags & welcome to content
        
    $class->products_ordered_attributes .=  ' <br />testing text output - method run.<br /> ';//debug
      
    }// /update
    }
    //eof 
    Thought I had sent the previous already, but then realized I hadn't.

    To be clear, an observer does NOT attach to a specific class. It attaches to a notifier. That notifier may be inside or not inside a class or associated with one.

    Your config file that is or should be in the includes/auto_loaders directory with an extension of .php (it did get renamed from bak or whatever correct?) is the thing that loads your small snippet of code awaiting for the notifier system to say "hey, I found that thing you were looking for, here you are, do your thing!".

    As to your code. Something I see that you were questioning has to do with checking to see if the array of items is "ready". You changed from is_array to !empty. The goal here is, if there is some "amount" of array items to process, then do the following. To do that, good programming practice is, 1) verify that it is in fact an array (in case something else modified the data), and 2) to see how many items there are and if there is at least 1, do the following:

    Code:
    is_array($variable) && sizeof($variable)
    Is sufficient, though could be made a little clearer by using sizeof($variable) > 0
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #28
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Customizing confirmation e-mail

    The documentation and discussion I read on empty() tended to agree that this was a good and concise way to do the job, as it wouldn't throw an error in any case, and if it is either empty or not set the code using it should be bypassed.

    The wiki example comment about setting observer instantiation to after its caller class was instantiated led me to think that this was necessary for the notifier to function.
    "Note: 90 has been chosen as the offset since the observer needs to attach to the $SESSION['cart'] class, which is instantiated at offset 80."
    Thinking about it, it would seem that once the order class was instantiated, the observer would need to be instantiated before the order processing reached a relevant notifier point. Would there be a problem with instantiating the observer before the order is instantiated? It sounds like you are saying this would be okay, in which case, using a breakpoint like 160 would have the observer ready to act when order starts processing.

    The discussion about saving the tag info between page loads is concerning, though one of the debug lines I put in should add a snippet to the attributes content any time the update is run. This content persists until the order confirmation e-mail is sent. I could see if there is an issue with maintaining the custom content inside the update until adding it later in the process.

  9. #29
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Customizing confirmation e-mail

    My previous customization of order.php was strictly inside the admin copy e-mail section, after all of my new code should be executed and sent.
    PHP Code:
          $admin_email_subject '[NEW:';//gjh42 20120503
          
    for ($i=0$n=sizeof($this->products); $i<$n$i++) {
            if (
    zen_get_prid($this->products[$i]['id']) == '11'$admin_email_subject .= 'Vendor App|';
            if (
    zen_get_prid($this->products[$i]['id']) == '12'$admin_email_subject .= 'Performer App|';
            if (
    in_array(zen_get_prid($this->products[$i]['id']), explode(',','1,2,3,4'))) $admin_email_subject .= 'Tickets|';
            if (
    in_array(zen_get_prid($this->products[$i]['id']), explode(',','8,9,10,13,14'))) $admin_email_subject .= 'Booth Fee|';
            if (
    in_array(zen_get_prid($this->products[$i]['id']), explode(',','5,6,7,15,17,18'))) $admin_email_subject .= 'Camping|';
            if (
    in_array(zen_get_prid($this->products[$i]['id']), explode(',','19,20'))) $admin_email_subject .= 'Merchandise|';
          }
          
    $admin_email_subject .= ']';//gjh42 20120501
          //$email_reply_to_address = $this->customer['email_address'];
          //$email_reply_to_name = $this->customer['firstname'] . ' ' . $this->customer['lastname'];
    //      zen_mail('', SEND_EXTRA_ORDER_EMAILS_TO, SEND_EXTRA_NEW_ORDERS_EMAILS_TO_SUBJECT . ' ' . EMAIL_TEXT_SUBJECT . EMAIL_ORDER_NUMBER_SUBJECT . $zf_insert_id,
          
    zen_mail(''SEND_EXTRA_ORDER_EMAILS_TO$admin_email_subject ' ' EMAIL_TEXT_SUBJECT EMAIL_ORDER_NUMBER_SUBJECT $zf_insert_id,//gjh42 20120302
          
    $email_order $extra_info['TEXT'], STORE_NAMEEMAIL_FROM$html_msg'checkout_extra'$this->attachArray);
        }
        
    $zco_notifier->notify('NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL');
      } 
    Last edited by gjh42; 3 Apr 2017 at 11:09 PM.

  10. #30
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Customizing confirmation e-mail

    Update: As this function is needed now, I have copied the code into order.php and modified for the new location. The output formatting still needs work, but it functions about as desired, and I can massage it until it works just right.

    I still want to get the observer class working, but the urgency is off for now. Any information that will help is welcomed, and I thank those who have already assisted.

 

 
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Help customizing Confirmation Email
    By aperfecthost in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 15 Oct 2009, 08:19 PM
  2. Customizing Confirmation Email
    By OLdSalt in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 29 Mar 2009, 01:12 AM
  3. E-mail Text on Confirmation e-mail
    By beth99 in forum General Questions
    Replies: 3
    Last Post: 18 Sep 2006, 02:37 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