Пример #1
0
        foreach ($shipFormData['shipMethCurr'] as $rec) {
            $dbcurr = $rec['currency'];
            $currFieldValues['min'][$dbcurr] = $rec['min_value'];
            $currFieldValues['max'][$dbcurr] = $rec['max_value'];
        }
    }
    // Default curr field valuy
    $fieldData['DefFieldValues'] = $currFieldValues;
    $fieldData['shipping_type'] = 3;
} else {
    // New method
    $fieldData['shipping_type'] = 1;
    $fieldData['minFieldAmt'] = !empty($shipFormData['min_value']) ? $shipFormData['min_value'] : '';
    $fieldData['maxFieldAmt'] = !empty($shipFormData['max_value']) ? $shipFormData['max_value'] : '';
}
$fieldHtml = $qtczoneShipHelper->getFieldHtmlForShippingType($fieldData);
$fieldHtml = json_decode($fieldHtml, 1);
?>
		<div class="control-group">
			<label  for="qtcMinAmount" class="control-label" title="<?php 
echo JText::_('PLG_QTC_DEFAULT_ZONESHIPPING_MINIMUM_AMT_TITLE');
?>
" id="qtcCreateMethMinFieldLable">
				<?php 
echo "* " . $fieldHtml['minFieldLable'];
?>
			</label>
			<div class="controls" id="qtcCreateMethMinField">
				<!--
				<input id="qtcMinAmount" name="shipForm[min_value]" class="input-large bill inputbox required validate-name" type="text" value="<?php 
echo !empty($shipFormData['min_value']) ? $shipFormData['min_value'] : '0';
 /**
  * This method handles all ajax related things;
  *
  * @param   object  $jinput  Joomla's jinput Object.
  *
  * @since   1.0
  * @return   Json format result.
  */
 function TjShip_AjaxCallHandler($jinput)
 {
     $post = $jinput->post;
     $qtcshiphelper = new qtcshiphelper();
     $qtczoneShipHelper = new qtczoneShipHelper();
     $ajaxTask = $jinput->get('plugtask');
     if (empty($ajaxTask)) {
         $ajaxTask = $post->get('plugtask');
     }
     switch ($ajaxTask) {
         case "addShipMethRate":
             $result = $qtcshiphelper->addShipMethRate($jinput);
             break;
         case "qtcDelshipMethRate":
             $result = $qtcshiphelper->qtcDelshipMethRate($jinput);
             break;
         case "updateShipMethRate":
             $result = $qtcshiphelper->qtcUpdateShipMethRate($jinput);
             break;
         case "getFieldHtmlForShippingType":
             $fieldData = $jinput->get('fieldData', array(), "ARRAY");
             $result = $qtczoneShipHelper->getFieldHtmlForShippingType($fieldData);
             break;
     }
     // Return json formatted result
     return $result;
 }