コード例 #1
0
ファイル: walletone.php プロジェクト: JexyRu/Ksenmart
 public function onAfterDisplayKSMCartDefault_congratulation($view, $tpl = null, &$html)
 {
     if (empty($view->order)) {
         return;
     }
     if (empty($view->order->payment_id)) {
         return;
     }
     $payment = KSMWalletone::getPayment($view->order->payment_id, $this->_name);
     if ($payment->id <= 0) {
         return;
     }
     if (empty($view->order->region_id)) {
         return;
     }
     if (!$this->checkRegion($payment->regions, $view->order->region_id)) {
         return;
     }
     $params = new JRegistry();
     $params->loadString($payment->params);
     $view->payment_params = $params;
     $view->payment_form_params = new stdClass();
     $view->payment_form_params->title = 'Оплата заказа №' . $view->order->id . ' на сайте ' . JFactory::getConfig()->get('sitename');
     $paymentTypes = $this->_preparePaymentTypes($view->payment_params->get('payment_types', array()));
     $view->user = KSUsers::getUser();
     KSMWalletone::_setFields(array_merge($paymentTypes, array('WMI_MERCHANT_ID' => $view->payment_params->get('merchant_id', null), 'WMI_PAYMENT_AMOUNT' => $view->order->costs['total_cost'], 'WMI_PAYMENT_NO' => $view->order->id, 'WMI_CURRENCY_ID' => 643, 'WMI_DESCRIPTION' => $view->payment_form_params->title, 'WMI_CUSTOMER_FIRSTNAME' => $view->order->customer_fields->first_name, 'WMI_CUSTOMER_LASTNAME' => $view->order->customer_fields->last_name, 'WMI_CUSTOMER_EMAIL' => $view->order->customer_fields->email, 'WMI_FAIL_URL' => JRoute::_(JURI::base() . 'index.php?option=com_ksenmart&view=cart&layout=pay_error'), 'WMI_SUCCESS_URL' => JRoute::_(JURI::base() . 'index.php?option=com_ksenmart&view=cart&layout=pay_success'))));
     $view->payment_form_params->sign = KSMWalletone::getHash($view->payment_params->get('secretKey', null));
     $html .= KSSystem::loadPluginTemplate($this->_name, $this->_type, $view, 'default_paymentform');
     return true;
 }
コード例 #2
0
ファイル: import_csv.php プロジェクト: JexyRu/Ksenmart
 function getImportStep()
 {
     $jinput = JFactory::getApplication()->input;
     $this->view->encoding = $jinput->get('encoding', 'cp1251');
     if (!($this->view->info = $this->importCSV())) {
         return false;
     }
     $html = KSSystem::loadPluginTemplate($this->_name, $this->_type, $this->view, 'result');
     return $html;
 }
コード例 #3
0
ファイル: export_ym.php プロジェクト: JexyRu/Ksenmart
 function getConfigStep()
 {
     $this->view->form = $this->getForm();
     $data = $this->getFormData();
     $this->view->form->bind($data);
     $html = KSSystem::loadPluginTemplate($this->_name, $this->_type, $this->view, 'config');
     return $html;
 }
コード例 #4
0
ファイル: coupons.php プロジェクト: JexyRu/Ksenmart
    function onBeforeDisplayKSMCartDefault_shipping($view, &$tpl = null, &$html)
    {
        if (!self::canDisplay()) {
            return false;
        }
        $document = JFactory::getDocument();
        $session = JFactory::getSession();
        $coupon_id = $session->get('ksenmart.coupon_id', null);
        if (!empty($coupon_id)) {
            $db = JFactory::getDBO();
            $query = $db->getQuery(true);
            $query->select('code')->from('#__ksenmart_discount_coupons')->where('published=1')->where('id=' . $coupon_id);
            $db->setQuery($query);
            $view->code = $db->loadResult();
            $html .= KSSystem::loadPluginTemplate($this->_name, $this->_type, $view, 'unset');
            $script = '
			jQuery(document).ready(function(){
			
				jQuery("#cart").on("click",".km-coupons .btn",function(){
					jQuery("#km-coupon-form").submit();
				});
			
			});
			';
            $document->addScriptDeclaration($script);
        } else {
            $html .= KSSystem::loadPluginTemplate($this->_name, $this->_type, $view, 'set');
            $script = '
			jQuery(document).ready(function(){
			
				jQuery("#cart").on("click",".km-coupons .btn",function(){
					var discount_code=jQuery(".km-coupons input[name=\'discount_code\']").val();
					jQuery("#km-coupon-form input[name=\'discount_code\']").val(discount_code);
					jQuery("#km-coupon-form").submit();
				});
			
			});
			';
            $document->addScriptDeclaration($script);
        }
    }