Ejemplo n.º 1
0
    public function vtwpr_deal()
    {
        global $vtwpr_rule_template_framework, $vtwpr_deal_structure_framework, $vtwpr_deal_screen_framework, $vtwpr_rule_display_framework, $vtwpr_rule, $vtwpr_info, $vtwpr_setup_options;
        $selected = 'selected="selected"';
        $checked = 'checked="checked"';
        $disabled = 'disabled="disabled"';
        $vtwprNonce = wp_create_nonce("vtwpr-rule-nonce");
        //nonce verified in vt-wholesale-pricing.php
        if (sizeof($vtwpr_rule->rule_error_message) > 0) {
            //these error messages are from the last upd action attempt, coming from vtwpr-rules-update.php
            $this->vtwpr_error_messages();
        }
        $currency_symbol = vtwpr_get_currency_symbol();
        //**********************************************************************
        //IE CSS OVERRIDES, done here to ensure they're last in line...
        //**********************************************************************
        echo '<!--[if IE]>';
        echo '<link rel="stylesheet" type="text/css"  media="all" href="' . VTWPR_URL . '/admin/css/vtwpr-admin-style-ie.css" />';
        echo '<![endif]-->';
        // end override
        //This Div only shows if there is a JS error in the customer implementation of the plugin, as the JS hides this div, if the JS is active
        //vtwpr_show_help_if_js_is_broken();
        ?>
        
        <script type="text/javascript">
        jQuery(document).ready(function($) {
        
        //Spinner gif wasn't working... 
         $('.spinner').append('<img src="<?php 
        echo VTWPR_URL;
        ?>
/admin/images/indicator.gif" />');
       
          });   
        </script>
     
       <?php 
        /*
        <div class="hide-by-jquery">
         <span class="">< ?php _e('If you can see this, there is a JavaScript Error on the Page. Hover over this &rarr;', 'vtwpr'); ? > </span>
             < ?php vtwpr_show_help_tooltip($context = 'onlyShowsIfJSerror', $location = 'title'); ? >
        </div>
        */
        ?>

    <?php 
        //BANNER AND BUTTON AREA
        ?>
                         

    
    <img id="wholesale-pricing-img-preload" alt="" src="<?php 
        echo VTWPR_URL;
        ?>
/admin/images/upgrade-bkgrnd-banner.jpg" />
 		<div id="upgrade-title-area">
      <a  href=" <?php 
        echo VTWPR_PURCHASE_PRO_VERSION_BY_PARENT;
        ?>
 "  title="Purchase Pro">
      <img id="wholesale-pricing-img" alt="help" height="40px" width="40px" src="<?php 
        echo VTWPR_URL;
        ?>
/admin/images/sale-circle.png" />
      </a>      
      <h2>
        <?php 
        _e('Wholesale Pricing', 'vtwpr');
        ?>
        <?php 
        if (defined('VTWPR_PRO_DIRNAME')) {
            _e(' Pro', 'vtwpr');
        }
        ?>
    
        
        </h2>  
      
      <?php 
        if (!defined('VTWPR_PRO_DIRNAME')) {
            ?>
 
          <span class="group-power-msg">
            <strong><em><?php 
            _e('Create rules for Any Group you can think of, and More!', 'vtwpr');
            ?>
</em></strong>
            <?php 
            /* 
                          - Product Category
                          - Wholesale Pricing Custom Category
                          - Logged-in Status
                          - Product
                          - Variations!
            */
            ?>
 
          </span> 
          <span class="buy-button-area">
            <a href="<?php 
            echo VTWPR_PURCHASE_PRO_VERSION_BY_PARENT;
            ?>
" class="help tooltip tooltipWide buy-button">
                <span class="buy-button-label"><?php 
            _e('Get Wholesale Pricing Pro', 'vtwpr');
            ?>
</span>
                <b> <?php 
            vtwpr_show_help_tooltip_text('upgradeToPro');
            ?>
 </b>
            </a>
          </span> 
      <?php 
        }
        ?>
          
    </div>  

            
      <?php 
        //RULE EXECUTION TYPE
        ?>
 
      <div class="display-virtual_box  top-box">                           
        
        <?php 
        //************************
        ?>
        <?php 
        //HIDDEN FIELDS BEGIN
        ?>
        <?php 
        //************************
        ?>
        <?php 
        //RULE EXECUTION blue-dropdownS - only one actually displays at a time, depending on
        ?>
        <input type="hidden" id="vtwpr_nonce" name="vtwpr_nonce" value="<?php 
        echo $vtwprNonce;
        ?>
" />
        <?php 
        //Hidden switch to communicate with the JS that the data is 1st time screenful
        ?>
        <input type="hidden" id="firstTimeBackFromServer" name="firstTimeBackFromServer" value="yes" />        
        <input type="hidden" id="upperSelectsFirstTime" name="upperSelectsFirstTime" value="yes" />
        <input type="hidden" id="upperSelectsDoneSw" name="upperSelectsDoneSw" value="" />
        <input type="hidden" id="catalogCheckoutMsg" name="catalogCheckoutMsg" value="<?php 
        echo __('Message unused for Catalog Discount', 'vtwpr');
        ?>
" />        
        <input type="hidden" id="vtwpr-moreInfo" name="vtwpr-docTitle" value="<?php 
        _e('More Info', 'vtwpr');
        ?>
" /> <?php 
        //v1.0.5 added 2nd button
        ?>
        <input type="hidden" id="vtwpr-docTitle" name="vtwpr-docTitle" value="<?php 
        _e('- Help! -', 'vtwpr');
        ?>
" />         
        <input type="hidden" id="fullMsg" name="fullMsg" value="<?php 
        echo $vtwpr_info['default_full_msg'];
        ?>
" /> 
        
        <?php 
        //************************
        ?>
        <?php 
        //DUMMY HIDDEN FIELDS BEGIN, assigning default values
        ?>
                          
        <?php 
        //************************
        ?>
 
        <input type="hidden" id="cart-or-catalog-select" name="cart-or-catalog-select" value="catalog" />
        <input type="hidden" id="minimum-purchase-select" name="minimum-purchase-select" value="none" />
        <input type="hidden" id="discount_rule_max_amt_msg" name="discount_rule_max_amt_msg" value="none" />
        <input type="hidden" id="discount_lifetime_max_amt_msg" name="discount_lifetime_max_amt_msg" value="none" /> 
        <input type="hidden" id="discount_rule_cum_max_amt_msg" name="discount_rule_cum_max_amt_msg" value="none" /> 
        <input type="hidden" id="discount_product_short_msg" name="discount_product_short_msg" value="none" /> 
        <input type="hidden" id="shortMsg" name="shortMsg" value="none" />  
        <input type="hidden" id="cumulativeRulePricing" name="cumulativeRulePricing" value="yes" /> 
        <input type="hidden" id="cumulativeSalePricing" name="cumulativeSalePricing" value="addToSalePrice" /> 
        <input type="hidden" id="cumulativeCouponPricing" name="cumulativeCouponPricing" value="yes" /> 
        <input type="hidden" id="popChoiceOut" name="popChoiceOut" value="sameAsInPop" /> 
        <input type="hidden" id="action_amt_type_0" name="action_amt_type_0" value="none" />      
        <input type="hidden" id="action_amt_mod_0" name="action_amt_mod_0" value="none" />
        <input type="hidden" id="action_repeat_condition_0" name="action_repeat_condition_0" value="none" /> 
        <input type="hidden" id="discount_applies_to_0" name="discount_applies_to_0" value="each" /> 
        <input type="hidden" id="discount_lifetime_max_amt_type_0" name="discount_lifetime_max_amt_type_0" value="none" /> 
        <input type="hidden" id="discount_rule_max_amt_type_0" name="discount_rule_max_amt_type_0" value="none" /> 
        <input type="hidden" id="discount_rule_cum_max_amt_type_0" name="discount_rule_cum_max_amt_type_0" value="none" />
        <input type="hidden" id="ruleApplicationPriority_num" name="ruleApplicationPriority_num" value="10" />
        <input type="hidden" id="buy_amt_type_0" name="buy_amt_type_0" value="none" />
        <input type="hidden" id="buy_amt_mod_0" name="buy_amt_mod_0" value="none" />
        <input type="hidden" id="buy_repeat_condition_0" name="buy_repeat_condition_0" value="none" />                            
        <input type="hidden" id="buy_amt_applies_to_0" name="buy_amt_applies_to_0" value="each" />
        <input type="hidden" id="action_amt_applies_to_0" name="action_amt_applies_to_0" value="all" /> 
           
        <input type="hidden" id="buy_repeat_count_0" name="buy_repeat_count_0" value="0" />
        <input type="hidden" id="buy_amt_count_0" name="buy_amt_count_0" value="0" />
        <input type="hidden" id="buy_amt_mod_count_0" name="buy_amt_mod_count_0" value="0" />
        <input type="hidden" id="action_repeat_count_0" name="action_repeat_count_0" value="0" />
        <input type="hidden" id="action_amt_count_0" name="action_amt_count_0" value="0" />
        <input type="hidden" id="action_amt_mod_count_0" name="action_amt_mod_count_0" value="0" />
        <input type="hidden" id="discount_auto_add_free_product_0" name="discount_auto_add_free_product_0" value="" />
        <input type="hidden" id="discount_rule_max_amt_count_0" name="discount_rule_max_amt_count_0" value="0" />
        <input type="hidden" id="discount_lifetime_max_amt_count_0" name="discount_lifetime_max_amt_count_0" value="0" />
        <input type="hidden" id="discount_rule_cum_max_amt_count_0" name="discount_rule_cum_max_amt_count_0" value="0" />
        
        

          
           
        <?php 
        /*
         Assign a numeric value to the switch
           showing HOW MANY selects have data
             on 1st return from server...
        */
        $data_sw = '0';
        //test the Various group filter selects and set a value...
        switch (true) {
            case $vtwpr_rule->get_group_filter_select > ' ' && $vtwpr_rule->get_group_filter_select != 'choose':
                $data_sw = '5';
                break;
            case $vtwpr_rule->buy_group_filter_select > ' ' && $vtwpr_rule->buy_group_filter_select != 'choose':
                $data_sw = '4';
                break;
            case $vtwpr_rule->minimum_purchase_select > ' ' && $vtwpr_rule->minimum_purchase_select != 'choose':
                $data_sw = '3';
                break;
            case $vtwpr_rule->pricing_type_select > ' ' && $vtwpr_rule->pricing_type_select != 'choose':
                $data_sw = '2';
                break;
            case $vtwpr_rule->cart_or_catalog_select > ' ' && $vtwpr_rule->cart_or_catalog_select != 'choose':
                $data_sw = '1';
                break;
        }
        /*  upperSelectsHaveDataFirstTime has values from 0 => 5
            value = 0  no previous data saved 
            value = 1  last run got to:  cart_or_catalog_select
            value = 2  last run got to:  pricing_type_select
            value = 3  last run got to:  minimum_purchase_select
            value = 4  last run got to:  buy_group_filter_select
            value = 5  last run got to:  get_group_filter_select
            */
        ?>
        <input type="hidden" id="upperSelectsHaveDataFirstTime" name="upperSelectsHaveDataFirstTime" value="<?php 
        echo $data_sw;
        ?>
" />
        
        <input type="hidden" id="templateChanged" name="templateChanged" value="no" /> 
        
        <?php 
        //Statuses used for switching of the upper dropdowns
        ?>
        <input type="hidden" id="select_status_sw"  name="select_status_sw"  value="no" />
        
        <?php 
        //pass these two messages up to JS, translated here if necessary
        ?>
  
        <input type="hidden" id="shortMsg" name="shortMsg" value="<?php 
        echo $vtwpr_info['default_short_msg'];
        ?>
" /> 
  
        <input id="pluginVersion" type="hidden" value="<?php 
        if (defined('VTWPR_PRO_DIRNAME')) {
            echo "proVersion";
        } else {
            echo "freeVersion";
        }
        ?>
" name="pluginVersion" />  
        <input id="rule_template_framework" type="hidden" value="<?php 
        echo $vtwpr_rule->rule_template;
        ?>
" name="rule_template_framework" />
              
           
        <?php 
        //************************
        ?>
        <?php 
        //HIDDEN FIELDS END
        ?>
        <?php 
        //************************
        ?>

        <div class="template-area clear-left">  

          <div class="clear-left" id="first-blue-line">                                                           
               <span class="left-column  left-column-less-padding-top3">                              
                 <?php 
        //mwn20140414 added id
        ?>
                 <label id="pricing-type-select-label"  class="hasWizardHelpRight"   for="<?php 
        echo $vtwpr_rule_display_framework['pricing_type_select']['label']['for'];
        ?>
"><?php 
        echo $vtwpr_rule_display_framework['pricing_type_select']['label']['title'];
        ?>
</label>
                 <?php 
        vtwpr_show_object_hover_help('pricing_type_select', 'wizard');
        ?>
 
               </span>
               <span class="blue-dropdown  right-column" id="pricing-type-select-area">   
                 <select id="<?php 
        echo $vtwpr_rule_display_framework['pricing_type_select']['select']['id'];
        ?>
" class="<?php 
        echo $vtwpr_rule_display_framework['pricing_type_select']['select']['class'];
        ?>
  " name="<?php 
        echo $vtwpr_rule_display_framework['pricing_type_select']['select']['name'];
        ?>
" tabindex="<?php 
        //echo $vtwpr_rule_display_framework['pricing_type_select']['select']['tabindex'];
        ?>
" >          
                   <?php 
        for ($i = 0; $i < sizeof($vtwpr_rule_display_framework['pricing_type_select']['option']); $i++) {
            ?>
                             
                      <option id="<?php 
            echo $vtwpr_rule_display_framework['pricing_type_select']['option'][$i]['id'];
            ?>
"  class="<?php 
            echo $vtwpr_rule_display_framework['pricing_type_select']['option'][$i]['class'];
            ?>
"  value="<?php 
            echo $vtwpr_rule_display_framework['pricing_type_select']['option'][$i]['value'];
            ?>
"   <?php 
            if ($vtwpr_rule_display_framework['pricing_type_select']['option'][$i]['value'] == $vtwpr_rule->pricing_type_select) {
                echo $selected;
            }
            ?>
 >  <?php 
            echo $vtwpr_rule_display_framework['pricing_type_select']['option'][$i]['title'];
            ?>
 </option>
                   <?php 
        }
        ?>
 
                 </select>  
                  <span class="shortIntro  shortIntro2"  id="buy_group_filter_comment">
                      <span class="">
                          <em><?php 
        _e("What kind of Deal is it?", 'vtwpr');
        ?>
</em>
                          &nbsp;
                          <img  class="hasHoverHelp2" width="11px" alt=""  src="<?php 
        echo VTWPR_URL;
        ?>
/admin/images/help.png" />  
                          <?php 
        vtwpr_show_object_hover_help('pricing_type_select', 'small');
        ?>
                      </span>                   
                      <br>
                      <a class="commentURL" target="_blank" href="http://www.varktech.com/documentation/wholesale-pricing/examples"><?php 
        _e('Deal Examples', 'vtwpr');
        ?>
</a>                
                  </span>                                                          
               </span> 
          </div> <?php 
        //end blue-line
        ?>
  
          <div class="blue-line  blue-line-less-top  clear-left">
              <span class="left-column">                                                      
                <label class="scheduling-label hasWizardHelpRight" id="scheduling-label-item"><?php 
        _e('Deal Schedule', 'vtwpr');
        ?>
</label>   
                <?php 
        vtwpr_show_object_hover_help('scheduling', 'wizard');
        ?>
              </span>
              <span class="blue-dropdown  scheduling-group  right-column" id="scheduling-area">   
                <span class="date-line" id='date-line-0'>                               
                <?php 
        //   <label class="scheduling-label">Scheduling</label>
        ?>
                                              
                    <span class="date-line-area">  
                      <?php 
        $this->vtwpr_rule_scheduling();
        ?>
 
                    </span> 
                    <span class="on-off-switch">                              
                    <?php 
        //     <label for="rule-state-select">On/Off Switch</label>
        ?>
 
                       <select id="<?php 
        echo $vtwpr_rule_display_framework['rule_on_off_sw_select']['select']['id'];
        ?>
" class="<?php 
        echo $vtwpr_rule_display_framework['rule_on_off_sw_select']['select']['class'];
        ?>
" name="<?php 
        echo $vtwpr_rule_display_framework['rule_on_off_sw_select']['select']['name'];
        ?>
" tabindex="<?php 
        //echo $vtwpr_rule_display_framework['rule_on_off_sw_select']['select']['tabindex'];
        ?>
" >          
                         <?php 
        for ($i = 0; $i < sizeof($vtwpr_rule_display_framework['rule_on_off_sw_select']['option']); $i++) {
            ?>
                             
                            <option id="<?php 
            echo $vtwpr_rule_display_framework['rule_on_off_sw_select']['option'][$i]['id'];
            ?>
"  class="<?php 
            echo $vtwpr_rule_display_framework['rule_on_off_sw_select']['option'][$i]['class'];
            ?>
"  value="<?php 
            echo $vtwpr_rule_display_framework['rule_on_off_sw_select']['option'][$i]['value'];
            ?>
"   <?php 
            if ($vtwpr_rule_display_framework['rule_on_off_sw_select']['option'][$i]['value'] == $vtwpr_rule->rule_on_off_sw_select) {
                echo $selected;
            }
            ?>
 >  <?php 
            echo $vtwpr_rule_display_framework['rule_on_off_sw_select']['option'][$i]['title'];
            ?>
 </option>
                         <?php 
        }
        ?>
 
                       </select>                        
                    </span>                                
                </span> 
                   

                  <span class="shortIntro"  id="buy_group_filter_comment">
                    <em>
                    <?php 
        _e('Active When?', 'vtwpr');
        ?>
                    <br>
                    <?php 
        _e('On or Off?', 'vtwpr');
        ?>
                    </em>
                    &nbsp;
                    <img  class="hasHoverHelp2" width="11px" alt=""  src="<?php 
        echo VTWPR_URL;
        ?>
/admin/images/help.png" /> 
                    <?php 
        vtwpr_show_object_hover_help('scheduling', 'small');
        ?>
                  </span>                                                      
              </span>      
          </div> <?php 
        //end blue-line
        ?>
                                               
      </div> <?php 
        //end template-area
        ?>
                       

     </div> <?php 
        //end top-box
        ?>
                
     
  <div class="display-virtual_box hideMe" id="lower-screen-wrapper" >

  
      <?php 
        //****************
        //DEAL INFO GROUP
        //****************
        ?>
 
 
     <div class="display-virtual_box  clear-left" id="rule_deal_info_group">  
                       
      <?php 
        for ($k = 0; $k < sizeof($vtwpr_rule->rule_deal_info); $k++) {
            ?>
         
      <div class="display-virtual_box rule_deal_info" id="rule_deal_info_line<?php 
            echo '_' . $k;
            ?>
">   
        <div class="display-virtual_box" id="buy_info<?php 
            echo '_' . $k;
            ?>
">  
         
           <input id="hiddenDealInfoLine<?php 
            echo '_' . $k;
            ?>
" type="hidden" value="lineActive" name="dealInfoLine<?php 
            echo '_' . $k;
            ?>
" />

           <?php 
            //*****************************************************
            //set the switch used on the screen for JS data check
            //*****************************************************
            ?>
           <?php 
            //end switch **************************************
            ?>
 

         <div class="screen-box buy_group_box" id="buy_group_box<?php 
            echo '_' . $k;
            ?>
" >
            <span class="left-column">
                <span class="title  hasWizardHelpRight" id="buy_group_title">
                  <a id="buy_group_title_anchor" class="title-anchors second-level-title" href="javascript:void(0);"><span class="showBuyAsBuy"><?php 
            _e('Product Filter', 'vtwpr');
            ?>
</span><span class="showBuyAsDiscount"><?php 
            _e('Product Filter', 'vtwpr');
            ?>
</span> </a>                                       
                </span>
                <?php 
            vtwpr_show_object_hover_help('inPop', 'wizard');
            ?>
 
                 
            </span>
            
            <span class="dropdown  buy_group  right-column" id="buy_group_dropdown">              
               <select id="<?php 
            echo $vtwpr_rule_display_framework['inPop']['select']['id'];
            ?>
" class="<?php 
            echo $vtwpr_rule_display_framework['inPop']['select']['class'];
            ?>
 " name="<?php 
            echo $vtwpr_rule_display_framework['inPop']['select']['name'];
            ?>
" tabindex="<?php 
            //echo $vtwpr_rule_display_framework['inPop']['select']['tabindex'];
            ?>
" >          
                 <?php 
            for ($i = 0; $i < sizeof($vtwpr_rule_display_framework['inPop']['option']); $i++) {
                //pick up the free/pro version of the title => in this case, title and title3
                $title = $vtwpr_rule_display_framework['inPop']['option'][$i]['title'];
                if (defined('VTWPR_PRO_DIRNAME') && $vtwpr_rule_display_framework['inPop']['option'][$i]['title3'] > ' ') {
                    $title = $vtwpr_rule_display_framework['inPop']['option'][$i]['title3'];
                }
                ?>
                             
                    <option id="<?php 
                echo $vtwpr_rule_display_framework['inPop']['option'][$i]['id'];
                ?>
"  class="<?php 
                echo $vtwpr_rule_display_framework['inPop']['option'][$i]['class'];
                ?>
"  value="<?php 
                echo $vtwpr_rule_display_framework['inPop']['option'][$i]['value'];
                ?>
"   <?php 
                if ($vtwpr_rule_display_framework['inPop']['option'][$i]['value'] == $vtwpr_rule->inPop) {
                    echo $selected;
                }
                ?>
 >  <?php 
                echo $title;
                ?>
 </option>
                 <?php 
            }
            ?>
 
               </select> 
               
                           
               <span class="buy_group_line_remainder_class" id="buy_group_line_remainder">   
                  <?php 
            $this->vtwpr_buy_group_cntl();
            ?>
 
               </span>                
               
               <span class="shortIntro  shortIntro2" >
                  <em>
                  <?php 
            _e('Product must be in the Filter Group', 'vtwpr');
            ?>
                  </em><br>
                  <em>
                  <?php 
            _e('to be valid for the Deal', 'vtwpr');
            ?>
                  </em> 
                &nbsp;
                  <img  class="hasHoverHelp2" width="11px" alt=""  src="<?php 
            echo VTWPR_URL;
            ?>
/admin/images/help.png" /> 
                  <?php 
            vtwpr_show_object_hover_help('inPop', 'small');
            ?>
               </span>                               
                                        
            </span>                                                                          

         </div><!-- //buy_group_box -->


        </div><!-- //buy_info -->

        <div class="display-virtual_box" id="discount_info">
                 
          <div class="screen-box discount_amt_box  discount_amt_box_class<?php 
            echo '_' . $k;
            ?>
" id="discount_amt_box<?php 
            echo '_' . $k;
            ?>
" >  

            <span class="clear-both left-column">
                <span class="title  discount_action_type  hasWizardHelpRight" id="discount_action_type_title<?php 
            echo '_' . $k;
            ?>
" >            
                  <a id="discount_action_title_anchor<?php 
            echo '_' . $k;
            ?>
" class="title-anchors second-level-title" href="javascript:void(0);"><?php 
            _e('Discount Amount', 'vtwpr');
            ?>
</a>
                </span>
                <?php 
            vtwpr_show_object_hover_help('discount_amt_type', 'wizard');
            ?>
            </span>

            <span class="dropdown discount_amt_type right-column" id="discount_amt_type_dropdown<?php 
            echo '_' . $k;
            ?>
">              
              
               <select id="<?php 
            echo $vtwpr_deal_screen_framework['discount_amt_type']['select']['id'] . '_' . $k;
            ?>
" class="<?php 
            echo $vtwpr_deal_screen_framework['discount_amt_type']['select']['class'];
            ?>
" name="<?php 
            echo $vtwpr_deal_screen_framework['discount_amt_type']['select']['name'] . '_' . $k;
            ?>
" tabindex="<?php 
            //echo $vtwpr_deal_screen_framework['discount_amt_type']['select']['tabindex'];
            ?>
" >          
                 <?php 
            for ($i = 0; $i < sizeof($vtwpr_deal_screen_framework['discount_amt_type']['option']); $i++) {
                $this->vtwpr_change_title_currency_symbol('discount_amt_type', $i, $currency_symbol);
                ?>
                                                
                    <option id="<?php 
                echo $vtwpr_deal_screen_framework['discount_amt_type']['option'][$i]['id'] . '_' . $k;
                ?>
"  class="<?php 
                echo $vtwpr_deal_screen_framework['discount_amt_type']['option'][$i]['class'];
                ?>
"  value="<?php 
                echo $vtwpr_deal_screen_framework['discount_amt_type']['option'][$i]['value'];
                ?>
"   <?php 
                if ($vtwpr_deal_screen_framework['discount_amt_type']['option'][$i]['value'] == $vtwpr_rule->rule_deal_info[$k]['discount_amt_type']) {
                    echo $selected;
                }
                ?>
 >  <?php 
                echo $vtwpr_deal_screen_framework['discount_amt_type']['option'][$i]['title'];
                ?>
 </option>
                 <?php 
            }
            ?>
 
               </select>
               
                
               <span class="discount_amt_count_area  discount_amt_count_area_class<?php 
            echo '_' . $k;
            ?>
  amt-field" id="discount_amt_count_area<?php 
            echo '_' . $k;
            ?>
">    
                 <span class="discount_amt_count_label" id="discount_amt_count_label<?php 
            echo '_' . $k;
            ?>
"> 
                    <span class="forThePriceOf-amt-literal-inserted  discount_amt_count_literal  discount_amt_count_literal<?php 
            echo '_' . $k;
            ?>
 " id="discount_amt_count_literal_forThePriceOf_buyAmt<?php 
            echo '_' . $k;
            ?>
"><?php 
            $this->vtwpr_load_forThePriceOf_literal($k);
            ?>
 </span>
                    <span class="discount_amt_count_literal  discount_amt_count_literal_forThePriceOf  discount_amt_count_literal<?php 
            echo '_' . $k;
            ?>
 " id="discount_amt_count_literal_forThePriceOf<?php 
            echo '_' . $k;
            ?>
"><?php 
            _e('units ', 'vtwpr');
            echo '&nbsp;';
            _e(' For the Price of ', 'vtwpr');
            ?>
 </span>
                    <span class="discount_amt_count_literal  discount_amt_count_literal_forThePriceOf_Currency  discount_amt_count_literal<?php 
            echo '_' . $k;
            ?>
 " id="discount_amt_count_literal_forThePriceOf_Currency<?php 
            echo '_' . $k;
            ?>
"><?php 
            echo $currency_symbol;
            ?>
</span>
                 </span>                 
                 <input id="<?php 
            echo $vtwpr_deal_screen_framework['discount_amt_count']['id'] . '_' . $k;
            ?>
" class="<?php 
            echo $vtwpr_deal_screen_framework['discount_amt_count']['class'];
            ?>
" type="<?php 
            echo $vtwpr_deal_screen_framework['discount_amt_count']['type'];
            ?>
" name="<?php 
            echo $vtwpr_deal_screen_framework['discount_amt_count']['name'] . '_' . $k;
            ?>
" value="<?php 
            echo $vtwpr_rule->rule_deal_info[$k]['discount_amt_count'];
            ?>
" />                 
                 <span class="discount_amt_count_literal_units_area  discount_amt_count_literal<?php 
            echo '_' . $k;
            ?>
  discount_amt_count_literal_units_area_class<?php 
            echo '_' . $k;
            ?>
" id="discount_amt_count_literal_units_area<?php 
            echo '_' . $k;
            ?>
">
                   <span class="discount_amt_count_literal" id="discount_amt_count_literal_units<?php 
            echo '_' . $k;
            ?>
"><?php 
            _e(' units', 'vtwpr');
            ?>
 </span>
                   <?php 
            vtwpr_show_help_tooltip($context = 'discount_amt_count_forThePriceOf');
            ?>
                 </span>                
               </span>
                <label id="<?php 
            echo $vtwpr_deal_screen_framework['discount_auto_add_free_product']['label']['id'] . '_' . $k;
            ?>
"   class="<?php 
            echo $vtwpr_deal_screen_framework['discount_auto_add_free_product']['label']['class'];
            ?>
"> 
                    
                    <input id="<?php 
            echo $vtwpr_deal_screen_framework['discount_auto_add_free_product']['checkbox']['id'] . '_' . $k;
            ?>
" 
                          class="<?php 
            echo $vtwpr_deal_screen_framework['discount_auto_add_free_product']['checkbox']['class'];
            ?>
  hasWizardHelpBelow"
                          type="checkbox" 
                          value="<?php 
            echo $vtwpr_deal_screen_framework['discount_auto_add_free_product']['checkbox']['value'];
            ?>
" 
                           <?php 
            if ($vtwpr_deal_screen_framework['discount_auto_add_free_product']['checkbox']['value'] == $vtwpr_rule->rule_deal_info[$k]['discount_auto_add_free_product']) {
                echo $checked;
            }
            ?>
                          name="<?php 
            echo $vtwpr_deal_screen_framework['discount_auto_add_free_product']['checkbox']['name'] . '_' . $k;
            ?>
" />
                    <?php 
            vtwpr_show_object_hover_help('discount_free', 'wizard');
            ?>
 
                          
                    <?php 
            echo $vtwpr_deal_screen_framework['discount_auto_add_free_product']['label']['title'];
            ?>
  
                    <?php 
            vtwpr_show_help_tooltip($context = 'discount_auto_add_free_product', $location = 'title');
            ?>
 
                </label>
                        
               <span class="shortIntro  shortIntro2" >
                  <em>
                  <?php 
            _e('What kind of Discount is offered,', 'vtwpr');
            ?>
                  </em><br>
                  <em>
                  <?php 
            _e('and in what amount?', 'vtwpr');
            ?>
                  </em>                   
                &nbsp;
                  <img  class="hasHoverHelp2" width="11px" alt=""  src="<?php 
            echo VTWPR_URL;
            ?>
/admin/images/help.png" /> 
                  <?php 
            vtwpr_show_object_hover_help('discount_amt_type', 'small');
            ?>
               </span>                                     
            </span>
     
          </div> <!-- //discount_amt_box -->
                        
        </div> <!-- //discount_info -->

      <div id="messages-outer-box">           
         <div class="screen-box  messages-box_class" id="messages-box">
           <span class="dropdown messages-box-area clear-left"  id="discount_msgs_dropdown">      
             <span class="discount_product_full_msg_area clear-both">

                 <span class="left-column">
                     <span class="title  hasWizardHelpRight">                
                         <span class="title-anchors" id="discount_product_full_msg_label"> <?php 
            _e('Advertising Message', 'vtwpr');
            ?>
 </span> 
                     </span>
                     <?php 
            vtwpr_show_object_hover_help('discount_product_full_msg', 'wizard');
            ?>
                 </span>
                                    
                 <span class="right-column">                
                     <span class="column-width50">
                         <textarea rows="2" cols="35" id="<?php 
            echo $vtwpr_rule_display_framework['discount_product_full_msg']['id'];
            ?>
" class="<?php 
            echo $vtwpr_rule_display_framework['discount_product_full_msg']['class'];
            ?>
  right-column" type="<?php 
            echo $vtwpr_rule_display_framework['discount_product_full_msg']['type'];
            ?>
" name="<?php 
            echo $vtwpr_rule_display_framework['discount_product_full_msg']['name'];
            ?>
" ><?php 
            echo $vtwpr_rule->discount_product_full_msg;
            ?>
</textarea>                                                                                              
                         
                     </span>                               
                     <span class="shortIntro" >
                        <em>
                        <?php 
            _e('Optional, Can be shown in your', 'vtwpr');
            ?>
                        </em><br>
                        <em>
                        <?php 
            _e('Website using ', 'vtwpr');
            ?>
                        </em>
                     &nbsp;
                    <a class="commentURL" target="_blank" href="http://www.varktech.com/documentation/pricing-deals/shortcodes"><?php 
            _e('Shortcodes', 'vtwpr');
            ?>
</a>                                                     
                      &nbsp;
                        <img  class="hasHoverHelp2" width="11px" alt=""  src="<?php 
            echo VTWPR_URL;
            ?>
/admin/images/help.png" /> 
                       <?php 
            vtwpr_show_object_hover_help('discount_product_full_msg', 'small');
            ?>
                     </span>                               
                  </span> 
            
             </span>
           </span>
         </div>    
      </div>
         
        
        </div> <!-- //end DEAL INFO line in "for" loop --><?php 
            //end DEAL INFO line in "for" loop
            ?>
   
      <?php 
        }
        //end $k'for' LOOP
        ?>
      </div> <!-- //rule_deal_info_group --> <?php 
        //end rule_deal_info_group
        ?>
  

      </div> <?php 
        //lower-screen-wrapper
        ?>
      
      <?php 
        //lots of selects change their values between standard and 'discounted' titles.
        //This is where we supply the HIDEME alternative titles
        $this->vtwpr_print_alternative_title_selects();
        //echo '$vtwpr_rule= <pre>'.print_r($vtwpr_rule, true).'</pre>' ;
    }
Ejemplo n.º 2
0
 public function vtwpr_build_ruleInWords()
 {
     global $vtwpr_rule;
     //Don't process if errors present
     /*  if  ( sizeof($vtwpr_rule->rule_error_message) > 0 ) {
           $vtwpr_rule->ruleInWords = '';
           return;
         }    */
     $vtwpr_rule->ruleInWords = '';
     switch ($vtwpr_rule->rule_template) {
         //display templates
         case 'D-storeWideSale':
             //Store-Wide Sale with a Percentage or $$ Value Off, at Catalog Display Time - Realtime
         //Store-Wide Sale with a Percentage or $$ Value Off, at Catalog Display Time - Realtime
         case 'C-storeWideSale':
             //Store-Wide Sale with a Percentage or $$ Value Off all Products in the Cart          vtwpr_buy_info(
             $vtwpr_rule->ruleInWords .= $this->vtwpr_show_buy_info();
             $vtwpr_rule->ruleInWords .= $this->vtwpr_show_action_info();
             $vtwpr_rule->ruleInWords .= $this->vtwpr_show_discount_amt();
             break;
         case 'D-simpleDiscount':
             //Membership Discount in the Buy Pool Group, at Catalog Display Time - Realtime
         //Membership Discount in the Buy Pool Group, at Catalog Display Time - Realtime
         case 'C-simpleDiscount':
             //Sale Price by any Buy Pool Group Criteria [Product / Category / Custom Taxonomy Category / Membership / Wholesale] - Cart
             $vtwpr_rule->ruleInWords .= $this->vtwpr_show_buy_info();
             $vtwpr_rule->ruleInWords .= $this->vtwpr_show_action_info();
             $vtwpr_rule->ruleInWords .= $this->vtwpr_show_discount_amt();
             //  $vtwpr_rule->ruleInWords .= $this->vtwpr_show_pop();
             break;
         default:
             $vtwpr_rule->ruleInWords .= $this->vtwpr_show_buy_info();
             $vtwpr_rule->ruleInWords .= $this->vtwpr_show_action_info();
             $vtwpr_rule->ruleInWords .= $this->vtwpr_show_discount_amt();
             $vtwpr_rule->ruleInWords .= $this->vtwpr_show_repeats();
             //  $vtwpr_rule->ruleInWords .= $this->vtwpr_show_pop();
             $vtwpr_rule->ruleInWords .= $this->vtwpr_show_limits();
             break;
     }
     //replace $ with the currency symbol set up on the Parent Plugin!!
     $currency_symbol = vtwpr_get_currency_symbol();
     $vtwpr_rule->ruleInWords = str_replace('$', $currency_symbol, $vtwpr_rule->ruleInWords);
 }