Exemplo n.º 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 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']);
 }