shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

ebay_profile_form_shipping.twig (22204B)


      1 {{ header }}{{ column_left }}
      2 <div id="content">
      3   <div class="page-header">
      4     <div class="container-fluid">
      5       <div class="pull-right">
      6         <a data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary" onclick="$('#form').submit();"><i class="fa fa-check-circle"></i></a>
      7         <a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a>
      8       </div>
      9       <h1>{{ heading_title }}</h1>
     10       <ul class="breadcrumb">
     11         {% for breadcrumb in breadcrumbs %}
     12         <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
     13         {% endfor %}
     14       </ul>
     15     </div>
     16   </div>
     17   <div class="container-fluid">
     18     {% if error_warning %}
     19       <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}</div>
     20     {% endif %}
     21     <div class="panel panel-default">
     22       <div class="panel-heading">
     23         <h3 class="panel-title"><i class="fa fa-list"></i> {{ text_manage }}</h3>
     24       </div>
     25       <div class="panel-body">
     26         <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form" class="form-horizontal">
     27         <input type="hidden" name="type" value="{{ type }}" />
     28         <input type="hidden" name="ebay_profile_id" value="{{ ebay_profile_id }}" />
     29         <ul class="nav nav-tabs">
     30           <li class="active"><a href="#tab-general" data-toggle="tab">{{ tab_general }}</a></li>
     31           <li><a href="#tab-shipping" data-toggle="tab">{{ tab_shipping }}</a></li>
     32         </ul>
     33         <div class="tab-content">
     34           <div class="tab-pane active" id="tab-general">
     35             <div class="form-group">
     36               <label class="col-sm-2 control-label">{{ text_profile_default }}</label>
     37               <div class="col-sm-10">
     38                 <input type="hidden" name="default" value="0" />
     39                 <input type="checkbox" name="default" value="1" {% if default == 1 %}checked="checked"{% endif %} />
     40               </div>
     41             </div>
     42             <div class="form-group">
     43               <label class="col-sm-2 control-label" for="name">{{ text_profile_name }}</label>
     44               <div class="col-sm-10">
     45                 <input type="text" name="name" value="{{ name }}" placeholder="{{ text_profile_name }}" id="name" class="form-control" />
     46               </div>
     47             </div>
     48             <div class="form-group">
     49               <label class="col-sm-2 control-label" for="description">{{ text_profile_desc }}</label>
     50               <div class="col-sm-10">
     51                 <textarea name="description" class="form-control" rows="3" id="description">{{ description }}</textarea>
     52               </div>
     53             </div>
     54           </div>
     55           <div class="tab-pane" id="tab-shipping">
     56             <div class="form-group">
     57               <label class="col-sm-2 control-label">{{ text_shipping_postcode }}</label>
     58               <div class="col-sm-10">
     59                 <input type="text" name="data[postcode]" id="postcode" value="{{ data.postcode }}" placeholder="{{ text_shipping_postcode }}" class="form-control" />
     60               </div>
     61             </div>
     62             <div class="form-group">
     63               <label class="col-sm-2 control-label">{{ text_shipping_location }}</label>
     64               <div class="col-sm-10">
     65                 <input type="text" name="data[location]" id="location" value="{{ data.location }}" placeholder="{{ text_shipping_location }}" class="form-control" />
     66               </div>
     67             </div>
     68             <div class="form-group">
     69               <label class="col-sm-2 control-label">{{ text_shipping_dispatch_country }}</label>
     70               <div class="col-sm-10">
     71                 <select name="data[country]" class="form-control" id="country">
     72                   {% for country in setting.countries %}
     73                     <option value="{{ country.code }}"{% if data.country == country.code %} selected{% endif %}>{{ country.name }}</option>
     74                   {% endfor %}
     75                 </select>
     76               </div>
     77             </div>
     78             <div class="form-group">
     79               <label class="col-sm-2 control-label">{{ text_shipping_despatch }}</label>
     80               <div class="col-sm-10">
     81                 <select name="data[dispatch_time]" class="form-control" id="dispatch_time">
     82                   {% for dispatch_time in setting.dispatch_times %}
     83                     <option value="{{ dispatch_time.DispatchTimeMax }}"{% if data.dispatch_time == dispatch_time.DispatchTimeMax %} selected{% endif %}>{{ dispatch_time.Description }}</option>
     84                   {% endfor %}
     85                 </select>
     86                 <span class="help-block">{{ text_shipping_despatch_help }}</span>
     87               </div>
     88             </div>
     89             <div class="form-group">
     90               <label class="col-sm-2 control-label">{{ text_shipping_getitfast }}</label>
     91               <div class="col-sm-10">
     92                 <input type="hidden" name="data[get_it_fast]" value="0" />
     93                 <input type="checkbox" name="data[get_it_fast]" value="1" id="get_it_fast" {% if data.get_it_fast == 1 %}checked="checked"{% endif %} />
     94               </div>
     95             </div>
     96 
     97             {%  if setting.listing_restrictions.eligible_for_pickup_dropoff == 1 %}
     98               <div class="form-group">
     99                 <label class="col-sm-2 control-label">{{ entry_shipping_pickupdropoff }}</label>
    100                 <div class="col-sm-10">
    101                   <input type="hidden" name="data[eligible_for_pickup_dropoff]" value="0" />
    102                   <input type="checkbox" name="data[eligible_for_pickup_dropoff]" value="1" id="eligible_for_pickup_dropoff" {% if data.eligible_for_pickup_dropoff == 1 %}checked="checked"{% endif %} />
    103                 </div>
    104               </div>
    105             {% endif %}
    106 
    107             {%  if setting.listing_restrictions.eligible_for_pickup_instore == 1 %}
    108               <div class="form-group">
    109                 <label class="col-sm-2 control-label">{{ entry_shipping_pickupinstore }}</label>
    110                 <div class="col-sm-10">
    111                   <input type="hidden" name="data[eligible_for_pickup_instore]" value="0" />
    112                   <input type="checkbox" name="data[eligible_for_pickup_instore]" value="1" id="eligible_for_pickup_instore" {% if data.eligible_for_pickup_instore == 1 %}checked="checked"{% endif %} />
    113                 </div>
    114               </div>
    115             {% endif %}
    116 
    117             {% if setting.listing_restrictions.global_shipping == 1 %}
    118               <div class="form-group">
    119                 <label class="col-sm-2 control-label">{{ entry_shipping_global_shipping }}</label>
    120                 <div class="col-sm-10">
    121                   <input type="hidden" name="data[global_shipping]" value="0" />
    122                   <input type="checkbox" name="data[global_shipping]" value="1" id="global_shipping" {% if data.global_shipping == 1 %}checked="checked"{% endif %} />
    123                 </div>
    124               </div>
    125             {% endif %}
    126 
    127             {% if cod_surcharge == 1 %}
    128               <div class="form-group">
    129                 <label class="col-sm-2 control-label">{{ text_shipping_cod }}</label>
    130                 <div class="col-sm-10">
    131                   <input type="text" name="data[cod_cost]" value="{{ data.cod_cost }}" placeholder="{{ text_shipping_cod }}" class="form-control" />
    132                 </div>
    133               </div>
    134             {% endif %}
    135 
    136             <div class="form-group">
    137               <label class="col-sm-2 control-label">{{ text_shipping_type_nat }}</label>
    138               <div class="col-sm-10">
    139                 <select name="data[national][shipping_type]" class="form-control" id="shipping-type-national">
    140                   {% if setting.shipping_types.flat == 1 %}<option value="flat"{% if data.national.shipping_type == "flat" %} selected{% endif %}>{{ text_shipping_flat }}</option>{% endif %}
    141                   {% if setting.shipping_types.calculated == 1 %}<option value="calculated"{% if data.national.shipping_type == "calculated" %} selected{% endif %}>{{ text_shipping_calculated }}</option>{% endif %}
    142                   {% if setting.shipping_types.freight == 1 %}<option value="freight"{% if data.national.shipping_type == "freight" %} selected{% endif %}>{{ text_shipping_freight }}</option>{% endif %}
    143                 </select>
    144               </div>
    145             </div>
    146 
    147             <div class="form-group">
    148               <label class="col-sm-2 control-label"><span data-toggle="tooltip" title="{{ help_shipping_promotion_discount }}">{{ entry_shipping_promotion_discount }}</span></label>
    149               <div class="col-sm-10">
    150                 <input type="hidden" name="data[promotional_shipping_discount]" value="0" />
    151                 <input type="checkbox" name="data[promotional_shipping_discount]" value="1" id="promotional_shipping_discount" {% if data.promotional_shipping_discount == 1 %}checked="checked"{% endif %} />
    152               </div>
    153             </div>
    154 
    155             <div id="national-container-flat" style="display:none;" class="shipping-national-container">
    156               <div class="form-group">
    157                 <div class="col-sm-2">
    158                   <div class="row">
    159                     <div class="col-sm-12 text-right">
    160                       <p><label class="control-label text-right">{{ text_shipping_nat }}</label></p>
    161                     </div>
    162                   </div>
    163                   <div class="row">
    164                     <div class="col-sm-12 text-right">
    165                       <p><a class="btn btn-primary" onclick="addShipping('national', 'flat');" id="add-national-flat"><i class="fa fa-plus-circle"></i> {{ button_add }}</a></p>
    166                     </div>
    167                   </div>
    168                 </div>
    169                 <div class="col-sm-10">
    170                   <div class="row">
    171                     <div class="col-sm-12" id="options-national-flat">{{ html_national_flat }}</div>
    172                   </div>
    173                 </div>
    174               </div>
    175             </div>
    176 
    177             {% if setting.shipping_types.calculated == 1 %}
    178             <div id="national-container-calculated" style="display:none;" class="shipping-national-container">
    179               <div class="form-group">
    180                 <label class="col-sm-2 control-label">{{ text_shipping_handling_nat }}</label>
    181                 <div class="col-sm-10">
    182                   <input type="text" name="data[national][calculated][handling_fee]" id="national-handling-fee" class="form-control" value="{{ data.national.calculated.handling_fee }}" />
    183                 </div>
    184               </div>
    185               <div class="form-group">
    186                 <div class="col-sm-2">
    187                   <div class="row">
    188                     <div class="col-sm-12 text-right">
    189                       <p><label class="control-label text-right">{{ text_shipping_nat }}</label></p>
    190                     </div>
    191                   </div>
    192                   <div class="row">
    193                     <div class="col-sm-12 text-right">
    194                       <p><a class="btn btn-primary" onclick="addShipping('national', 'calculated');" id="add-national-calculated"><i class="fa fa-plus-circle"></i> {{ button_add }}</a></p>
    195                     </div>
    196                   </div>
    197                 </div>
    198                 <div class="col-sm-10">
    199                   <div class="row">
    200                     <div class="col-sm-12" id="options-national-calculated">{{ html_national_calculated }}</div>
    201                   </div>
    202                 </div>
    203               </div>
    204             </div>
    205             {% endif %}
    206 
    207             {% if setting.shipping_types.freight == 1 %}
    208             <div id="national-container-freight" style="display:none;" class="shipping-national-container">
    209               <div class="form-group">
    210                 <label class="col-sm-2 control-label">{{ text_shipping_in_desc }}</label>
    211                 <div class="col-sm-10">
    212                   <input type="hidden" name="data[national][freight][in_description]" value="0" />
    213                   <input type="checkbox" name="data[national][freight][in_description]" value="1" {% if data.national.freight.in_description == 1 %}checked="checked"{% endif %} />
    214                 </div>
    215               </div>
    216             </div>
    217             {% endif %}
    218 
    219             <div class="form-group">
    220               <label class="col-sm-2 control-label">{{ text_shipping_type_int }}</label>
    221               <div class="col-sm-10">
    222                 <select name="data[international][shipping_type]" class="form-control" id="shipping-type-international">
    223                   {% if setting.shipping_types.flat == 1 %}<option value="flat"{% if data.international.shipping_type == "flat" %} selected{% endif %}>{{ text_shipping_flat }}</option>{% endif %}
    224                   {% if setting.shipping_types.calculated == 1 %}<option value="calculated"{% if data.international.shipping_type == "calculated" %} selected{% endif %}>{{ text_shipping_calculated }}</option>{% endif %}
    225                 </select>
    226               </div>
    227             </div>
    228 
    229             <div class="form-group">
    230               <label class="col-sm-2 control-label"><span data-toggle="tooltip" title="{{ help_shipping_promotion_discount_international }}">{{ entry_shipping_promotion_discount_international }}</span></label>
    231               <div class="col-sm-10">
    232                 <input type="hidden" name="data[promotional_shipping_discount_international]" value="0" />
    233                 <input type="checkbox" name="data[promotional_shipping_discount_international]" value="1" id="promotional_shipping_discount_international" {% if data.promotional_shipping_discount_international == 1 %}checked="checked"{% endif %} />
    234               </div>
    235             </div>
    236 
    237             <div id="international-container-flat" style="display:none;" class="shipping-international-container">
    238               <div class="form-group">
    239                 <div class="col-sm-2">
    240                   <div class="row">
    241                     <div class="col-sm-12 text-right">
    242                       <p><label class="control-label text-right">{{ text_shipping_intnat }}</label></p>
    243                     </div>
    244                   </div>
    245                   <div class="row">
    246                     <div class="col-sm-12 text-right">
    247                       <p><a class="btn btn-primary" onclick="addShipping('international', 'flat');" id="add-international-flat"><i class="fa fa-plus-circle"></i> {{ button_add }}</a></p>
    248                     </div>
    249                   </div>
    250                 </div>
    251                 <div class="col-sm-10">
    252                   <div class="row">
    253                     <div class="col-sm-12" id="options-international-flat">
    254                       {{ html_international_flat }}
    255                     </div>
    256                   </div>
    257                 </div>
    258               </div>
    259             </div>
    260 
    261             {% if setting.shipping_types.calculated == 1 %}
    262               <div id="international-container-calculated" style="display:none;" class="shipping-international-container">
    263                 <div class="form-group">
    264                   <label class="col-sm-2 control-label">{{ text_shipping_handling_nat }}</label>
    265                   <div class="col-sm-10">
    266                     <input type="text" name="data[international][calculated][handling_fee]" id="international-handling-fee" class="form-control" value="{{ data.international.calculated.handling_fee }}" />
    267                   </div>
    268                 </div>
    269                 <div class="form-group">
    270                   <div class="col-sm-2">
    271                     <div class="row">
    272                       <div class="col-sm-12 text-right">
    273                         <p><label class="control-label text-right">{{ text_shipping_intnat }}</label></p>
    274                       </div>
    275                     </div>
    276                     <div class="row">
    277                       <div class="col-sm-12 text-right">
    278                         <p><a class="btn btn-primary" onclick="addShipping('international', 'calculated');" id="add-international-calculated"><i class="fa fa-plus-circle"></i> {{ button_add }}</a></p>
    279                       </div>
    280                     </div>
    281                   </div>
    282                   <div class="col-sm-10">
    283                     <div class="row">
    284                       <div class="col-sm-12" id="options-international-calculated">
    285                         {{ html_international_calculated }}
    286                       </div>
    287                     </div>
    288                   </div>
    289                 </div>
    290               </div>
    291             {% endif %}
    292           </div>
    293         </div>
    294       </form>
    295       </div>
    296     </div>
    297   </div>
    298 </div>
    299 <script type="text/javascript"><!--
    300   $(document).ready(function() {
    301     changeNationalType();
    302     changeInternationalType();
    303   });
    304 
    305   $('#shipping-type-national').bind('change', function() {
    306     changeNationalType();
    307   });
    308 
    309   $('#shipping-type-international').bind('change', function() {
    310     changeInternationalType();
    311   });
    312 
    313   function changeNationalType() {
    314     var shipping_type = $('#shipping-type-national').val();
    315 
    316     $('.shipping-national-container').hide();
    317     $('#national-container-'+shipping_type).fadeIn();
    318   }
    319 
    320   function changeInternationalType() {
    321     var shipping_type = $('#shipping-type-international').val();
    322 
    323     $('.shipping-international-container').hide();
    324     $('#international-container-'+shipping_type).fadeIn();
    325   }
    326 
    327   function addShipping(id, type) {
    328     if (id == 'national') {
    329         var loc = '0';
    330     } else {
    331         var loc = '1';
    332     }
    333 
    334     var count = $('#' + type + '_count_' + id).val();
    335     count = parseInt(count);
    336 
    337     $.ajax({
    338       url: 'index.php?route=extension/openbay/ebay/getShippingService&user_token={{ user_token }}&loc=' + loc + '&type=' + type,
    339       beforeSend: function(){
    340         $('#add-' + id + '-' + type).empty().html('<i class="fa fa-cog fa-lg fa-spin"></i>').attr('disabled','disabled');
    341       },
    342       type: 'GET',
    343       dataType: 'json',
    344       success: function(data) {
    345         html = '';
    346         html += '<div class="well" id="' + id + '_' + type + '_' + count + '">';
    347           html += '<div class="row form-group">';
    348             html += '<div class="col-sm-1 text-right">';
    349               html += '<label class="control-label">{{ text_shipping_service }}<label>';
    350             html += '</div>';
    351             html += '<div class="col-sm-11">';
    352               html += '<select name="data[' + id + '][' + type + '][service_id][' + count + ']" class="form-control">';
    353                 $.each(data.service, function(key, val) {
    354                   html += '<option value="' + key + '">' + val.description + '</option>';
    355                 });
    356               html += '</select>';
    357             html += '</div>';
    358           html += '</div>';
    359           if (id == 'international') {
    360             html += '<div class="row form-group">';
    361               html += '<div class="col-sm-1 text-right">';
    362                 html += '<label class="control-label">{{ text_shipping_zones }}</label>';
    363               html += '</div>';
    364               html += '<div class="col-sm-10">';
    365                 html += '<label class="checkbox-inline">';
    366                   html += '<input type="checkbox" name="data[' + id + '][' + type + '][shipto][' + count + '][]" value="Worldwide" />';
    367                   html += ' {{ text_shipping_worldwide }}';
    368                 html += '</label>';
    369                 {% for zone in shipping_international_zones %}
    370                   html += '<label class="checkbox-inline">';
    371                     html += '<input type="checkbox" name="data[' + id + '][' + type + '][shipto][' + count + '][]" value="{{ zone.shipping_location }}" />';
    372                     html += ' {{ zone.description }}';
    373                   html += '</label>';
    374                 {% endfor %}
    375               html += '</div>';
    376             html += '</div>';
    377           }
    378           html += '<div class="row form-group">';
    379             if (type != 'calculated') {
    380               html += '<div class="col-sm-1 text-right">';
    381                 html += '<label class="control-label">{{ text_shipping_first }}</label>';
    382               html += '</div>';
    383               html += '<div class="col-sm-3">';
    384                 html += '<input type="text" name="data[' + id + '][' + type + '][price][' + count + ']" class="form-control" value="0.00" class="form-control" />';
    385               html += '</div>';
    386               html += '<div class="col-sm-2 text-right">';
    387                 html += '<label class="control-label">{{ text_shipping_add }}</label>';
    388               html += '</div>';
    389               html += '<div class="col-sm-3">';
    390                 html += '<input type="text" name="data[' + id + '][' + type + '][price_additional][' + count + ']" class="form-control" value="0.00" />';
    391               html += '</div>';
    392             }
    393             html += '<div class="col-sm-3 pull-right text-right">';
    394               html += '<a onclick="removeShipping(\'' + id + '\',\'' + count + '\',\''+type+'\');" class="btn btn-danger"><i class="fa fa-minus-circle"></i> {{ button_delete }}</a>';
    395             html += '</div>';
    396           html += '</div>';
    397         html += '</div>';
    398 
    399         $('#options-' + id + '-' + type).append(html);
    400         $('#add-' + id + '-' + type).empty().html('<i class="fa fa-plus-circle"></i> {{ button_add }}').removeAttr('disabled');
    401       },
    402       error: function (xhr, ajaxOptions, thrownError) {
    403         $('#add-shipping-'+id).empty().html('<i class="fa fa-plus-circle"></i> {{ button_add }}').removeAttr('disabled');
    404         if (xhr.status != 0) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); }
    405       }
    406     });
    407 
    408     $('#' + type + '_count_' + id).val(count + 1);
    409   }
    410 
    411   function removeShipping(id, count, type) {
    412     $('#' + id + '_' + type + '_' + count).remove();
    413   }
    414 //--></script>
    415 {{ footer }}