当前位置: 首页>>代码示例>>PHP>>正文


PHP JSFactory::getUserShopGuest方法代码示例

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


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

示例1: getDisplayPriceFront

 function getDisplayPriceFront()
 {
     $display_price = $this->display_price_front;
     if ($this->use_extend_display_price_rule > 0) {
         $adv_user = JSFactory::getUserShop();
         $country_id = $adv_user->country;
         $client_type = $adv_user->client_type;
         if (!$adv_user->user_id) {
             $adv_user = JSFactory::getUserShopGuest();
             $country_id = $adv_user->country;
             $client_type = $adv_user->client_type;
         }
         if (!$country_id) {
             $country_id = $this->default_country;
         }
         if ($country_id) {
             $configDisplayPrice = JSFactory::getTable('configDisplayPrice', 'jshop');
             $rows = $configDisplayPrice->getList();
             foreach ($rows as $v) {
                 if (in_array($country_id, $v->countries)) {
                     if ($client_type == 2) {
                         $display_price = $v->display_price_firma;
                     } else {
                         $display_price = $v->display_price;
                     }
                 }
             }
         }
     }
     return $display_price;
 }
开发者ID:arkane0906,项目名称:lasercut-bootstrap,代码行数:31,代码来源:config.php

示例2: step5save

 function step5save()
 {
     $session = JFactory::getSession();
     $jshopConfig = JSFactory::getConfig();
     $db = JFactory::getDBO();
     $checkout = JModelLegacy::getInstance('checkout', 'jshop');
     $mainframe = JFactory::getApplication();
     $checkout->checkStep(5);
     $checkagb = JRequest::getVar('agb');
     JPluginHelper::importPlugin('jshoppingorder');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onLoadStep5save', array(&$checkagb));
     $lang = JSFactory::getLang();
     $user = JFactory::getUser();
     if ($user->id) {
         $adv_user = JSFactory::getUserShop();
     } else {
         $adv_user = JSFactory::getUserShopGuest();
     }
     $cart = JModelLegacy::getInstance('cart', 'jshop');
     $cart->load();
     $cart->setDisplayItem(1, 1);
     $cart->setDisplayFreeAttributes();
     if ($jshopConfig->check_php_agb && $checkagb != 'on') {
         JError::raiseWarning("", _JSHOP_ERROR_AGB);
         $this->setRedirect(SEFLink('index.php?option=com_jshopping&controller=checkout&task=step5', 0, 1, $jshopConfig->use_ssl));
         return 0;
     }
     if (!$cart->checkListProductsQtyInStore()) {
         $this->setRedirect(SEFLink('index.php?option=com_jshopping&controller=cart&task=view', 1, 1));
         return 0;
     }
     if (!$cart->checkCoupon()) {
         $cart->setRabatt(0, 0, 0);
         JError::raiseWarning("", _JSHOP_RABATT_NON_CORRECT);
         $this->setRedirect(SEFLink('index.php?option=com_jshopping&controller=cart&task=view', 1, 1));
         return 0;
     }
     $orderNumber = $jshopConfig->next_order_number;
     $jshopConfig->updateNextOrderNumber();
     $payment_method_id = $cart->getPaymentId();
     $pm_method = JTable::getInstance('paymentMethod', 'jshop');
     $pm_method->load($payment_method_id);
     $payment_method = $pm_method->payment_class;
     if ($jshopConfig->without_payment) {
         $pm_method->payment_type = 1;
         $paymentSystemVerySimple = 1;
     } else {
         $paymentsysdata = $pm_method->getPaymentSystemData();
         $payment_system = $paymentsysdata->paymentSystem;
         if ($paymentsysdata->paymentSystemVerySimple) {
             $paymentSystemVerySimple = 1;
         }
         if ($paymentsysdata->paymentSystemError) {
             $cart->setPaymentParams("");
             JError::raiseWarning("", _JSHOP_ERROR_PAYMENT);
             $this->setRedirect(SEFLink('index.php?option=com_jshopping&controller=checkout&task=step3', 0, 1, $jshopConfig->use_ssl));
             return 0;
         }
     }
     $order = JTable::getInstance('order', 'jshop');
     $arr_property = $order->getListFieldCopyUserToOrder();
     foreach ($adv_user as $key => $value) {
         if (in_array($key, $arr_property)) {
             $order->{$key} = $value;
         }
     }
     $sh_mt_pr = JTable::getInstance('shippingMethodPrice', 'jshop');
     $sh_mt_pr->load($cart->getShippingPrId());
     $order->order_date = $order->order_m_date = getJsDate();
     $order->order_tax = $cart->getTax(1, 1, 1);
     $order->setTaxExt($cart->getTaxExt(1, 1, 1));
     $order->order_subtotal = $cart->getPriceProducts();
     $order->order_shipping = $cart->getShippingPrice();
     $order->order_payment = $cart->getPaymentPrice();
     $order->order_discount = $cart->getDiscountShow();
     $order->shipping_tax = $cart->getShippingPriceTaxPercent();
     $order->setShippingTaxExt($cart->getShippingTaxList());
     $order->payment_tax = $cart->getPaymentTaxPercent();
     $order->setPaymentTaxExt($cart->getPaymentTaxList());
     $order->order_package = $cart->getPackagePrice();
     $order->setPackageTaxExt($cart->getPackageTaxList());
     $order->order_total = $cart->getSum(1, 1, 1);
     $order->currency_exchange = $jshopConfig->currency_value;
     $order->vendor_type = $cart->getVendorType();
     $order->vendor_id = $cart->getVendorId();
     $order->order_status = $jshopConfig->default_status_order;
     $order->shipping_method_id = $cart->getShippingId();
     $order->payment_method_id = $cart->getPaymentId();
     $order->delivery_times_id = $sh_mt_pr->delivery_times_id;
     if ($jshopConfig->delivery_order_depends_delivery_product) {
         $order->delivery_time = $cart->getDelivery();
     }
     if ($jshopConfig->show_delivery_date) {
         $order->delivery_date = $cart->getDeliveryDate();
     }
     $order->coupon_id = $cart->getCouponId();
     $pm_params = $cart->getPaymentParams();
     if (is_array($pm_params) && !$paymentSystemVerySimple) {
         $payment_system->setParams($pm_params);
//.........这里部分代码省略.........
开发者ID:ngogiangthanh,项目名称:damtvnewversion,代码行数:101,代码来源:checkout.php

示例3: step5save

    function step5save(){    
        $mainframe =& JFactory::getApplication();    
        $this->_check(5);
        
        JPluginHelper::importPlugin('jshoppingorder');
        $dispatcher =& JDispatcher::getInstance();
        
        $lang = &JSFactory::getLang();
        $user = &JFactory::getUser();
        if ($user->id){
            $adv_user = &JSFactory::getUserShop();
        }else{
            $adv_user = &JSFactory::getUserShopGuest();    
        }
        $cart = &JModel::getInstance('cart', 'jshop');
        $cart->load();
        $cart->setDisplayItem(1, 1);
        $cart->setDisplayFreeAttributes();
        
        $session =& JFactory::getSession();
        $jshopConfig = &JSFactory::getConfig();
        $orderNumber = $jshopConfig->next_order_number;
        $jshopConfig->updateNextOrderNumber();
        $db = &JFactory::getDBO();        
        
        $payment_method_id = $cart->getPaymentId();
        $pm_method = &JTable::getInstance('paymentMethod', 'jshop');
        $pm_method->load($payment_method_id);        

        $payment_method = $pm_method->payment_class; 
        
        if ($jshopConfig->without_payment){
            $pm_method->payment_type = 1;
            $paymentSystemVerySimple = 1; 
        }elseif (!file_exists($jshopConfig->path . 'payments/' . $payment_method."/".$payment_method. '.php')) {
            $paymentSystemVerySimple = 1;
        }else{ 
            $paymentSystemVerySimple = 0;
            
            include_once ($jshopConfig->path . 'payments/' . $payment_method."/".$payment_method . '.php');        

            if (!class_exists($payment_method)) {
                $cart->setPaymentParams("");
                JError::raiseWarning("",_JSHOP_ERROR_PAYMENT);
                $this->setRedirect(SEFLink('index.php?option=com_jshopping&controller=checkout&task=step3',0,1,$jshopConfig->use_ssl));
                return 0;
            }
        }
                
        $order = &JTable::getInstance('order', 'jshop');
        $arr_property = array('user_id','f_name','l_name','firma_name','client_type','firma_code','tax_number','email','street','zip','city','state','country','phone','mobil_phone','fax','title','ext_field_1','ext_field_2','ext_field_3','d_f_name','d_l_name','d_firma_name','d_email','d_street','d_zip','d_city','d_state','d_country','d_phone','d_mobil_phone','d_title','d_fax','d_ext_field_1','d_ext_field_2','d_ext_field_3');

        foreach ($adv_user as $key => $value) {
            if(in_array($key, $arr_property)) {
                $order->$key = $value;
            }
        }
        
        $order->order_date = $order->order_m_date = date("Y-m-d H:i:s", mktime());
        $order->order_tax = $cart->getTax(1, 1, 1);        
        $order->setTaxExt($cart->getTaxExt(1, 1, 1));
        $order->order_subtotal = $cart->getPriceProducts();        
        $order->order_shipping = $cart->getShippingPrice();
        $order->order_payment = $cart->getPaymentPrice();
        $order->order_discount = $cart->getDiscountShow();
        $order->order_total = $cart->getSum(1, 1, 1);
        $order->currency_exchange = $jshopConfig->currency_value;
        $order->vendor_type = $cart->getVendorType();
        $order->vendor_id = $cart->getVendorId();        
        $order->order_status = $jshopConfig->default_status_order;                
        $order->shipping_method_id = $cart->getShippingId();
        $order->payment_method_id = $cart->getPaymentId();

        $pm_params = $cart->getPaymentParams();
                    
        if (is_array($pm_params) && !$paymentSystemVerySimple) {
            $payment_system = new $payment_method();
            $payment_system->setParams($pm_params);
            $payment_params_names = $payment_system->getDisplayNameParams();            
            $order->payment_params = getTextNameArrayValue($payment_params_names, $pm_params);
            $order->setPaymentParamsData($pm_params);
        }
        
        $name = $lang->get("name");        
        $order->ip_address = $_SERVER['REMOTE_ADDR'];
        $order->order_add_info = JRequest::getVar('order_add_info','');
        $order->currency_code = $jshopConfig->currency_code;
        $order->currency_code_iso = $jshopConfig->currency_code_iso;
        $order->order_number = $order->formatOrderNumber($orderNumber);
        $order->order_hash = md5(time().$order->order_total.$order->user_id);
        $order->file_hash = md5(time().$order->order_total.$order->user_id."hashfile");
        $order->display_price = $jshopConfig->display_price_front_current;
        $order->lang = $jshopConfig->cur_lang;
        
        if ($order->client_type){
            $order->client_type_name = $jshopConfig->user_field_client_type[$order->client_type];
        }else{
            $order->client_type_name = "";
        }
        
//.........这里部分代码省略.........
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:101,代码来源:checkout.php

示例4: getAllTaxes

 public static function getAllTaxes()
 {
     static $rows;
     if (!is_array($rows)) {
         $jshopConfig = JSFactory::getConfig();
         $dispatcher = JDispatcher::getInstance();
         $_tax = JSFactory::getTable('tax', 'jshop');
         $rows = JSFactory::getAllTaxesOriginal();
         if ($jshopConfig->use_extend_tax_rule) {
             $country_id = 0;
             $adv_user = JSFactory::getUserShop();
             $country_id = $adv_user->country;
             if ($jshopConfig->tax_on_delivery_address && $adv_user->delivery_adress && $adv_user->d_country) {
                 $country_id = $adv_user->d_country;
             }
             $client_type = $adv_user->client_type;
             $enter_tax_id = $adv_user->tax_number != "";
             if (!$country_id) {
                 $adv_user = JSFactory::getUserShopGuest();
                 $country_id = $adv_user->country;
                 if ($jshopConfig->tax_on_delivery_address && $adv_user->delivery_adress && $adv_user->d_country) {
                     $country_id = $adv_user->d_country;
                 }
                 $client_type = $adv_user->client_type;
                 $enter_tax_id = $adv_user->tax_number != "";
             }
             if ($country_id) {
                 $_rowsext = $_tax->getExtTaxes();
                 $dispatcher->trigger('beforeGetAllTaxesRowsext', array(&$_rowsext, &$country_id, &$adv_user, &$rows));
                 foreach ($_rowsext as $v) {
                     if (in_array($country_id, $v->countries)) {
                         if ($jshopConfig->ext_tax_rule_for == 1) {
                             if ($enter_tax_id) {
                                 $rows[$v->tax_id] = $v->firma_tax;
                             } else {
                                 $rows[$v->tax_id] = $v->tax;
                             }
                         } else {
                             if ($client_type == 2) {
                                 $rows[$v->tax_id] = $v->firma_tax;
                             } else {
                                 $rows[$v->tax_id] = $v->tax;
                             }
                         }
                     }
                 }
                 $dispatcher->trigger('afterGetAllTaxesRowsext', array(&$_rowsext, &$country_id, &$adv_user, &$rows));
                 unset($_rowsext);
             }
         }
         $dispatcher->trigger('afterGetAllTaxes', array(&$rows));
     }
     return $rows;
 }
开发者ID:olegverstka,项目名称:monax.dev,代码行数:54,代码来源:factory.php

示例5: jshoppingUpdateUserInfo

 /**
  * Update jshopping user info
  */
 private function jshoppingUpdateUserInfo()
 {
     $adv_user = JSFactory::getUserShop();
     if ($adv_user->user_id <= 0) {
         $adv_user = JSFactory::getUserShopGuest();
     }
     if ($adv_user->title == 1) {
         $this->userGender = 'male';
     } else {
         if ($adv_user->title == 2) {
             $this->userGender = 'female';
         }
     }
     if (!empty($adv_user->f_name)) {
         $this->userFirstName = $adv_user->f_name;
     }
     if (!empty($adv_user->l_name)) {
         $this->userLastName = $adv_user->l_name;
     }
     if (!empty($adv_user->email)) {
         $this->userEmail = $adv_user->email;
     }
     if (!empty($adv_user->phone)) {
         $this->userPhone = $adv_user->phone;
     }
     if (!empty($adv_user->birthday)) {
         $this->userDateOfBirth = $adv_user->birthday;
     }
 }
开发者ID:joomline,项目名称:joomla_convead,代码行数:32,代码来源:convead.php


注:本文中的JSFactory::getUserShopGuest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。