本文整理汇总了PHP中getPriceCalcParamsTax函数的典型用法代码示例。如果您正苦于以下问题:PHP getPriceCalcParamsTax函数的具体用法?PHP getPriceCalcParamsTax怎么用?PHP getPriceCalcParamsTax使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getPriceCalcParamsTax函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getPrice
function getPrice()
{
$jshopConfig = JSFactory::getConfig();
if ($this->price_type == 2) {
$cart = $this->getCart();
$price = $cart->getSummForCalculePlusPayment() * $this->price / 100;
if ($jshopConfig->display_price_front_current) {
$price = getPriceCalcParamsTax($price, $this->tax_id, $cart->products);
}
} else {
$cart = $this->getCart();
$price = $this->price * $jshopConfig->currency_value;
$price = getPriceCalcParamsTax($price, $this->tax_id, $cart->products);
}
return $price;
}
示例3: getPrice
function getPrice()
{
$jshopConfig = JSFactory::getConfig();
if ($this->price_type == 2) {
$cart = $this->getCart();
$price = $cart->getSummForCalculePlusPayment() * $this->price / 100;
if ($jshopConfig->display_price_front_current) {
$price = getPriceCalcParamsTax($price, $this->tax_id, $cart->products);
}
} else {
$cart = $this->getCart();
$price = $this->price * $jshopConfig->currency_value;
$price = getPriceCalcParamsTax($price, $this->tax_id, $cart->products);
}
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onAfterGetPricePaymant', array(&$this, &$price));
return $price;
}
示例4: step3
function step3()
{
$checkout = JModelLegacy::getInstance('checkout', 'jshop');
$checkout->checkStep(3);
JPluginHelper::importPlugin('jshoppingcheckout');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onLoadCheckoutStep3', array());
$jshopConfig = JSFactory::getConfig();
$session = JFactory::getSession();
$cart = JModelLegacy::getInstance('cart', 'jshop');
$cart->load();
$user = JFactory::getUser();
if ($user->id) {
$adv_user = JSFactory::getUserShop();
} else {
$adv_user = JSFactory::getUserShopGuest();
}
appendPathWay(_JSHOP_CHECKOUT_PAYMENT);
$seo = JTable::getInstance("seo", "jshop");
$seodata = $seo->loadData("checkout-payment");
if ($seodata->title == "") {
$seodata->title = _JSHOP_CHECKOUT_PAYMENT;
}
setMetaData($seodata->title, $seodata->keyword, $seodata->description);
$checkout_navigator = $this->_showCheckoutNavigation(3);
if ($jshopConfig->show_cart_all_step_checkout) {
$small_cart = $this->_showSmallCart(3);
} else {
$small_cart = '';
}
if ($jshopConfig->without_payment) {
$checkout->setMaxStep(4);
$this->setRedirect(SEFLink('index.php?option=com_jshopping&controller=checkout&task=step4', 0, 1, $jshopConfig->use_ssl));
return 0;
}
$paymentmethod = JTable::getInstance('paymentmethod', 'jshop');
$shipping_id = $cart->getShippingId();
$all_payment_methods = $paymentmethod->getAllPaymentMethods(1, $shipping_id);
$i = 0;
$paym = array();
foreach ($all_payment_methods as $pm) {
$paym[$i] = new stdClass();
$paymentsysdata = $paymentmethod->getPaymentSystemData($pm->payment_class);
if ($paymentsysdata->paymentSystem) {
$paym[$i]->existentcheckform = 1;
$paym[$i]->payment_system = $paymentsysdata->paymentSystem;
} else {
$paym[$i]->existentcheckform = 0;
}
$paym[$i]->name = $pm->name;
$paym[$i]->payment_id = $pm->payment_id;
$paym[$i]->payment_class = $pm->payment_class;
$paym[$i]->payment_description = $pm->description;
$paym[$i]->price_type = $pm->price_type;
$paym[$i]->image = $pm->image;
$paym[$i]->price_add_text = '';
if ($pm->price_type == 2) {
$paym[$i]->calculeprice = $pm->price;
if ($paym[$i]->calculeprice != 0) {
if ($paym[$i]->calculeprice > 0) {
$paym[$i]->price_add_text = '+' . $paym[$i]->calculeprice . '%';
} else {
$paym[$i]->price_add_text = $paym[$i]->calculeprice . '%';
}
}
} else {
$paym[$i]->calculeprice = getPriceCalcParamsTax($pm->price * $jshopConfig->currency_value, $pm->tax_id, $cart->products);
if ($paym[$i]->calculeprice != 0) {
if ($paym[$i]->calculeprice > 0) {
$paym[$i]->price_add_text = '+' . formatprice($paym[$i]->calculeprice);
} else {
$paym[$i]->price_add_text = formatprice($paym[$i]->calculeprice);
}
}
}
$s_payment_method_id = $cart->getPaymentId();
if ($s_payment_method_id == $pm->payment_id) {
$params = $cart->getPaymentParams();
} else {
$params = array();
}
$parseString = new parseString($pm->payment_params);
$pmconfig = $parseString->parseStringToParams();
if ($paym[$i]->existentcheckform) {
ob_start();
$paym[$i]->payment_system->showPaymentForm($params, $pmconfig);
$paym[$i]->form = ob_get_contents();
ob_get_clean();
} else {
$paym[$i]->form = "";
}
$i++;
}
$s_payment_method_id = $cart->getPaymentId();
$active_payment = intval($s_payment_method_id);
if (!$active_payment) {
$list_payment_id = array();
foreach ($paym as $v) {
$list_payment_id[] = $v->payment_id;
}
//.........这里部分代码省略.........
示例5: listProductUpdateData
function listProductUpdateData($products, $setUrl = 0)
{
$jshopConfig = JSFactory::getConfig();
$userShop = JSFactory::getUserShop();
$taxes = JSFactory::getAllTaxes();
if ($jshopConfig->product_list_show_manufacturer) {
$manufacturers = JSFactory::getAllManufacturer();
}
if ($jshopConfig->product_list_show_vendor) {
$vendors = JSFactory::getAllVendor();
}
if ($jshopConfig->show_delivery_time) {
$deliverytimes = JSFactory::getAllDeliveryTime();
}
$image_path = $jshopConfig->image_product_live_path;
$noimage = $jshopConfig->noimage;
JPluginHelper::importPlugin('jshoppingproducts');
$dispatcher = JDispatcher::getInstance();
foreach ($products as $key => $value) {
$dispatcher->trigger('onListProductUpdateDataProduct', array(&$products, &$key, &$value));
$use_userdiscount = 1;
if ($jshopConfig->user_discount_not_apply_prod_old_price && $products[$key]->product_old_price > 0) {
$use_userdiscount = 0;
}
$products[$key]->_original_product_price = $products[$key]->product_price;
$products[$key]->product_price_wp = $products[$key]->product_price;
$products[$key]->product_price_default = 0;
if ($jshopConfig->product_list_show_min_price) {
if ($products[$key]->min_price > 0) {
$products[$key]->product_price = $products[$key]->min_price;
}
}
$products[$key]->show_price_from = 0;
if ($jshopConfig->product_list_show_min_price && $value->different_prices) {
$products[$key]->show_price_from = 1;
}
$products[$key]->product_price = getPriceFromCurrency($products[$key]->product_price, $products[$key]->currency_id);
$products[$key]->product_old_price = getPriceFromCurrency($products[$key]->product_old_price, $products[$key]->currency_id);
$products[$key]->product_price_wp = getPriceFromCurrency($products[$key]->product_price_wp, $products[$key]->currency_id);
$products[$key]->product_price = getPriceCalcParamsTax($products[$key]->product_price, $products[$key]->tax_id);
$products[$key]->product_old_price = getPriceCalcParamsTax($products[$key]->product_old_price, $products[$key]->tax_id);
$products[$key]->product_price_wp = getPriceCalcParamsTax($products[$key]->product_price_wp, $products[$key]->tax_id);
if ($userShop->percent_discount && $use_userdiscount) {
$products[$key]->product_price_default = $products[$key]->_original_product_price;
$products[$key]->product_price_default = getPriceFromCurrency($products[$key]->product_price_default, $products[$key]->currency_id);
$products[$key]->product_price_default = getPriceCalcParamsTax($products[$key]->product_price_default, $products[$key]->tax_id);
$products[$key]->product_price = getPriceDiscount($products[$key]->product_price, $userShop->percent_discount);
$products[$key]->product_old_price = getPriceDiscount($products[$key]->product_old_price, $userShop->percent_discount);
$products[$key]->product_price_wp = getPriceDiscount($products[$key]->product_price_wp, $userShop->percent_discount);
}
if ($jshopConfig->list_products_calc_basic_price_from_product_price) {
$products[$key]->basic_price_info = getProductBasicPriceInfo($value, $products[$key]->product_price_wp);
} else {
$products[$key]->basic_price_info = getProductBasicPriceInfo($value, $products[$key]->product_price);
}
if ($value->tax_id) {
$products[$key]->tax = $taxes[$value->tax_id];
}
if ($jshopConfig->product_list_show_manufacturer && $value->product_manufacturer_id && isset($manufacturers[$value->product_manufacturer_id])) {
$products[$key]->manufacturer = $manufacturers[$value->product_manufacturer_id];
} else {
$products[$key]->manufacturer = new stdClass();
$products[$key]->manufacturer->name = '';
}
if ($jshopConfig->admin_show_product_extra_field) {
$products[$key]->extra_field = getProductExtraFieldForProduct($value);
} else {
$products[$key]->extra_field = '';
}
if ($jshopConfig->product_list_show_vendor) {
$vendordata = $vendors[$value->vendor_id];
$vendordata->products = SEFLink("index.php?option=com_jshopping&controller=vendor&task=products&vendor_id=" . $vendordata->id, 1);
$products[$key]->vendor = $vendordata;
} else {
$products[$key]->vendor = '';
}
if ($jshopConfig->hide_delivery_time_out_of_stock && $products[$key]->product_quantity <= 0) {
$products[$key]->delivery_times_id = 0;
$value->delivery_times_id = 0;
}
if ($jshopConfig->show_delivery_time && $value->delivery_times_id) {
$products[$key]->delivery_time = $deliverytimes[$value->delivery_times_id];
} else {
$products[$key]->delivery_time = '';
}
$products[$key]->_display_price = getDisplayPriceForProduct($products[$key]->product_price);
if (!$products[$key]->_display_price) {
$products[$key]->product_old_price = 0;
$products[$key]->product_price_default = 0;
$products[$key]->basic_price_info['price_show'] = 0;
$products[$key]->tax = 0;
$jshopConfig->show_plus_shipping_in_product = 0;
}
if ($jshopConfig->product_list_show_qty_stock) {
$products[$key]->qty_in_stock = getDataProductQtyInStock($products[$key]);
}
$image = getPatchProductImage($products[$key]->image, 'thumb');
$products[$key]->product_name_image = $products[$key]->image;
$products[$key]->product_thumb_image = $image;
if (!$image) {
//.........这里部分代码省略.........
示例6: getList
public function getList()
{
/**
* Get data
*/
$db = JFactory::getDBO();
$data = array();
//select from
$source = trim($this->_params->get('source', 'js_categories'));
if ($source == 'js_categories') {
$catids = $this->_params->get('js_categories', '');
} else {
if ($this->_params->get('js_ids', '')) {
$ids = preg_split('/,/', $this->_params->get('js_ids', ''));
$ids_tmp = array();
foreach ($ids as $id) {
$ids_tmp[] = (int) trim($id);
}
}
}
if ($source == 'js_categories' && $catids && $this->_params->get('limit_items_for_each')) {
foreach ($catids as $catid) {
$query = $this->buildQuery($catid);
$db->setQuery($query);
$data = array_merge($data, $db->loadObjectlist());
}
} else {
if ($source == 'js_categories' && $catids) {
$query = $this->buildQuery($catids);
$db->setQuery($query);
$data = array_merge($data, $db->loadObjectlist());
} else {
if ($source == 'js_ids' && $ids_tmp && count($ids_tmp)) {
$query = $this->buildQuery(false, $ids_tmp);
$db->setQuery($query);
$data = array_merge($data, $db->loadObjectlist());
} else {
$query = $this->buildQuery(false, false);
$db->setQuery($query);
$data = array_merge($data, $db->loadObjectlist());
}
}
}
//add link
if (!class_exists('JSFactory')) {
return null;
}
$jshopConfig = JSFactory::getConfig();
$userShop = JSFactory::getUserShop();
foreach ($data as $product) {
$product->link = SEFLink('index.php?option=com_jshopping&controller=product&task=view&category_id=' . $product->category_id . '&product_id=' . $product->id, 1);
if ($jshopConfig->show_buy_in_category) {
if (!($jshopConfig->hide_buy_not_avaible_stock && $product->product_quantity <= 0)) {
$product->add_to_cart = '<a class="bt-addtocart" href="' . SEFLink('index.php?option=com_jshopping&controller=cart&task=add&category_id=' . $product->category_id . '&product_id=' . $product->id, 1) . '" title="' . sprintf(JText::_('ADD_PRODUCT_TO_CART'), $product->name) . '">' . JText::_('ADD_TO_CART') . '</a>';
}
}
if ($jshopConfig->image_product_live_path) {
$product->thumbnail = $jshopConfig->image_product_live_path . '/' . $product->thumbnail;
}
$product->category_link = SEFLink('index.php?option=com_jshopping&controller=category&task=view&category_id=' . $product->category_id, 1);
//calculate price
$product->product_price = getPriceFromCurrency($product->product_price, $product->currency_id);
$product->product_old_price = getPriceFromCurrency($product->product_old_price, $product->currency_id);
$product->product_price = getPriceCalcParamsTax($product->product_price, $product->product_tax_id);
$product->product_old_price = getPriceCalcParamsTax($product->product_old_price, $product->product_tax_id);
if ($userShop->percent_discount) {
$product->product_price = getPriceDiscount($product->product_price, $userShop->percent_discount);
$product->product_old_price = getPriceDiscount($product->product_old_price, $userShop->percent_discount);
}
$product->old_price = '';
if ($product->product_old_price) {
$product->old_price = formatprice($product->product_old_price);
}
if ($product->product_price) {
$product->sales_price = formatprice($product->product_price);
}
// title cut
$titleMaxChars = $this->_params->get('title_max_chars', '100');
$limit_title_by = $this->_params->get('limit_title_by', 'char');
$replacer = $this->_params->get('replacer', '...');
$isStrips = $this->_params->get("auto_strip_tags", 1);
$stringtags = '';
if ($limit_title_by == 'word' && $titleMaxChars > 0) {
$product->name_cut = self::substrword($product->name, $titleMaxChars, $replacer, $isStrips);
} elseif ($limit_title_by == 'char' && $titleMaxChars > 0) {
$product->name_cut = self::substring($product->name, $titleMaxChars, $replacer, $isStrips);
}
}
if (empty($data)) {
return array();
}
/**
* Get display and config params
*/
/* title */
$isStrips = $this->_params->get("auto_strip_tags", 1);
$stringtags = '';
if ($isStrips) {
$allow_tags = $this->_params->get("allow_tags", '');
$stringtags = '';
//.........这里部分代码省略.........
示例7: addPaymentMethods
/**
* добавляет область выборат способов оплаты
*/
public function addPaymentMethods()
{
$cart = JSFactory::getModel('cart', 'jshop');
$cart->load();
$paymentmethod = JSFactory::getTable('paymentmethod', 'jshop');
$shipping_id = $cart->getShippingId();
$all_payment_methods = $paymentmethod->getAllPaymentMethods(1, $shipping_id);
$i = 0;
$paym = array();
foreach ($all_payment_methods as $pm) {
$paym[$i] = new stdClass();
if ($pm->scriptname != '') {
$scriptname = $pm->scriptname;
} else {
$scriptname = $pm->payment_class;
}
$paymentmethod->load($pm->payment_id);
$paymentsysdata = $paymentmethod->getPaymentSystemData($scriptname);
if ($paymentsysdata->paymentSystem) {
$paym[$i]->existentcheckform = 1;
$paym[$i]->payment_system = $paymentsysdata->paymentSystem;
} else {
$paym[$i]->existentcheckform = 0;
}
$paym[$i]->name = $pm->name;
$paym[$i]->payment_id = $pm->payment_id;
$paym[$i]->payment_class = $pm->payment_class;
$paym[$i]->scriptname = $pm->scriptname;
$paym[$i]->payment_description = $pm->description;
$paym[$i]->price_type = $pm->price_type;
$paym[$i]->image = $pm->image;
$paym[$i]->price_add_text = '';
if ($pm->price_type == 2) {
$paym[$i]->calculeprice = $pm->price;
if ($paym[$i]->calculeprice != 0) {
if ($paym[$i]->calculeprice > 0) {
$paym[$i]->price_add_text = '+' . $paym[$i]->calculeprice . '%';
} else {
$paym[$i]->price_add_text = $paym[$i]->calculeprice . '%';
}
}
} else {
$paym[$i]->calculeprice = getPriceCalcParamsTax($pm->price * $jshopConfig->currency_value, $pm->tax_id, $cart->products);
if ($paym[$i]->calculeprice != 0) {
if ($paym[$i]->calculeprice > 0) {
$paym[$i]->price_add_text = '+' . formatprice($paym[$i]->calculeprice);
} else {
$paym[$i]->price_add_text = formatprice($paym[$i]->calculeprice);
}
}
}
$s_payment_method_id = $cart->getPaymentId();
if ($s_payment_method_id == $pm->payment_id) {
$params = $cart->getPaymentParams();
} else {
$params = array();
}
$parseString = new parseString($pm->payment_params);
$pmconfig = $parseString->parseStringToParams();
if ($paym[$i]->existentcheckform) {
$paym[$i]->form = $paymentmethod->loadPaymentForm($paym[$i]->payment_system, $params, $pmconfig);
} else {
$paym[$i]->form = "";
}
$i++;
}
$s_payment_method_id = $cart->getPaymentId();
$active_payment = intval($s_payment_method_id);
if (!$active_payment) {
$list_payment_id = array();
foreach ($paym as $v) {
$list_payment_id[] = $v->payment_id;
}
if (in_array($adv_user->payment_id, $list_payment_id)) {
$active_payment = $adv_user->payment_id;
}
}
if (!$active_payment) {
if (isset($paym[0])) {
$active_payment = $paym[0]->payment_id;
}
}
$html = '';
$html .= '<h2>' . _JSHOP_STEP_ORDER_3 . '</h2>';
$html .= '<div id="table_payments" class="form-inline">';
$payment_class = "";
foreach ($paym as $payment) {
if ($active_payment == $payment->payment_id) {
$payment_class = $payment->payment_class;
}
$html .= '<div class="name">';
if ($active_payment == $payment->payment_id) {
$checked = 'checked';
} else {
$checked = '';
}
$html .= '<input type="radio" name="payment_method" id="payment_method_' . $payment->payment_id . '" onclick="showPaymentForm(\'' . $payment->payment_class . '\')" value="' . $payment->payment_class . '" ' . $checked . ' />';
//.........这里部分代码省略.........
示例8: getBuildSelectAttributes
function getBuildSelectAttributes($attributeValues, $attributeActive, $displayonlyattrtype = null)
{
$jshopConfig = JSFactory::getConfig();
if (!$jshopConfig->admin_show_attributes) {
return array();
}
$dispatcher = JDispatcher::getInstance();
$attrib = JSFactory::getAllAttributes();
$userShop = JSFactory::getUserShop();
$selects = array();
foreach ($attrib as $k => $v) {
$attr_id = $v->attr_id;
if ($displayonlyattrtype) {
$v->attr_type = $displayonlyattrtype;
}
if (isset($attributeValues[$attr_id]) && $attributeValues[$attr_id]) {
if (isset($attributeActive[$attr_id])) {
$_firstval = $attributeActive[$attr_id];
} else {
$_firstval = 0;
}
$selects[$attr_id] = new stdClass();
$selects[$attr_id]->attr_id = $attr_id;
$selects[$attr_id]->attr_name = $v->name;
$selects[$attr_id]->attr_description = $v->description;
$selects[$attr_id]->groupname = $v->groupname;
$selects[$attr_id]->firstval = $_firstval;
$options = $attributeValues[$attr_id];
$attrimage = array();
foreach ($options as $k2 => $v2) {
$attrimage[$v2->val_id] = $v2->image;
$addPrice = $v2->addprice;
$addPrice = getPriceFromCurrency($addPrice, $this->currency_id);
$addPrice = getPriceCalcParamsTax($addPrice, $this->product_tax_id);
if ($userShop->percent_discount) {
$addPrice = getPriceDiscount($addPrice, $userShop->percent_discount);
}
$options[$k2]->addprice = $addPrice;
}
if ($v->attr_type == 1) {
// attribut type select
if ($jshopConfig->attr_display_addprice) {
foreach ($options as $k2 => $v2) {
if (($v2->price_mod == "+" || $v2->price_mod == "-" || $jshopConfig->attr_display_addprice_all_sign) && $v2->addprice > 0) {
$ext_price_info = " (" . $v2->price_mod . formatprice($v2->addprice, null, 0, -1) . ")";
$options[$k2]->value_name .= $ext_price_info;
}
}
}
if ($jshopConfig->product_attribut_first_value_empty) {
$first = array();
$first[] = JHTML::_('select.option', '0', _JSHOP_SELECT, 'val_id', 'value_name');
$options = array_merge($first, $options);
}
if (isset($attributeActive[$attr_id]) && isset($attrimage[$attributeActive[$attr_id]])) {
$_active_image = $attrimage[$attributeActive[$attr_id]];
} else {
$_active_image = '';
}
if (isset($attributeActive[$attr_id])) {
$_select_active = $attributeActive[$attr_id];
} else {
$_select_active = '';
}
$html_select_attribute_param = 'class="' . $jshopConfig->frontend_attribute_select_class_css . '" size = "' . $jshopConfig->frontend_attribute_select_size . '" onchange="setAttrValue(\'' . $attr_id . '\', this.value);"';
$selects[$attr_id]->selects = JHTML::_('select.genericlist', $options, 'jshop_attr_id[' . $attr_id . ']', $html_select_attribute_param, 'val_id', 'value_name', $_select_active) . "<span class='prod_attr_img'>" . $this->getHtmlDisplayProdAttrImg($attr_id, $_active_image) . "</span>";
$selects[$attr_id]->selects = str_replace(array("\n", "\r", "\t"), "", $selects[$attr_id]->selects);
} else {
// attribut type radio
foreach ($options as $k2 => $v2) {
if ($v2->image) {
$options[$k2]->value_name = "<img src='" . $jshopConfig->image_attributes_live_path . "/" . $v2->image . "' alt='' /> " . $v2->value_name;
}
}
if ($jshopConfig->attr_display_addprice) {
foreach ($options as $k2 => $v2) {
if (($v2->price_mod == "+" || $v2->price_mod == "-" || $jshopConfig->attr_display_addprice_all_sign) && $v2->addprice > 0) {
$ext_price_info = " (" . $v2->price_mod . formatprice($v2->addprice) . ")";
$options[$k2]->value_name .= $ext_price_info;
}
}
}
$radioseparator = '';
if ($jshopConfig->radio_attr_value_vertical) {
$radioseparator = "<br/>";
}
foreach ($options as $k2 => $v2) {
$options[$k2]->value_name = "<span class='radio_attr_label'>" . $v2->value_name . "</span>";
}
$selects[$attr_id]->selects = sprintRadioList($options, 'jshop_attr_id[' . $attr_id . ']', 'onclick="setAttrValue(\'' . $attr_id . '\', this.value);"', 'val_id', 'value_name', $attributeActive[$attr_id], $radioseparator);
$selects[$attr_id]->selects = str_replace(array("\n", "\r", "\t"), "", $selects[$attr_id]->selects);
}
$dispatcher->trigger('onBuildSelectAttribute', array(&$attributeValues, &$attributeActive, &$selects, &$options, &$attr_id, &$v));
}
}
$grname = '';
foreach ($selects as $k => $v) {
if ($v->groupname != $grname) {
$grname = $v->groupname;
$selects[$k]->grshow = 1;
//.........这里部分代码省略.........
示例9: getCheckoutListPayments
public function getCheckoutListPayments()
{
$jshopConfig = JSFactory::getConfig();
$cart = $this->getCart();
$paymentmethod = JSFactory::getTable('paymentmethod', 'jshop');
$shipping_id = $cart->getShippingId();
$all_payment_methods = $paymentmethod->getAllPaymentMethods(1, $shipping_id);
$i = 0;
$paym = array();
foreach ($all_payment_methods as $pm) {
$paym[$i] = new stdClass();
if ($pm->scriptname != '') {
$scriptname = $pm->scriptname;
} else {
$scriptname = $pm->payment_class;
}
$paymentmethod->load($pm->payment_id);
$paymentsysdata = $paymentmethod->getPaymentSystemData($scriptname);
if ($paymentsysdata->paymentSystem) {
$paym[$i]->existentcheckform = 1;
$paym[$i]->payment_system = $paymentsysdata->paymentSystem;
} else {
$paym[$i]->existentcheckform = 0;
}
$paym[$i]->name = $pm->name;
$paym[$i]->payment_id = $pm->payment_id;
$paym[$i]->payment_class = $pm->payment_class;
$paym[$i]->scriptname = $pm->scriptname;
$paym[$i]->payment_description = $pm->description;
$paym[$i]->price_type = $pm->price_type;
$paym[$i]->image = $pm->image;
$paym[$i]->price_add_text = '';
if ($pm->price_type == 2) {
$paym[$i]->calculeprice = $pm->price;
if ($paym[$i]->calculeprice != 0) {
if ($paym[$i]->calculeprice > 0) {
$paym[$i]->price_add_text = '+' . $paym[$i]->calculeprice . '%';
} else {
$paym[$i]->price_add_text = $paym[$i]->calculeprice . '%';
}
}
} else {
$paym[$i]->calculeprice = getPriceCalcParamsTax($pm->price * $jshopConfig->currency_value, $pm->tax_id, $cart->products);
if ($paym[$i]->calculeprice != 0) {
if ($paym[$i]->calculeprice > 0) {
$paym[$i]->price_add_text = '+' . formatprice($paym[$i]->calculeprice);
} else {
$paym[$i]->price_add_text = formatprice($paym[$i]->calculeprice);
}
}
}
$s_payment_method_id = $cart->getPaymentId();
if ($s_payment_method_id == $pm->payment_id) {
$params = $cart->getPaymentParams();
} else {
$params = array();
}
$parseString = new parseString($pm->payment_params);
$pmconfig = $parseString->parseStringToParams();
if ($paym[$i]->existentcheckform) {
$paym[$i]->form = $paymentmethod->loadPaymentForm($paym[$i]->payment_system, $params, $pmconfig);
} else {
$paym[$i]->form = "";
}
$i++;
}
return $paym;
}
示例10: step3
function step3(){
$this->_check(3);
$jshopConfig = &JSFactory::getConfig();
$session =& JFactory::getSession();
$cart = &JModel::getInstance('cart', 'jshop');
$cart->load();
$user = &JFactory::getUser();
if ($user->id){
$adv_user = &JSFactory::getUserShop();
}else{
$adv_user = &JSFactory::getUserShopGuest();
}
appendPathWay(_JSHOP_CHECKOUT_PAYMENT);
$seo = &JTable::getInstance("seo", "jshop");
$seodata = $seo->loadData("checkout-payment");
if ($seodata->title==""){
$seodata->title = _JSHOP_CHECKOUT_PAYMENT;
}
setMetaData($seodata->title, $seodata->keyword, $seodata->description);
$this->_showCheckoutNavigation(3);
if ($jshopConfig->show_cart_all_step_checkout){
$this->_showSmallCart(3);
}
if ($jshopConfig->without_payment){
$this->_setMaxStep(4);
$cart->setPaymentId(0);
$cart->setPaymentParams("");
$cart->setPaymentPrice(0);
$this->setRedirect(SEFLink('index.php?option=com_jshopping&controller=checkout&task=step4',0,1,$jshopConfig->use_ssl));
return 0;
}
$paymentmethod = &JTable::getInstance('paymentmethod', 'jshop');
$all_payment_methods = jshopPaymentMethod::getAllPaymentMethods();
$i = 0;
$paym = array();
foreach ($all_payment_methods as $pm) {
if (file_exists($jshopConfig->path . 'payments/'.$pm->payment_class."/".$pm->payment_class.'.php')){
require_once ($jshopConfig->path . 'payments/'.$pm->payment_class."/".$pm->payment_class.'.php');
$paym[$i]->existentcheckform = 1;
}else{
$paym[$i]->existentcheckform = 0;
}
$paym[$i]->name = $pm->name;
$paym[$i]->payment_id = $pm->payment_id;
$paym[$i]->payment_class = $pm->payment_class;
$paym[$i]->payment_description = $pm->description;
$paym[$i]->price_type = $pm->price_type;
if ($pm->price_type==2){
$paym[$i]->calculeprice = $pm->price;
}else{
$paym[$i]->calculeprice = getPriceCalcParamsTax($pm->price * $jshopConfig->currency_value, $pm->tax_id);
}
$s_payment_method_id = $cart->getPaymentId();
if ($s_payment_method_id == $pm->payment_id){
$params = $cart->getPaymentParams();
}else{
$params = array();
}
$parseString = new parseString($pm->payment_params);
$pmconfig = $parseString->parseStringToParams();
if ($paym[$i]->existentcheckform){
ob_start();
call_user_func(array($pm->payment_class, 'showPaymentForm'), $params, $pmconfig);
$paym[$i]->form = ob_get_contents();
ob_get_clean();
}else{
$paym[$i]->form = "";
}
$i++;
}
$s_payment_method_id = $cart->getPaymentId();
$active_payment = intval($s_payment_method_id);
if (!$active_payment){
$list_payment_id = array();
foreach($paym as $v){
$list_payment_id[] = $v->payment_id;
}
if (in_array($adv_user->payment_id, $list_payment_id)) $active_payment = $adv_user->payment_id;
}
if (!$active_payment){
if (isset($paym[0])){
$active_payment = $paym[0]->payment_id;
}
}
//.........这里部分代码省略.........
示例11: loadpaymentprice
function loadpaymentprice($data_order, $products)
{
JModelLegacy::addIncludePath(JPATH_COMPONENT_SITE . '/models');
$jshopConfig = JSFactory::getConfig();
$jshopConfig->display_price_front_current = $data_order['display_price'];
$all_currency = JSFactory::getAllCurrency();
$currency_id = $data_order['currency_id'];
if ($currency_id) {
$jshopConfig->currency_value = $all_currency[$currency_id]->currency_value;
}
$id_country = $data_order['d_country'];
if (!$id_country) {
$id_country = $data_order['country'];
}
$AllTaxes = JSFactory::getAllTaxes();
$paym_method = JSFactory::getTable('paymentmethod', 'jshop');
$paym_method->load($data_order['payment_method_id']);
if ($paym_method->price_type == 2) {
$total = 0;
foreach ($products as $key => $product) {
$tax = floatval($product['product_tax']);
$product_price = $product['product_item_price'] * $product['product_quantity'];
if ($data_order['display_price']) {
$product_price = $product_price + $product_price * $tax / 100;
}
$total += $product_price;
}
$cproducts = $this->getCartProductsFromOrderProducts($products);
$cart = JSFactory::getModel('cart', 'jshop');
$cart->products = array();
$cart->loadProductsFromArray($cproducts);
$cart->loadPriceAndCountProducts();
$shipping_method = JSFactory::getTable('shippingMethod', 'jshop');
$sh_pr_method_id = $shipping_method->getShippingPriceId($data_order['shipping_method_id'], $id_country);
$shipping_method_price = JSFactory::getTable('shippingMethodPrice', 'jshop');
$shipping_method_price->load($sh_pr_method_id);
$tax = floatval($AllTaxes[$shipping_method_price->shipping_tax_id]);
$shipping_price = $data_order['order_shipping'];
if ($data_order['display_price']) {
$shipping_taxes = $shipping_method_price->calculateShippingTaxList($shipping_price, $cart);
foreach ($shipping_taxes as $k => $v) {
$shipping_price = $shipping_price + $v;
}
}
$total += $shipping_price;
$tax = floatval($AllTaxes[$shipping_method_price->package_tax_id]);
$package_price = $data_order['order_package'];
if ($data_order['display_price']) {
$shipping_taxes = $shipping_method_price->calculatePackageTaxList($package_price, $cart);
foreach ($shipping_taxes as $k => $v) {
$package_price = $package_price + $v;
}
}
$total += $package_price;
$price = $total * $paym_method->price / 100;
if ($data_order['display_price']) {
$price = getPriceCalcParamsTax($price, $paym_method->tax_id, $cart->products);
}
} else {
$price = $paym_method->price * $jshopConfig->currency_value;
$price = getPriceCalcParamsTax($price, $paym_method->tax_id, $cart->products);
}
extract(js_add_trigger(get_defined_vars(), "before"));
return $price;
}
示例12: updateOtherPricesIncludeAllFactors
function updateOtherPricesIncludeAllFactors()
{
$jshopConfig = JSFactory::getConfig();
$userShop = JSFactory::getUserShop();
$this->product_old_price = $this->getOldPrice();
$this->product_old_price = getPriceFromCurrency($this->product_old_price, $this->currency_id);
$this->product_old_price = getPriceDiscount($this->product_old_price, $userShop->percent_discount);
$this->product_old_price = getPriceCalcParamsTax($this->product_old_price, $this->product_tax_id);
if (is_array($this->product_add_prices)) {
foreach ($this->product_add_prices as $key => $value) {
$this->product_add_prices[$key]->price = getPriceFromCurrency($this->product_add_prices[$key]->price, $this->currency_id);
$this->product_add_prices[$key]->price = getPriceDiscount($this->product_add_prices[$key]->price, $userShop->percent_discount);
$this->product_add_prices[$key]->price = getPriceCalcParamsTax($this->product_add_prices[$key]->price, $this->product_tax_id);
}
}
JPluginHelper::importPlugin('jshoppingproducts');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('updateOtherPricesIncludeAllFactors', array(&$this));
}