Exemple #1
0
 public static function getSpecialPricingContent()
 {
     global $lC_Language, $lC_Currencies, $pInfo;
     $content = '';
     $groups = lC_Customer_groups_Admin::getAll();
     foreach ($groups['entries'] as $key => $value) {
         if ($value['customers_group_id'] == 1) {
             // remove this line when specials per group is reintroduced
             $base = isset($pInfo) ? (double) $pInfo->get('products_price') : 0.0;
             $special = isset($pInfo) ? (double) $pInfo->get('products_special_price') : 0.0;
             $discount = isset($base) && $base > 0.0 ? round(($base - $special) / $base * 100, DECIMAL_PLACES) : 0.0;
             $content .= '<!--<label for="products_special_pricing_enable' . $value['customers_group_id'] . '" class="label margin-right"><b>' . $value['customers_group_name'] . '</b></label>-->' . '<div class="columns">' . '  <div class="new-row-mobile twelve-columns twelve-columns-mobile mid-margin-bottom">' . '    <input id="products_special_pricing_enable' . $value['customers_group_id'] . '" name="products_special_pricing_enable' . $value['customers_group_id'] . '" type="checkbox" class="margin-right medium switch"' . ($pInfo->get('products_special_status') != 0 && $value['customers_group_id'] == '1' ? ' checked' : '') . ' />' . '    <div class="inputs' . ($value['customers_group_id'] == '1' ? '' : ' disabled grey') . '" style="display:inline; padding:8px 0;">' . '      <span class="mid-margin-left no-margin-right">' . $lC_Currencies->getSymbolLeft() . '</span>' . '      <input type="text" onfocus="this.select();" onchange="updatePricingDiscountDisplay();" name="products_special_price[' . $value['customers_group_id'] . ']" id="products_special_price' . $value['customers_group_id'] . '" value="' . ($value['customers_group_id'] == '1' ? number_format($pInfo->get('products_special_price'), DECIMAL_PLACES) : '0.00') . '" class="sprice input-unstyled small-margin-right' . ($value['customers_group_id'] == '1' ? '' : ' grey disabled') . '" style="width:60px;"' . ($value['customers_group_id'] == '1' ? '' : ' READONLY') . '/>' . '    </div>' . '    <small class="input-info mid-margin-left no-wrap">' . $lC_Language->get('text_special_price') . ($value['customers_group_id'] == '1' ? '<span class="disctag tag glossy mid-margin-left">-' . number_format($discount, DECIMAL_PLACES) . '%</span>' : '') . '</small>' . '  </div>' . '  <div class="new-row-mobile twelve-columns twelve-columns-mobile">' . '    <span class="nowrap margin-right">' . '      <span class="input small-margin-top">' . '        <input name="products_special_start_date[' . $value['customers_group_id'] . ']" id="products_special_start_date' . $value['customers_group_id'] . '" type="text" placeholder="Start" class="input-unstyled datepicker' . ($value['customers_group_id'] == '1' ? '' : ' disabled') . '" value="' . $pInfo->get('products_special_start_date') . '" style="width:97px;" />' . '      </span>' . '      <span class="icon-calendar icon-size2 small-margin-left"></span>' . '    </span>' . '    <span class="nowrap">' . '      <span class="input small-margin-top">' . '        <input name="products_special_expires_date[' . $value['customers_group_id'] . ']" id="products_special_expires_date' . $value['customers_group_id'] . '" type="text" placeholder="End" class="input-unstyled datepicker' . ($value['customers_group_id'] == '1' ? '' : ' disabled') . '" value="' . $pInfo->get('products_special_expires_date') . '" style="width:97px;" />' . '      </span>' . '      <span class="icon-calendar icon-size2 small-margin-left"></span>' . '    </span>' . '  </div>' . '</div>';
         }
         // remove this line when specials per group is reintroduced
     }
     return $content;
 }
    var prow = '<tr id="trp-' + ref + '" class="trp-' + id + '"><td width="100px" class="strong">' + groupTitle + '</td></tr>' + pitemsInput;
     
    // if the group already exists, remove it before adding
    $("#simpleOptionsTable tr td:contains('" + groupTitle + "')").each(function() {
      $(this).closest('tr').remove();
    });
    // also remove it on the pricing table
    $(".simple-options-pricing-table tr td:contains('" + groupTitle + "')").each(function() {
      $(this).closest('tr').remove();
      $('.trp-' + id).remove();
    });   
    //          
    $('#simpleOptionsTable > tbody').append(row);
    
    var customerGroups = <?php 
echo json_encode(lC_Customer_groups_Admin::getAll());
?>
; 
    $.each(customerGroups.entries, function(key, val) { 
      
      var noOptions = $("#tbody-simple-options-pricing-" + val.customers_group_id).length;
      if (noOptions == 0) {
        $('#no-options-' + val.customers_group_id).remove();
        var pTable = '<div class="simple-options-pricing-container">' +
                     '  <div class="big-text underline margin-top" style="padding-bottom:8px;"><?php 
echo $lC_Language->get('text_simple_options');
?>
</div>' +
                     '  <table class="simple-table simple-options-pricing-table">' +
                     '    <tbody id="tbody-simple-options-pricing-' + val.customers_group_id + '"></tbody>' +
                     '  </table>' +
Exemple #3
0
 public static function getAll()
 {
     $result = lC_Customer_groups_Admin::getAll();
     $result['rpcStatus'] = RPC_STATUS_SUCCESS;
     echo json_encode($result);
 }