Example #1
0
 public function routing($route = array())
 {
     $domain_settings = shopOnestep::getDomainSettings();
     $page_url = $domain_settings['page_url'];
     $page_url = rtrim($page_url, '/') . "/";
     return array($page_url => 'frontend/onestep', 'onestepcheck/' => 'frontend/check', $page_url . 'save/' => 'frontend/save', $page_url . 'delete/' => 'frontend/delete', $page_url . 'add/' => 'frontend/add');
 }
 public function execute()
 {
     $app_settings_model = new waAppSettingsModel();
     $domain_routes = wa()->getRouting()->getByApp('shop');
     $domains_settings = shopOnestep::getDomainsSettings();
     $settings = $app_settings_model->get(shopOnestepPlugin::$plugin_id);
     $this->view->assign('domain_routes', $domain_routes);
     $this->view->assign('domains_settings', $domains_settings);
     $this->view->assign('settings', $settings);
 }
 public function checkOrder()
 {
     $domain_settings = shopOnestep::getDomainSettings();
     $cart = new shopCart();
     $def_currency = wa('shop')->getConfig()->getCurrency(true);
     $cur_currency = wa('shop')->getConfig()->getCurrency(false);
     $total = $cart->total(true);
     $total = shop_currency($total, $cur_currency, $def_currency, false);
     $min_sum = $domain_settings['min_sum'];
     if ($total < $min_sum) {
         return false;
     }
     return true;
 }
 public function execute()
 {
     $domain_settings = shopOnestep::getDomainSettings();
     $templates = $domain_settings['templates'];
     $this->getResponse()->setTitle($domain_settings['page_title']);
     $this->cart();
     $this->checkout($templates);
     if ($templates['cart_js']['change_tpl']) {
         $cart_js_url = wa()->getDataUrl($templates['cart_js']['tpl_full_path'], true, 'shop');
     } else {
         $cart_js_url = wa()->getAppStaticUrl() . $templates['cart_js']['tpl_full_path'];
     }
     $this->view->assign('checkout_path', $templates['checkout']['template_path']);
     $this->view->assign('cart_js_url', $cart_js_url);
     $this->view->assign('settings', $domain_settings);
     $this->setTemplate($templates['onestep']['template_path']);
 }
 public function execute()
 {
     try {
         $app_settings_model = new waAppSettingsModel();
         $settings = waRequest::post('shop_onestep', array());
         $domains_settings = waRequest::post('domains_settings', array());
         $reset = waRequest::post('reset');
         foreach ($settings as $name => $value) {
             $app_settings_model->set(shopOnestepPlugin::$plugin_id, $name, $value);
         }
         if ($reset) {
             $domains_settings = array();
         }
         shopOnestep::saveDomainsSettings($domains_settings);
         $this->response['message'] = "Сохранено";
     } catch (Exception $e) {
         $this->setError($e->getMessage());
     }
 }
Example #6
0
<?php

$domains_settings = array();
shopOnestep::saveDomainsSettings($domains_settings);