• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP TaxRulesGroup类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中TaxRulesGroup的典型用法代码示例。如果您正苦于以下问题:PHP TaxRulesGroup类的具体用法?PHP TaxRulesGroup怎么用?PHP TaxRulesGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TaxRulesGroup类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: renderForm

 public function renderForm()
 {
     $this->fields_form = array('legend' => array('title' => $this->l('Carriers'), 'icon' => 'icon-truck'), 'input' => array(array('type' => 'text', 'label' => $this->l('Company'), 'name' => 'name', 'required' => true, 'hint' => array(sprintf($this->l('Allowed characters: letters, spaces and %s'), '().-'), $this->l('Carrier name displayed during checkout'), $this->l('For in-store pickup, enter 0 to replace the carrier name with your shop name.'))), array('type' => 'file', 'label' => $this->l('Logo'), 'name' => 'logo', 'hint' => $this->l('Upload a logo from your computer.') . ' (.gif, .jpg, .jpeg ' . $this->l('or') . ' .png)'), array('type' => 'text', 'label' => $this->l('Transit time'), 'name' => 'delay', 'lang' => true, 'required' => true, 'maxlength' => 128, 'hint' => $this->l('Estimated delivery time will be displayed during checkout.')), array('type' => 'text', 'label' => $this->l('Speed grade'), 'name' => 'grade', 'required' => false, 'hint' => $this->l('Enter "0" for a longest shipping delay, or "9" for the shortest shipping delay.')), array('type' => 'text', 'label' => $this->l('URL'), 'name' => 'url', 'hint' => $this->l('Delivery tracking URL: Type \'@\' where the tracking number should appear. It will then be automatically replaced by the tracking number.')), array('type' => 'checkbox', 'label' => $this->l('Zone'), 'name' => 'zone', 'values' => array('query' => Zone::getZones(false), 'id' => 'id_zone', 'name' => 'name'), 'hint' => $this->l('The zones in which this carrier will be used.')), array('type' => 'group', 'label' => $this->l('Group access'), 'name' => 'groupBox', 'values' => Group::getGroups(Context::getContext()->language->id), 'hint' => $this->l('Mark the groups that are allowed access to this carrier.')), array('type' => 'switch', 'label' => $this->l('Status'), 'name' => 'active', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled'))), 'hint' => $this->l('Enable the carrier in the Front Office.')), array('type' => 'switch', 'label' => $this->l('Apply shipping cost'), 'name' => 'is_free', 'required' => false, 'class' => 't', 'values' => array(array('id' => 'is_free_on', 'value' => 0, 'label' => '<img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '" />'), array('id' => 'is_free_off', 'value' => 1, 'label' => '<img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '" />')), 'hint' => $this->l('Apply both regular shipping cost and product-specific shipping costs.')), array('type' => 'select', 'label' => $this->l('Tax'), 'name' => 'id_tax_rules_group', 'options' => array('query' => TaxRulesGroup::getTaxRulesGroups(true), 'id' => 'id_tax_rules_group', 'name' => 'name', 'default' => array('label' => $this->l('No Tax'), 'value' => 0))), array('type' => 'switch', 'label' => $this->l('Shipping and handling'), 'name' => 'shipping_handling', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'shipping_handling_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'shipping_handling_off', 'value' => 0, 'label' => $this->l('Disabled'))), 'hint' => $this->l('Include the shipping and handling costs in the carrier price.')), array('type' => 'radio', 'label' => $this->l('Billing'), 'name' => 'shipping_method', 'required' => false, 'class' => 't', 'br' => true, 'values' => array(array('id' => 'billing_default', 'value' => Carrier::SHIPPING_METHOD_DEFAULT, 'label' => $this->l('Default behavior')), array('id' => 'billing_price', 'value' => Carrier::SHIPPING_METHOD_PRICE, 'label' => $this->l('According to total price')), array('id' => 'billing_weight', 'value' => Carrier::SHIPPING_METHOD_WEIGHT, 'label' => $this->l('According to total weight')))), array('type' => 'select', 'label' => $this->l('Out-of-range behavior'), 'name' => 'range_behavior', 'options' => array('query' => array(array('id' => 0, 'name' => $this->l('Apply the cost of the highest defined range')), array('id' => 1, 'name' => $this->l('Disable carrier'))), 'id' => 'id', 'name' => 'name'), 'hint' => $this->l('Out-of-range behavior occurs when none is defined (e.g. when a customer\'s cart weight is greater than the highest range limit).')), array('type' => 'text', 'label' => $this->l('Maximum package height'), 'name' => 'max_height', 'required' => false, 'hint' => $this->l('Maximum height managed by this carrier. Set the value to "0," or leave this field blank to ignore.')), array('type' => 'text', 'label' => $this->l('Maximum package width'), 'name' => 'max_width', 'required' => false, 'hint' => $this->l('Maximum width managed by this carrier. Set the value to "0," or leave this field blank to ignore.')), array('type' => 'text', 'label' => $this->l('Maximum package depth'), 'name' => 'max_depth', 'required' => false, 'hint' => $this->l('Maximum depth managed by this carrier. Set the value to "0," or leave this field blank to ignore.')), array('type' => 'text', 'label' => $this->l('Maximum package weight'), 'name' => 'max_weight', 'required' => false, 'hint' => $this->l('Maximum weight managed by this carrier. Set the value to "0," or leave this field blank to ignore.')), array('type' => 'hidden', 'name' => 'is_module'), array('type' => 'hidden', 'name' => 'external_module_name'), array('type' => 'hidden', 'name' => 'shipping_external'), array('type' => 'hidden', 'name' => 'need_range')));
     if (Shop::isFeatureActive()) {
         $this->fields_form['input'][] = array('type' => 'shop', 'label' => $this->l('Shop association'), 'name' => 'checkBoxShopAsso');
     }
     $this->fields_form['submit'] = array('title' => $this->l('Save'));
     if (!($obj = $this->loadObject(true))) {
         return;
     }
     $this->getFieldsValues($obj);
     return parent::renderForm();
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:13,代码来源:AdminCarriersController.php


示例2: __construct

 public function __construct()
 {
     $this->className = 'Configuration';
     $this->table = 'configuration';
     parent::__construct();
     // List of CMS tabs
     $cms_tab = array(0 => array('id' => 0, 'name' => $this->l('None')));
     foreach (CMS::listCms($this->context->language->id) as $cms_file) {
         $cms_tab[] = array('id' => $cms_file['id_cms'], 'name' => $cms_file['meta_title']);
     }
     // List of order process types
     $order_process_type = array(array('value' => PS_ORDER_PROCESS_STANDARD, 'name' => $this->l('Standard (5 steps)')), array('value' => PS_ORDER_PROCESS_OPC, 'name' => $this->l('One page checkout')));
     $this->fields_options = array('general' => array('title' => $this->l('General'), 'icon' => 'tab-preferences', 'fields' => array('PS_ORDER_PROCESS_TYPE' => array('title' => $this->l('Order process type'), 'desc' => $this->l('You can choose the order process type as either standard (5 steps) or One Page Checkout'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $order_process_type, 'identifier' => 'value'), 'PS_GUEST_CHECKOUT_ENABLED' => array('title' => $this->l('Enable guest checkout'), 'desc' => $this->l('Guests can place an order without registering'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_PURCHASE_MINIMUM' => array('title' => $this->l('Minimum purchase total required in order to validate order'), 'desc' => $this->l('Set to 0 to disable this feature'), 'validation' => 'isFloat', 'cast' => 'floatval', 'type' => 'price'), 'PS_ALLOW_MULTISHIPPING' => array('title' => $this->l('Allow multi-shipping'), 'desc' => $this->l('Allow the customer to ship his order to multiple addresses. This option will convert the customer\'s cart into one or more orders.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_SHIP_WHEN_AVAILABLE' => array('title' => $this->l('Delayed shipping'), 'desc' => $this->l('Allow the customer to split his order: one with the products currently "in stock", and another with the other products. This option will convert the customer\'s cart into two orders.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_CONDITIONS' => array('title' => $this->l('Terms of service'), 'desc' => $this->l('Require customers to accept or decline terms of service before processing the order'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'js' => array('on' => 'onchange="changeCMSActivationAuthorization()"', 'off' => 'onchange="changeCMSActivationAuthorization()"')), 'PS_CONDITIONS_CMS_ID' => array('title' => $this->l('Conditions of use CMS page'), 'desc' => $this->l('Choose the Conditions of use CMS page'), 'validation' => 'isInt', 'type' => 'select', 'list' => $cms_tab, 'identifier' => 'id', 'cast' => 'intval'))), 'gift' => array('title' => $this->l('Gift options'), 'icon' => 'tab-preferences', 'fields' => array('PS_GIFT_WRAPPING' => array('title' => $this->l('Offer gift-wrapping'), 'desc' => $this->l('Suggest gift-wrapping to customer and possibility of leaving a message'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_GIFT_WRAPPING_PRICE' => array('title' => $this->l('Gift-wrapping price'), 'desc' => $this->l('Set a price for gift-wrapping'), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'price'), 'PS_GIFT_WRAPPING_TAX_RULES_GROUP' => array('title' => $this->l('Gift-wrapping tax'), 'desc' => $this->l('Set a tax for gift-wrapping'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => array_merge(array(array('id_tax_rules_group' => 0, 'name' => $this->l('None'))), TaxRulesGroup::getTaxRulesGroups(true)), 'identifier' => 'id_tax_rules_group'), 'PS_RECYCLABLE_PACK' => array('title' => $this->l('Offer recycled packaging'), 'desc' => $this->l('Suggest recycled packaging to customer'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool')), 'submit' => array('title' => $this->l('Save'), 'class' => 'button')));
 }
开发者ID:jicheng17,项目名称:pengwine,代码行数:14,代码来源:AdminOrderPreferencesController.php


示例3: __construct

 public function __construct()
 {
     global $cookie;
     $this->table = 'tax';
     $this->className = 'Tax';
     $this->lang = true;
     $this->edit = true;
     $this->delete = true;
     $this->fieldsDisplay = array('id_tax' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Name'), 'width' => 140), 'rate' => array('title' => $this->l('Rate'), 'align' => 'center', 'suffix' => '%', 'width' => 50), 'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false));
     $this->optionTitle = $this->l('Tax options');
     $this->_fieldsOptions = array('PS_TAX' => array('title' => $this->l('Enable tax:'), 'desc' => $this->l('Select whether or not to include tax on purchases'), 'cast' => 'intval', 'type' => 'bool'), 'PS_TAX_DISPLAY' => array('title' => $this->l('Display tax in cart:'), 'desc' => $this->l('Select whether or not to display tax on a distinct line in the cart'), 'cast' => 'intval', 'type' => 'bool'), 'PS_TAX_ADDRESS_TYPE' => array('title' => $this->l('Base on:'), 'cast' => 'pSQL', 'type' => 'select', 'list' => array(array('name' => $this->l('Invoice Address'), 'id' => 'id_address_invoice'), array('name' => $this->l('Delivery Address'), 'id' => 'id_address_delivery')), 'identifier' => 'id'), 'PS_USE_ECOTAX' => array('title' => $this->l('Use ecotax'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'));
     if (Configuration::get('PS_USE_ECOTAX')) {
         $this->_fieldsOptions['PS_ECOTAX_TAX_RULES_GROUP_ID'] = array('title' => $this->l('Ecotax:'), 'desc' => $this->l('The tax to apply on the ecotax (e.g., French ecotax: 19.6%).'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_tax', 'identifier' => 'id_tax_rules_group', 'list' => TaxRulesGroup::getTaxRulesGroupsForOptions());
     }
     parent::__construct();
 }
开发者ID:hecbuma,项目名称:quali-fisioterapia,代码行数:16,代码来源:AdminTaxes.php


示例4: __construct

 public function __construct()
 {
     $this->bootstrap = true;
     $this->className = 'Configuration';
     $this->table = 'configuration';
     parent::__construct();
     // List of CMS tabs
     $cms_tab = array(0 => array('id' => 0, 'name' => $this->l('None')));
     foreach (CMS::listCms($this->context->language->id) as $cms_file) {
         $cms_tab[] = array('id' => $cms_file['id_cms'], 'name' => $cms_file['meta_title']);
     }
     // List of order process types
     $order_process_type = array(array('value' => PS_ORDER_PROCESS_STANDARD, 'name' => $this->l('Standard (Five steps)')), array('value' => PS_ORDER_PROCESS_OPC, 'name' => $this->l('One-page checkout')));
     $this->fields_options = array('general' => array('title' => $this->l('General'), 'icon' => 'icon-cogs', 'fields' => array('PS_ORDER_PROCESS_TYPE' => array('title' => $this->l('Order process type'), 'hint' => $this->l('Please choose either the five-step or one-page checkout process.'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $order_process_type, 'identifier' => 'value'), 'PS_GUEST_CHECKOUT_ENABLED' => array('title' => $this->l('Enable guest checkout'), 'hint' => $this->l('Allow guest visitors to place an order without registering.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_DISALLOW_HISTORY_REORDERING' => array('title' => $this->l('Disable Reordering Option'), 'hint' => $this->l('Disable the option to allow customers to reorder in one click from the order history page (required in some European countries).'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_PURCHASE_MINIMUM' => array('title' => $this->l('Minimum purchase total required in order to validate the order'), 'hint' => $this->l('Set to 0 to disable this feature.'), 'validation' => 'isFloat', 'cast' => 'floatval', 'type' => 'price'), 'PS_ALLOW_MULTISHIPPING' => array('title' => $this->l('Allow multishipping'), 'hint' => $this->l('Allow the customer to ship orders to multiple addresses. This option will convert the customer\'s cart into one or more orders.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_SHIP_WHEN_AVAILABLE' => array('title' => $this->l('Delayed shipping'), 'hint' => $this->l('Allows you to delay shipping at your customers\' request. '), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_CONDITIONS' => array('title' => $this->l('Terms of service'), 'hint' => $this->l('Require customers to accept or decline terms of service before processing an order.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'js' => array('on' => 'onchange="changeCMSActivationAuthorization()"', 'off' => 'onchange="changeCMSActivationAuthorization()"')), 'PS_CONDITIONS_CMS_ID' => array('title' => $this->l('CMS page for the Conditions of use'), 'hint' => $this->l('Choose the CMS page which contains your store\'s conditions of use.'), 'validation' => 'isInt', 'type' => 'select', 'list' => $cms_tab, 'identifier' => 'id', 'cast' => 'intval')), 'submit' => array('title' => $this->l('Save'))), 'gift' => array('title' => $this->l('Gift options'), 'icon' => 'icon-gift', 'fields' => array('PS_GIFT_WRAPPING' => array('title' => $this->l('Offer gift wrapping'), 'hint' => $this->l('Suggest gift-wrapping to customers.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_GIFT_WRAPPING_PRICE' => array('title' => $this->l('Gift-wrapping price'), 'hint' => $this->l('Set a price for gift wrapping.'), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'price'), 'PS_GIFT_WRAPPING_TAX_RULES_GROUP' => array('title' => $this->l('Gift-wrapping tax'), 'hint' => $this->l('Set a tax for gift wrapping.'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => array_merge(array(array('id_tax_rules_group' => 0, 'name' => $this->l('None'))), TaxRulesGroup::getTaxRulesGroups(true)), 'identifier' => 'id_tax_rules_group'), 'PS_RECYCLABLE_PACK' => array('title' => $this->l('Offer recycled packaging'), 'hint' => $this->l('Suggest recycled packaging to customer.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool')), 'submit' => array('title' => $this->l('Save'))));
     if (!Configuration::get('PS_ALLOW_MULTISHIPPING')) {
         unset($this->fields_options['general']['fields']['PS_ALLOW_MULTISHIPPING']);
     }
 }
开发者ID:NathanGiesbrecht,项目名称:PrestaShopAutomationFramework,代码行数:18,代码来源:AdminOrderPreferencesController.php


示例5: __construct

 public function __construct()
 {
     $this->table = 'tax';
     $this->className = 'Tax';
     $this->lang = true;
     $this->addRowAction('edit');
     $this->addRowAction('delete');
     $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')), 'enableSelection' => array('text' => $this->l('Enable selection')), 'disableSelection' => array('text' => $this->l('Disable selection')));
     $this->fields_list = array('id_tax' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Name'), 'width' => 'auto'), 'rate' => array('title' => $this->l('Rate'), 'align' => 'center', 'suffix' => '%', 'width' => 50), 'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false));
     $ecotax_desc = '';
     if (Configuration::get('PS_USE_ECOTAX')) {
         $ecotax_desc = $this->l('If you disable the ecotax, the ecotax for all your products will be set to 0');
     }
     $this->fields_options = array('general' => array('title' => $this->l('Tax options'), 'fields' => array('PS_TAX' => array('title' => $this->l('Enable tax:'), 'desc' => $this->l('Select whether or not to include tax on purchases'), 'cast' => 'intval', 'type' => 'bool'), 'PS_TAX_DISPLAY' => array('title' => $this->l('Display tax in cart:'), 'desc' => $this->l('Select whether or not to display tax on a distinct line in the cart'), 'cast' => 'intval', 'type' => 'bool'), 'PS_TAX_ADDRESS_TYPE' => array('title' => $this->l('Base on:'), 'cast' => 'pSQL', 'type' => 'select', 'list' => array(array('name' => $this->l('Invoice Address'), 'id' => 'id_address_invoice'), array('name' => $this->l('Delivery Address'), 'id' => 'id_address_delivery')), 'identifier' => 'id'), 'PS_USE_ECOTAX' => array('title' => $this->l('Use ecotax'), 'desc' => $ecotax_desc, 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool')), 'submit' => array()));
     if (Configuration::get('PS_USE_ECOTAX')) {
         $this->fields_options['general']['fields']['PS_ECOTAX_TAX_RULES_GROUP_ID'] = array('title' => $this->l('Ecotax:'), 'desc' => $this->l('The tax to apply on the ecotax (e.g. French ecotax: 19.6%).'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_tax', 'identifier' => 'id_tax_rules_group', 'list' => TaxRulesGroup::getTaxRulesGroupsForOptions());
     }
     parent::__construct();
 }
开发者ID:rrameshsat,项目名称:Prestashop,代码行数:19,代码来源:AdminTaxesController.php


示例6: __construct

 public function __construct()
 {
     $this->bootstrap = true;
     $this->className = 'Configuration';
     $this->table = 'configuration';
     parent::__construct();
     // List of CMS tabs
     $cms_tab = array(0 => array('id' => 0, 'name' => $this->trans('None', array(), 'Admin.Global')));
     foreach (CMS::listCms($this->context->language->id) as $cms_file) {
         $cms_tab[] = array('id' => $cms_file['id_cms'], 'name' => $cms_file['meta_title']);
     }
     $this->fields_options = array('general' => array('title' => $this->trans('General', array(), 'Admin.Global'), 'icon' => 'icon-cogs', 'fields' => array('PS_FINAL_SUMMARY_ENABLED' => array('title' => $this->trans('Enable final summary', array(), 'Admin.ShopParameters.Feature'), 'hint' => $this->trans('Display an overview of the addresses, shipping method and cart just before the order button (required in some European countries).', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_GUEST_CHECKOUT_ENABLED' => array('title' => $this->trans('Enable guest checkout', array(), 'Admin.ShopParameters.Feature'), 'hint' => $this->trans('Allow guest visitors to place an order without registering.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_DISALLOW_HISTORY_REORDERING' => array('title' => $this->trans('Disable Reordering Option', array(), 'Admin.ShopParameters.Feature'), 'hint' => $this->trans('Disable the option to allow customers to reorder in one click from the order history page (required in some European countries).', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_PURCHASE_MINIMUM' => array('title' => $this->trans('Minimum purchase total required in order to validate the order', array(), 'Admin.ShopParameters.Feature'), 'hint' => $this->trans('Set to 0 to disable this feature.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isFloat', 'cast' => 'floatval', 'type' => 'price'), 'PS_ORDER_RECALCULATE_SHIPPING' => array('title' => $this->trans('Recalculate shipping cost after order edition', array(), 'Admin.ShopParameters.Feature'), 'hint' => $this->trans('Automatically updates the shipping costs when you edit an order.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_ALLOW_MULTISHIPPING' => array('title' => $this->trans('Allow multishipping', array(), 'Admin.ShopParameters.Feature'), 'hint' => $this->trans('Allow the customer to ship orders to multiple addresses. This option will convert the customer\'s cart into one or more orders.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_SHIP_WHEN_AVAILABLE' => array('title' => $this->trans('Delayed shipping', array(), 'Admin.ShopParameters.Feature'), 'hint' => $this->trans('Allows you to delay shipping at your customers\' request.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_CONDITIONS' => array('title' => $this->trans('Terms of service', array(), 'Admin.ShopParameters.Feature'), 'hint' => $this->trans('Require customers to accept or decline terms of service before processing an order.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'js' => array('on' => 'onchange="changeCMSActivationAuthorization()"', 'off' => 'onchange="changeCMSActivationAuthorization()"')), 'PS_CONDITIONS_CMS_ID' => array('title' => $this->trans('Page for the Terms and conditions', array(), 'Admin.ShopParameters.Feature'), 'hint' => $this->trans('Choose the page which contains your store\'s terms and conditions of use.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isInt', 'type' => 'select', 'list' => $cms_tab, 'identifier' => 'id', 'cast' => 'intval')), 'submit' => array('title' => $this->trans('Save', array(), 'Admin.Actions'))), 'gift' => array('title' => $this->trans('Gift options', array(), 'Admin.ShopParameters.Feature'), 'icon' => 'icon-gift', 'fields' => array('PS_GIFT_WRAPPING' => array('title' => $this->trans('Offer gift wrapping', array(), 'Admin.ShopParameters.Feature'), 'hint' => $this->trans('Suggest gift-wrapping to customers.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_GIFT_WRAPPING_PRICE' => array('title' => $this->trans('Gift-wrapping price', array(), 'Admin.ShopParameters.Feature'), 'hint' => $this->trans('Set a price for gift wrapping.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'price'), 'PS_GIFT_WRAPPING_TAX_RULES_GROUP' => array('title' => $this->trans('Gift-wrapping tax', array(), 'Admin.ShopParameters.Feature'), 'hint' => $this->trans('Set a tax for gift wrapping.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => array_merge(array(array('id_tax_rules_group' => 0, 'name' => $this->trans('None'))), TaxRulesGroup::getTaxRulesGroups(true)), 'identifier' => 'id_tax_rules_group'), 'PS_RECYCLABLE_PACK' => array('title' => $this->trans('Offer recycled packaging', array(), 'Admin.ShopParameters.Feature'), 'hint' => $this->trans('Suggest recycled packaging to customer.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool')), 'submit' => array('title' => $this->trans('Save', array(), 'Admin.Actions'))));
     if (!Configuration::get('PS_ALLOW_MULTISHIPPING')) {
         unset($this->fields_options['general']['fields']['PS_ALLOW_MULTISHIPPING']);
     }
     if (Configuration::get('PS_ATCP_SHIPWRAP')) {
         unset($this->fields_options['gift']['fields']['PS_GIFT_WRAPPING_TAX_RULES_GROUP']);
     }
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:19,代码来源:AdminOrderPreferencesController.php


示例7: __construct

 public function __construct()
 {
     $this->bootstrap = true;
     $this->table = 'tax';
     $this->className = 'Tax';
     $this->lang = true;
     $this->addRowAction('edit');
     $this->addRowAction('delete');
     parent::__construct();
     $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash'));
     $this->fields_list = array('id_tax' => array('title' => $this->trans('ID', array(), 'Admin.Global'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'name' => array('title' => $this->trans('Name', array(), 'Admin.Global'), 'width' => 'auto'), 'rate' => array('title' => $this->l('Rate'), 'align' => 'center', 'suffix' => '%', 'class' => 'fixed-width-md'), 'active' => array('title' => $this->trans('Enabled', array(), 'Admin.Global'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false, 'class' => 'fixed-width-sm', 'remove_onclick' => true));
     $ecotax_desc = '';
     if (Configuration::get('PS_USE_ECOTAX')) {
         $ecotax_desc = $this->l('If you disable the ecotax, the ecotax for all your products will be set to 0.');
     }
     $this->fields_options = array('general' => array('title' => $this->l('Tax options'), 'fields' => array('PS_TAX' => array('title' => $this->l('Enable tax'), 'desc' => $this->l('Select whether or not to include tax on purchases.'), 'cast' => 'intval', 'type' => 'bool'), 'PS_TAX_DISPLAY' => array('title' => $this->l('Display tax in the shopping cart'), 'desc' => $this->l('Select whether or not to display tax on a distinct line in the cart.'), 'cast' => 'intval', 'type' => 'bool'), 'PS_TAX_ADDRESS_TYPE' => array('title' => $this->l('Based on'), 'cast' => 'pSQL', 'type' => 'select', 'list' => array(array('name' => $this->l('Invoice address'), 'id' => 'id_address_invoice'), array('name' => $this->l('Delivery address'), 'id' => 'id_address_delivery')), 'identifier' => 'id'), 'PS_USE_ECOTAX' => array('title' => $this->l('Use ecotax'), 'desc' => $ecotax_desc, 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool')), 'submit' => array('title' => $this->trans('Save', array(), 'Admin.Actions'))));
     if (Configuration::get('PS_USE_ECOTAX') || Tools::getValue('PS_USE_ECOTAX')) {
         $this->fields_options['general']['fields']['PS_ECOTAX_TAX_RULES_GROUP_ID'] = array('title' => $this->l('Ecotax'), 'hint' => $this->l('Define the ecotax (e.g. French ecotax: 19.6%).'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_tax_rules_group', 'list' => TaxRulesGroup::getTaxRulesGroupsForOptions());
     }
     $this->_where .= ' AND a.deleted = 0';
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:21,代码来源:AdminTaxesController.php


示例8: priceCalculation


//.........这里部分代码省略.........
    public static function priceCalculation($id_shop, $id_product, $id_product_attribute, $id_country, $id_state, $id_county, $id_currency, $id_group, $quantity, $use_tax, $decimals, $only_reduc, $use_reduc, $with_ecotax, &$specific_price, $use_groupReduction)
    {
        // Caching
        if ($id_product_attribute === NULL) {
            $product_attribute_label = 'NULL';
        } else {
            $product_attribute_label = $id_product_attribute === false ? 'false' : $id_product_attribute;
        }
        $cacheId = $id_product . '-' . $id_shop . '-' . $id_currency . '-' . $id_country . '-' . $id_state . '-' . $id_county . '-' . $id_group . '-' . $quantity . '-' . $product_attribute_label . '-' . ($use_tax ? '1' : '0') . '-' . $decimals . '-' . ($only_reduc ? '1' : '0') . '-' . ($use_reduc ? '1' : '0') . '-' . $with_ecotax;
        // reference parameter is filled before any returns
        $specific_price = SpecificPrice::getSpecificPrice((int) $id_product, $id_shop, $id_currency, $id_country, $id_group, $quantity);
        if (isset(self::$_prices[$cacheId])) {
            return self::$_prices[$cacheId];
        }
        // fetch price & attribute price
        $cacheId2 = $id_product . '-' . $id_product_attribute;
        if (!isset(self::$_pricesLevel2[$cacheId2])) {
            self::$_pricesLevel2[$cacheId2] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
			SELECT p.`price`,
			' . ($id_product_attribute ? 'pa.`price`' : 'IFNULL((SELECT pa.price FROM `' . _DB_PREFIX_ . 'product_attribute` pa WHERE id_product = ' . (int) $id_product . ' AND default_on = 1), 0)') . ' AS attribute_price,
			p.`ecotax`
			' . ($id_product_attribute ? ', pa.`ecotax` AS attribute_ecotax' : '') . '
			FROM `' . _DB_PREFIX_ . 'product` p
			' . ($id_product_attribute ? 'LEFT JOIN `' . _DB_PREFIX_ . 'product_attribute` pa ON pa.`id_product_attribute` = ' . (int) $id_product_attribute : '') . '
			WHERE p.`id_product` = ' . (int) $id_product);
        }
        $result = self::$_pricesLevel2[$cacheId2];
        $price = (double) (!$specific_price or $specific_price['price'] == 0) ? $result['price'] : $specific_price['price'];
        // convert only if the specific price is in the default currency (id_currency = 0)
        if (!$specific_price or !($specific_price['price'] > 0 and $specific_price['id_currency'])) {
            $price = Tools::convertPrice($price, $id_currency);
        }
        // Attribute price
        $attribute_price = Tools::convertPrice(array_key_exists('attribute_price', $result) ? (double) $result['attribute_price'] : 0, $id_currency);
        if ($id_product_attribute !== false) {
            // If you want the default combination, please use NULL value instead
            $price += $attribute_price;
        }
        // TaxRate calculation
        $tax_rate = Tax::getProductTaxRateViaRules((int) $id_product, (int) $id_country, (int) $id_state, (int) $id_county);
        if ($tax_rate === false) {
            $tax_rate = 0;
        }
        // Add Tax
        if ($use_tax) {
            $price = $price * (1 + $tax_rate / 100);
        }
        $price = Tools::ps_round($price, $decimals);
        // Reduction
        $reduc = 0;
        if (($only_reduc or $use_reduc) and $specific_price) {
            if ($specific_price['reduction_type'] == 'amount') {
                $reduction_amount = $specific_price['reduction'];
                if (!$specific_price['id_currency']) {
                    $reduction_amount = Tools::convertPrice($reduction_amount, $id_currency);
                }
                $reduc = Tools::ps_round(!$use_tax ? $reduction_amount / (1 + $tax_rate / 100) : $reduction_amount, $decimals);
            } else {
                $reduc = Tools::ps_round($price * $specific_price['reduction'], $decimals);
            }
        }
        if ($only_reduc) {
            return $reduc;
        }
        if ($use_reduc) {
            $price -= $reduc;
        }
        // Group reduction
        if ($use_groupReduction) {
            if ($reductionFromCategory = (double) GroupReduction::getValueForProduct($id_product, $id_group)) {
                $price -= $price * $reductionFromCategory;
            } else {
                // apply group reduction if there is no group reduction for this category
                $price *= (100 - Group::getReductionByIdGroup($id_group)) / 100;
            }
        }
        $price = Tools::ps_round($price, $decimals);
        // Eco Tax
        if (($result['ecotax'] or isset($result['attribute_ecotax'])) and $with_ecotax) {
            $ecotax = $result['ecotax'];
            if (isset($result['attribute_ecotax']) && $result['attribute_ecotax'] > 0) {
                $ecotax = $result['attribute_ecotax'];
            }
            if ($id_currency) {
                $ecotax = Tools::convertPrice($ecotax, $id_currency);
            }
            if ($use_tax) {
                $taxRate = TaxRulesGroup::getTaxesRate((int) Configuration::get('PS_ECOTAX_TAX_RULES_GROUP_ID'), (int) $id_country, (int) $id_state, (int) $id_county);
                $price += $ecotax * (1 + $taxRate / 100);
            } else {
                $price += $ecotax;
            }
        }
        $price = Tools::ps_round($price, $decimals);
        if ($price < 0) {
            $price = 0;
        }
        self::$_prices[$cacheId] = $price;
        return self::$_prices[$cacheId];
    }
开发者ID:srikanthash09,项目名称:codetestdatld,代码行数:101,代码来源:Product.php


示例9: getTaxesRate

 public static function getTaxesRate($id_tax_rules_group, $id_country, $id_state, $id_county)
 {
     $rate = 0;
     foreach (TaxRulesGroup::getTaxes($id_tax_rules_group, $id_country, $id_state, $id_county) as $tax) {
         $rate += (double) $tax->rate;
     }
     return $rate;
 }
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:8,代码来源:TaxRulesGroup.php


示例10: displayForm


//.........这里部分代码省略.........
        $groups = Group::getGroups((int) $cookie->id_lang);
        if (sizeof($groups)) {
            echo '
					<table cellspacing="0" cellpadding="0" class="table" style="width: 28em;">
						<tr>
							<th><input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, \'groupBox[]\', this.checked)"' . (!isset($obj->id) ? 'checked="checked" ' : '') . ' /></th>
							<th>' . $this->l('ID') . '</th>
							<th>' . $this->l('Group name') . '</th>
						</tr>';
            $irow = 0;
            foreach ($groups as $group) {
                echo '
							<tr class="' . ($irow++ % 2 ? 'alt_row' : '') . '">
								<td><input type="checkbox" name="groupBox[]" class="groupBox" id="groupBox_' . $group['id_group'] . '" value="' . $group['id_group'] . '" ' . ((Db::getInstance()->getValue('SELECT id_group FROM ' . _DB_PREFIX_ . 'carrier_group WHERE id_carrier=' . (int) $obj->id . ' AND id_group=' . (int) $group['id_group']) or !isset($obj->id)) ? 'checked="checked" ' : '') . '/></td>
								<td>' . $group['id_group'] . '</td>
								<td><label for="groupBox_' . $group['id_group'] . '" class="t">' . $group['name'] . '</label></td>
							</tr>';
            }
            echo '
					</table>
					<p style="padding:0px; margin:10px 0px 10px 0px;">' . $this->l('Mark all groups you want to give access to this carrier') . '</p>
					';
        } else {
            echo '<p>' . $this->l('No group created') . '</p>';
        }
        echo '				</div>
				<label>' . $this->l('Status:') . ' </label>
				<div class="margin-form">
					<input type="radio" name="active" id="active_on" value="1" ' . ($this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '') . '/>
					<label class="t" for="active_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
					<input type="radio" name="active" id="active_off" value="0" ' . (!$this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '') . '/>
					<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
					<p>' . $this->l('Include or exclude carrier from list of carriers on Front Office') . '</p>
				</div>
				<label>' . $this->l('Apply shipping cost:') . ' </label>
				<div class="margin-form">
					<input type="radio" name="is_free" id="is_free_on" value="0" ' . (!$this->getFieldValue($obj, 'is_free') ? 'checked="checked" ' : '') . '/>
					<label class="t" for="active_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '" /></label>
					<input type="radio" name="is_free" id="is_free_off" value="1" ' . ($this->getFieldValue($obj, 'is_free') ? 'checked="checked" ' : '') . '/>
					<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '" /></label>
					<p>' . $this->l('Apply shipping costs and additional shipping costs by products in carrier price') . '</p>
				</div>
				<div id="shipping_costs_div">
				<label>' . $this->l('Tax') . '</label>
				<div class="margin-form">
					 <select name="id_tax_rules_group" id="id_tax_rules_group" ' . (Tax::excludeTaxeOption() ? 'disabled="disabled"' : '') . '>
					    <option value="0">' . $this->l('No Tax') . '</option>';
        foreach (TaxRulesGroup::getTaxRulesGroups(true) as $tax_rules_group) {
            echo '<option value="' . $tax_rules_group['id_tax_rules_group'] . '" ' . ($this->getFieldValue($obj, 'id_tax_rules_group') == $tax_rules_group['id_tax_rules_group'] ? ' selected="selected"' : '') . '>' . $tax_rules_group['name'] . '</option>';
        }
        echo '</select>
				</div>
				<label>' . $this->l('Shipping & handling:') . ' </label>
				<div class="margin-form">
					<input type="radio" name="shipping_handling" id="shipping_handling_on" value="1" ' . ($this->getFieldValue($obj, 'shipping_handling') ? 'checked="checked" ' : '') . '/>
					<label class="t" for="shipping_handling_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
					<input type="radio" name="shipping_handling" id="shipping_handling_off" value="0" ' . (!$this->getFieldValue($obj, 'shipping_handling') ? 'checked="checked" ' : '') . '/>
					<label class="t" for="shipping_handling_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
					<p>' . $this->l('Include the shipping & handling costs in carrier price') . '</p>
				</div>
				<label>' . $this->l('Billing:') . ' </label>
				<div class="margin-form">
					<input type="radio" name="shipping_method" id="billing_default" value="' . Carrier::SHIPPING_METHOD_DEFAULT . '" ' . ($this->getFieldValue($obj, 'shipping_method') == Carrier::SHIPPING_METHOD_DEFAULT ? 'checked="checked" ' : '') . '/>
					<label class="t" for="billing_default">' . $this->l('Default behavior') . '</label><br />
					<input type="radio" name="shipping_method" id="billing_price" value="' . Carrier::SHIPPING_METHOD_PRICE . '" ' . ($this->getFieldValue($obj, 'shipping_method') == Carrier::SHIPPING_METHOD_PRICE ? 'checked="checked" ' : '') . '/>
					<label class="t" for="billing_price">' . $this->l('According to total price') . '</label><br />
					<input type="radio" name="shipping_method" id="billing_weight" value="' . Carrier::SHIPPING_METHOD_WEIGHT . '" ' . ($this->getFieldValue($obj, 'shipping_method') == Carrier::SHIPPING_METHOD_WEIGHT ? 'checked="checked" ' : '') . '/>
					<label class="t" for="billing_weight">' . $this->l('According to total weight') . '</label><br />
				</div>
				<label>' . $this->l('Out-of-range behavior:') . ' </label>
				<div class="margin-form">
					<select name="range_behavior">
						<option value="0"' . (!$this->getFieldValue($obj, 'range_behavior') ? ' selected="selected"' : '') . '>' . $this->l('Apply the cost of the highest defined range') . '</option>
						<option value="1"' . ($this->getFieldValue($obj, 'range_behavior') ? ' selected="selected"' : '') . '>' . $this->l('Disable carrier') . '</option>
					</select>
					<p>' . $this->l('Out-of-range behavior when none is defined (e.g., when a customer\'s cart weight is greater than the highest range limit)') . '</p>
				</div>';
        if ($this->getFieldValue($obj, 'is_module')) {
            echo '<label>' . $this->l('Module:') . ' </label>
						  <div class="margin-form"><p> - ' . $this->l('This carrier is bound to this module ') . ' => ' . $this->getFieldValue($obj, 'external_module_name') . '</p>
						  <input type="hidden" name="is_module" value="1">
						  <input type="hidden" name="external_module_name" value="' . $this->getFieldValue($obj, 'external_module_name') . '">';
            if ($this->getFieldValue($obj, 'shipping_external')) {
                echo '<p> - ' . $this->l('The shipping costs are calculated outside of your shop') . '</p>
						<input type="hidden" name="shipping_external" value="1">';
            }
            if ($this->getFieldValue($obj, 'need_range')) {
                echo '<p> - ' . $this->l('This carrier uses PrestaShop range to calculate shipping costs') . '</p>
						<input type="hidden" name="need_range" value="1">';
            }
            echo '</div>';
        }
        echo '</div>
				<div class="margin-form">
					<input type="submit" value="' . $this->l('   Save   ') . '" name="submitAdd' . $this->table . '" class="button" />
				</div>
				<div class="small"><sup>*</sup> ' . $this->l('Required field') . '</div>
			</fieldset>
		</form>';
    }
开发者ID:srikanthash09,项目名称:codetestdatld,代码行数:101,代码来源:AdminCarriers.php


示例11: getProductTaxRateViaRules

 /**
  * Return the product tax rate using the tax rules system
  *
  * @param integer $id_product
  * @param integer $id_country
  * @return Tax
  *
  * @deprecated since 1.5
  */
 public static function getProductTaxRateViaRules($id_product, $id_country, $id_state, $zipcode)
 {
     Tools::displayAsDeprecated();
     if (!isset(self::$_product_tax_via_rules[$id_product . '-' . $id_country . '-' . $id_state . '-' . $zipcode])) {
         $tax_rate = TaxRulesGroup::getTaxesRate((int) Product::getIdTaxRulesGroupByIdProduct((int) $id_product), (int) $id_country, (int) $id_state, $zipcode);
         self::$_product_tax_via_rules[$id_product . '-' . $id_country . '-' . $zipcode] = $tax_rate;
     }
     return self::$_product_tax_via_rules[$id_product . '-' . $id_country . '-' . $zipcode];
 }
开发者ID:IngenioContenidoDigital,项目名称:americana,代码行数:18,代码来源:Tax.php


示例12: getTaxesRate

 public static function getTaxesRate($id_tax_rules_group, $id_country, $id_state, $id_county)
 {
     if (!Configuration::get('PS_TAX')) {
         return 0;
     }
     $state = new State((int) $id_state);
     /* Case 1: We need to multiply the taxes (example: Canadian law) */
     if (Country::getIsoById((int) $id_country) == self::$canada_iso && in_array($state->iso_code, self::$canada_states_iso)) {
         $rate = 1;
         foreac 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP TbArray类代码示例发布时间:2022-05-23
下一篇:
PHP TaxManagerFactory类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap