本文整理汇总了PHP中JSFactory::getShippingExtList方法的典型用法代码示例。如果您正苦于以下问题:PHP JSFactory::getShippingExtList方法的具体用法?PHP JSFactory::getShippingExtList怎么用?PHP JSFactory::getShippingExtList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSFactory
的用法示例。
在下文中一共展示了JSFactory::getShippingExtList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calculateSum
function calculateSum(&$cart)
{
$jshopConfig = JSFactory::getConfig();
if ($this->getGlobalConfigPriceNull($cart)) {
return 0;
}
$price = $this->shipping_stand_price;
$package = $this->package_stand_price;
$prices = array('shipping' => $price, 'package' => $package);
$extensions = JSFactory::getShippingExtList($this->shipping_method_id);
foreach ($extensions as $extension) {
if (isset($extension->exec->version) && $extension->exec->version == 2) {
$prices = $extension->exec->getPrices($cart, $this->getParams(), $prices, $extension, $this);
$price = $prices['shipping'];
} else {
$price = $extension->exec->getPrice($cart, $this->getParams(), $price, $extension, $this);
$prices = array('shipping' => $price, 'package' => $package);
}
}
$prices['shipping'] = $prices['shipping'] * $jshopConfig->currency_value;
$prices['shipping'] = getPriceCalcParamsTax($prices['shipping'], $this->shipping_tax_id, $cart->products);
$prices['package'] = $prices['package'] * $jshopConfig->currency_value;
$prices['package'] = getPriceCalcParamsTax($prices['package'], $this->package_tax_id, $cart->products);
return $prices;
}
示例2: edit
function edit()
{
$jshopConfig = JSFactory::getConfig();
$sh_pr_method_id = JRequest::getInt('sh_pr_method_id');
$shipping_id_back = JRequest::getInt("shipping_id_back");
$db = JFactory::getDBO();
$sh_method_price = JSFactory::getTable('shippingMethodPrice', 'jshop');
$sh_method_price->load($sh_pr_method_id);
$sh_method_price->prices = $sh_method_price->getPrices();
if ($jshopConfig->tax) {
$taxes = JSFactory::getModel("taxes");
$all_taxes = $taxes->getAllTaxes();
$list_tax = array();
foreach ($all_taxes as $tax) {
$list_tax[] = JHTML::_('select.option', $tax->tax_id, $tax->tax_name . ' (' . $tax->tax_value . '%)', 'tax_id', 'tax_name');
}
$list_tax[] = JHTML::_('select.option', -1, _JSHOP_PRODUCT_TAX_RATE, 'tax_id', 'tax_name');
$lists['taxes'] = JHTML::_('select.genericlist', $list_tax, 'shipping_tax_id', 'class="inputbox"', 'tax_id', 'tax_name', $sh_method_price->shipping_tax_id);
$lists['package_taxes'] = JHTML::_('select.genericlist', $list_tax, 'package_tax_id', 'class="inputbox"', 'tax_id', 'tax_name', $sh_method_price->package_tax_id);
}
$shippings = JSFactory::getModel("shippings");
$countries = JSFactory::getModel("countries");
$actived = $sh_method_price->shipping_method_id;
if (!$actived) {
$actived = $shipping_id_back;
}
$lists['shipping_methods'] = JHTML::_('select.genericlist', $shippings->getAllShippings(0), 'shipping_method_id', 'class = "inputbox" size = "1"', 'shipping_id', 'name', $actived);
$lists['countries'] = JHTML::_('select.genericlist', $countries->getAllCountries(0), 'shipping_countries_id[]', 'class = "inputbox" size = "10", multiple = "multiple"', 'country_id', 'name', $sh_method_price->getCountries());
if ($jshopConfig->admin_show_delivery_time) {
$_deliveryTimes = JSFactory::getModel("deliveryTimes");
$all_delivery_times = $_deliveryTimes->getDeliveryTimes();
$all_delivery_times0 = array();
$all_delivery_times0[0] = new stdClass();
$all_delivery_times0[0]->id = '0';
$all_delivery_times0[0]->name = _JSHOP_NONE;
$lists['deliverytimes'] = JHTML::_('select.genericlist', array_merge($all_delivery_times0, $all_delivery_times), 'delivery_times_id', 'class = "inputbox"', 'id', 'name', $sh_method_price->delivery_times_id);
}
$currency = JSFactory::getTable('currency', 'jshop');
$currency->load($jshopConfig->mainCurrency);
$extensions = JSFactory::getShippingExtList($actived);
$view = $this->getView("shippingsprices", 'html');
$view->setLayout("edit");
$view->assign('sh_method_price', $sh_method_price);
$view->assign('lists', $lists);
$view->assign('shipping_id_back', $shipping_id_back);
$view->assign('currency', $currency);
$view->assign('extensions', $extensions);
$view->assign('config', $jshopConfig);
$view->assign('etemplatevar', '');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeEditShippingsPrices', array(&$view));
$view->displayEdit();
}