Пример #1
0
 public function __construct($registry)
 {
     parent::__construct($registry);
     $this->business = '';
     $this->sandbox = 1;
     $settings = $this->registry->core->loadModuleSettings('paypal', Helper::getViewId());
     if (!empty($settings)) {
         $this->business = $settings['business'];
         $this->apiusername = $settings['apiusername'];
         $this->apipassword = $settings['apipassword'];
         $this->apisignature = $settings['apisignature'];
         $this->sandbox = $settings['sandbox'];
     }
     $this->gatewayurl = "https://www.paypal.com/cgi-bin/webscr";
     if ($this->sandbox === 1) {
         $this->gatewayurl = "https://www.sandbox.paypal.com/cgi-bin/webscr";
     }
     $this->returnurl = App::getURLAdress() . Seo::getSeo('payment') . '/confirm';
     $this->cancelurl = App::getURLAdress() . Seo::getSeo('payment') . '/cancel';
     $this->notifyurl = App::getURLAdress() . 'paypalreport';
     $this->ipnLogFile = ROOTPATH . 'logs/paypal.ipn_results.log';
     $this->lastError = '';
     $this->ipnData = array();
     $this->ipnResponse = '';
 }
Пример #2
0
 public function edit()
 {
     $PopulateData = $this->model->getProductAndAttributesById((int) $this->id);
     $groupPrice = App::getModel('product')->getProductGroupPrice($this->id, false);
     $CurrentViewData = array('basic_pane' => array('language_data' => $PopulateData['language'], 'ean' => $PopulateData['ean'], 'enable' => $PopulateData['enable'], 'delivelercode' => $PopulateData['delivelercode'], 'producerid' => $PopulateData['producerid'], 'delivererid' => $PopulateData['delivererid']), 'meta_data' => array('language_data' => $PopulateData['language']), 'category_pane' => array('category' => $PopulateData['category']), 'price_pane' => array('vatid' => $PopulateData['vatid'], 'buyprice' => $PopulateData['buyprice'], 'buycurrencyid' => $PopulateData['buycurrencyid'], 'sellcurrencyid' => $PopulateData['sellcurrencyid'], 'standard_price' => array('sellprice' => $PopulateData['sellprice'], 'promotion' => $PopulateData['promotion'], 'discountprice' => $PopulateData['discountprice'], 'promotionstart' => $PopulateData['promotionstart'], 'promotionend' => $PopulateData['promotionend'])), 'weight_pane' => array('weight' => $PopulateData['weight'], 'width' => $PopulateData['width'], 'height' => $PopulateData['height'], 'deepth' => $PopulateData['deepth'], 'unit' => $PopulateData['unit'], 'packagesize' => $PopulateData['packagesize']), 'stock_pane' => array('stock' => $PopulateData['standardstock'], 'trackstock' => $PopulateData['trackstock'], 'availablityid' => isset($PopulateData['availablityid']) ? $PopulateData['availablityid'] : 0, 'disableatstockenabled' => $PopulateData['disableatstockenabled'], 'disableatstock' => $PopulateData['disableatstock']), 'description_pane' => array('language_data' => $PopulateData['language']), 'crosssell_products' => array('crosssell' => App::getModel('crosssell')->getProductsDataGrid((int) $this->id)), 'upsell_products' => array('upsell' => App::getModel('upsell')->getProductsDataGrid((int) $this->id)), 'similar_products' => array('similar' => App::getModel('similarproduct')->getProductsDataGrid((int) $this->id)), 'photos_pane' => array('photo' => $PopulateData['photo'], 'mainphotoid' => $PopulateData['mainphotoid']), 'files_pane' => array('file' => $PopulateData['file']), 'warranty_pane' => array('warranty' => $PopulateData['warranty']), 'statusproduct_pane' => array('productstatuses' => $PopulateData['productstatuses'], 'newactive' => $PopulateData['productnew']['newactive'], 'new_data' => array('startnew' => $PopulateData['productnew']['startnew'], 'endnew' => $PopulateData['productnew']['endnew'])), 'variants_pane' => array('variants' => $PopulateData['variants']));
     foreach ($groupPrice as $key => $val) {
         $CurrentViewData['price_pane'][$key] = $val;
     }
     $this->formModel->setPopulateData($CurrentViewData);
     $form = $this->formModel->initForm();
     if ($form->Validate(FormEngine\FE::SubmittedData())) {
         try {
             $this->model->productUpdateAll($form->getSubmitValues(FormEngine\Elements\Form::FORMAT_FLAT), $this->id);
         } catch (Exception $e) {
             $this->registry->template->assign('error', $e->getMessage());
         }
         if (FormEngine\FE::IsAction('continue')) {
             App::redirect(__ADMINPANE__ . '/product/edit/' . $this->id);
         } else {
             App::redirect(__ADMINPANE__ . '/product');
         }
     }
     $this->renderLayout(array('form' => $form->Render(), 'productName' => isset($PopulateData['language'][Helper::getLanguageId()]['name']) ? $PopulateData['language'][Helper::getLanguageId()]['name'] : $PopulateData['language'][1]['name'], 'productLink' => App::getURLAdress() . Seo::getSeo('productcart') . '/' . (isset($PopulateData['language'][Helper::getLanguageId()]['seo']) ? $PopulateData['language'][Helper::getLanguageId()]['seo'] : $PopulateData['language'][1]['seo'])));
 }
Пример #3
0
 public function setStaticTemplateVariables()
 {
     if ($this->registry->router->getAdministrativeMode() == 0) {
         $link = $this->_adminPane = '';
     } else {
         $link = $this->_adminPane = __ADMINPANE__ . '/';
     }
     $languageModel = App::getModel('language');
     $languages = $languageModel->getLanguages();
     $this->layer = $this->registry->loader->getCurrentLayer();
     if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') {
         $this->assign('SSLNAME', 'https://');
     } else {
         $this->assign('SSLNAME', 'http://');
     }
     $theme = App::getRegistry()->loader->getParam('theme');
     $this->assign('URL', App::getURLAdress() . $link);
     $this->assign('CURRENT_URL', App::getCurrentURLAdress());
     $this->assign('DESIGNPATH', DESIGNPATH);
     $this->assign('ASSETSPATH', App::getURLForAssetDirectory() . $theme . '/assets/');
     $this->assign('THEMESPATH', App::getURLForAssetDirectory());
     $this->assign('CURRENT_CONTROLLER', $this->registry->router->getCurrentController());
     $this->assign('CURRENT_ACTION', $this->registry->router->getAction());
     $this->assign('CURRENT_PARAM', $this->registry->core->getParam());
     $this->assign('SHOP_NAME', Session::getActiveShopName());
     $templateData = array();
     if ($this->registry->router->getAdministrativeMode() == 0) {
         $cartModel = App::getModel('cart');
         $client = App::getModel('client')->getClient();
         $productCart = $cartModel->getShortCartList();
         $productCart = $cartModel->getProductCartPhotos($productCart);
         $this->assign('SHOP_LOGO', $this->layer['photoid']);
         $this->assign('FAVICON', $this->layer['favicon']);
         $this->assign('enableregistration', $this->layer['enableregistration']);
         $this->assign('client', $client);
         $this->assign('clientdata', $client);
         $this->assign('showtax', $this->layer['showtax']);
         $this->assign('currencySymbol', Session::getActiveCurrencySymbol());
         $this->assign('count', $cartModel->getProductAllCount());
         $this->assign('globalPrice', $cartModel->getGlobalPrice());
         $this->assign('productCart', $productCart);
         $this->assign('language', Session::getActiveLanguageId());
         $this->assign('languageCode', Session::getActiveLanguage());
         $this->assign('languageFlag', $languageModel->getLanguages());
         $this->assign('currencies', $languageModel->getAllCurrenciesForView());
         $this->assign('breadcrumb', App::getModel('breadcrumb')->getPageLinks());
         $this->assign('contentcategory', App::getModel('staticcontent')->getContentCategoriesTree());
         $this->assign('defaultcontact', App::getModel('contact')->getContactById($this->layer['contactid']));
         $this->assign('newsletterButton', App::getModel('newsletter')->isNewsletterButton());
         $this->assign('cartpreview', $cartModel->getCartPreviewTemplate());
         if ($this->layer['cartredirect'] != '') {
             $this->assign('cartredirect', App::getURLAdress() . Seo::getSeo($this->layer['cartredirect']));
         } else {
             $this->assign('cartredirect', '');
         }
         $this->assign('modulesettings', $this->registry->core->getModuleSettingsForView());
         $message = Session::getVolatileMessage();
         if (isset($message) && !empty($message)) {
             $this->assign('message', $message[0]);
         }
         $this->assign('categories', App::getModel('CategoriesBox')->getCategoriesTree(2));
         $methods = $this->getXajaxMethodsForFrontend();
         foreach ($methods as $xajaxMethodName => $xajaxMethodParams) {
             $this->registry->xajax->registerFunction(array($xajaxMethodName, App::getModel($xajaxMethodParams['model']), $xajaxMethodParams['method']));
         }
         $message = Session::getVolatileMessage();
         if (isset($message) && !empty($message)) {
             $this->assign('message', $message[0]);
         }
         $this->assign('view', Helper::getViewId());
         $this->assign('viewid', Helper::getViewId());
     } else {
         $this->registry->core->setAdminStoreConfig();
         $templateData = array('user_name' => App::getModel('users')->getUserFullName(), 'user_id' => App::getModel('users')->getActiveUserid(), 'language' => Session::getActiveLanguageId(), 'languages' => json_encode($languages), 'globalsettings' => Session::getActiveGlobalSettings(), 'views' => App::getModel('view')->getViews(), 'vatvalues' => json_encode(App::getModel('vat/vat')->getVATValuesAll()), 'FRONTEND_URL' => Session::getActiveShopUrl() != '' ? 'http://' . Session::getActiveShopUrl() : App::getURLAdress(), 'appversion' => Session::getActiveAppVersion(), 'view' => Helper::getViewId(), 'viewid' => Helper::getViewId());
         $message = Session::getVolatileMessage();
         if (isset($message) && !empty($message)) {
             $templateData['message'] = $message[0];
         }
         $methods = $this->getXajaxMethodsForAdmin();
         foreach ($methods as $xajaxMethodName => $xajaxMethodParams) {
             $this->registry->xajax->registerFunction(array($xajaxMethodName, App::getModel($xajaxMethodParams['model']), $xajaxMethodParams['method']));
         }
         $Data = Event::dispatch($this, 'template.setStaticTemplateVariables', array('data' => $templateData));
         foreach ($Data as $param => $value) {
             $this->assign($param, $value);
         }
         $this->assign('view', Helper::getViewId());
         $this->assign('viewid', Helper::getViewId());
     }
 }
Пример #4
0
$this->routes->add('frontend.cart', new Route('/' . Seo::getSeo('cart'), array('mode' => 'frontend', 'controller' => 'cart', 'action' => 'index', 'param' => NULL), array('_scheme' => SSLNAME)));
$this->routes->add('frontend.checkout', new Route('/' . Seo::getSeo('checkout'), array('mode' => 'frontend', 'controller' => 'checkout', 'action' => 'index', 'param' => NULL), array('_scheme' => SSLNAME)));
$this->routes->add('frontend.conditions', new Route('/' . Seo::getSeo('conditions'), array('mode' => 'frontend', 'controller' => 'conditions', 'action' => 'index', 'param' => NULL), array('_scheme' => 'http')));
$this->routes->add('frontend.finalization', new Route('/' . Seo::getSeo('finalization'), array('mode' => 'frontend', 'controller' => 'finalization', 'action' => 'index', 'param' => NULL), array('_scheme' => SSLNAME)));
$this->routes->add('frontend.clientsettings', new Route('/' . Seo::getSeo('clientsettings'), array('mode' => 'frontend', 'controller' => 'clientsettings', 'action' => 'index', 'param' => NULL), array('_scheme' => SSLNAME)));
$this->routes->add('frontend.clientorder', new Route('/' . Seo::getSeo('clientorder') . '/{param}', array('mode' => 'frontend', 'controller' => 'clientorder', 'action' => 'index', 'param' => NULL), array('_scheme' => SSLNAME)));
$this->routes->add('frontend.integration', new Route('/' . Seo::getSeo('integration') . '/{param}', array('mode' => 'frontend', 'controller' => 'integration', 'action' => 'index', 'param' => NULL), array('_scheme' => 'http', 'param' => '(ceneo|domodi|ceneria|cenuj|kreocen|kupujemy|najtaniej24|nokaut|oferciak|okazje|radar|skapiec|smartbay|szoker|tortura|webkupiec)(\\.xml)?')));
$this->routes->add('frontend.firmes', new Route('/firmes/{param}', array('mode' => 'frontend', 'controller' => 'firmes', 'action' => 'index'), array('_scheme' => 'http', 'param' => 'subiekt|optima|navireo|wfmag|hermes')));
$this->routes->add('frontend.clientaddress', new Route('/' . Seo::getSeo('clientaddress'), array('mode' => 'frontend', 'controller' => 'clientaddress', 'action' => 'index', 'param' => NULL), array('_scheme' => SSLNAME)));
$this->routes->add('frontend.invoice', new Route('/' . Seo::getSeo('invoice') . '/{param}', array('mode' => 'frontend', 'controller' => 'invoice', 'action' => 'index', 'param' => NULL), array('_scheme' => SSLNAME)));
$this->routes->add('frontend.productcart', new Route('/' . Seo::getSeo('productcart') . '/{param}', array('mode' => 'frontend', 'controller' => 'productcart', 'action' => 'index', 'param' => NULL), array('_scheme' => 'http', 'param' => '.+')));
$this->routes->add('frontend.producerlist', new Route('/' . Seo::getSeo('producerlist') . '/{param},{currentPage},{orderBy},{orderDir},{viewType},{priceFrom},{priceTo},{producers},{attributes}', array('mode' => 'frontend', 'controller' => 'producerlist', 'action' => 'index', 'param' => NULL, 'orderBy' => NULL, 'orderDir' => NULL, 'viewType' => NULL, 'currentPage' => NULL, 'priceFrom' => NULL, 'priceTo' => NULL, 'producers' => NULL, 'attributes' => NULL), array('_scheme' => 'http', 'param' => '[^,]+', 'orderBy' => '\\w+', 'orderDir' => 'asc|desc', 'currentPage' => '\\d{1,10}', 'priceFrom' => '[\\d+\\.]+', 'priceTo' => '[\\d+\\.]+', 'producers' => '[\\d+_]+', 'attributes' => '[\\d+_]+')));
$this->routes->add('frontend.categorylist', new Route('/' . Seo::getSeo('categorylist') . '/{param},{currentPage},{orderBy},{orderDir},{viewType},{priceFrom},{priceTo},{producers},{attributes}', array('mode' => 'frontend', 'controller' => 'categorylist', 'action' => 'index', 'param' => NULL, 'orderBy' => NULL, 'orderDir' => NULL, 'viewType' => NULL, 'currentPage' => NULL, 'priceFrom' => NULL, 'priceTo' => NULL, 'producers' => NULL, 'attributes' => NULL), array('_scheme' => 'http', 'param' => '[^,]+', 'currentPage' => '\\d{1,10}', 'orderBy' => '\\w+', 'orderDir' => 'asc|desc', 'priceFrom' => '[\\d+\\.]+', 'priceTo' => '[\\d+\\.]+', 'producers' => '[\\d_]+', 'attributes' => '[\\d_]+')));
$this->routes->add('frontend.staticcontent', new Route('/' . Seo::getSeo('staticcontent') . '/{param}/{slug}', array('mode' => 'frontend', 'controller' => 'staticcontent', 'action' => 'index', 'param' => NULL, 'slug' => NULL), array('_scheme' => 'http', 'param' => '.+')));
$this->routes->add('frontend.productprint', new Route('/' . Seo::getSeo('productprint') . '/{param}', array('mode' => 'frontend', 'controller' => 'productprint', 'action' => 'index', 'param' => NULL), array('_scheme' => 'http', 'param' => '.+')));
$this->routes->add('frontend.clientlogin', new Route('/' . Seo::getSeo('clientlogin') . '/{param}', array('mode' => 'frontend', 'controller' => 'clientlogin', 'action' => 'index', 'param' => NULL), array('_scheme' => SSLNAME)));
$this->routes->add('frontend.registration', new Route('/' . Seo::getSeo('registration') . '/{param}', array('mode' => 'frontend', 'controller' => 'registration', 'action' => 'index', 'param' => NULL), array('_scheme' => SSLNAME)));
$this->routes->add('frontend.contact', new Route('/' . Seo::getSeo('contact') . '/{param}', array('mode' => 'frontend', 'controller' => 'contact', 'action' => 'index', 'param' => NULL), array('_scheme' => SSLNAME)));
$this->routes->add('frontend.sitemap', new Route('/' . Seo::getSeo('sitemap') . '/{param}', array('mode' => 'frontend', 'controller' => 'sitemap', 'action' => 'index', 'param' => NULL), array('_scheme' => 'http', 'param' => '\\d+')));
$this->routes->add('frontend.forgotpassword', new Route('/' . Seo::getSeo('forgotpassword') . '/{action}/{param}', array('mode' => 'frontend', 'controller' => 'forgotpassword', 'action' => 'index', 'param' => NULL), array('_scheme' => SSLNAME)));
$this->routes->add('frontend.productsearch', new Route('/' . Seo::getSeo('productsearch') . '/{param},{currentPage},{orderBy},{orderDir},{viewType},{priceFrom},{priceTo},{producers},{attributes}', array('mode' => 'frontend', 'controller' => 'productsearch', 'action' => 'index', 'param' => NULL, 'orderBy' => 'default', 'orderDir' => 'desc', 'viewType' => 1, 'currentPage' => NULL, 'priceFrom' => NULL, 'priceTo' => NULL, 'producers' => NULL, 'attributes' => NULL), array('_scheme' => 'http', 'param' => '[^,]+', 'currentPage' => '\\d{1,10}', 'orderBy' => '[\\w-\\/]+', 'orderDir' => 'asc|desc', 'viewType' => '\\d', 'priceFrom' => '[\\d+\\.]+', 'priceTo' => '[\\d+\\.]+', 'producers' => '[\\d+_]+', 'attributes' => '[\\d+_]+')));
$this->routes->add('frontend.productnews', new Route('/' . Seo::getSeo('productnews') . '/{currentPage},{orderBy},{orderDir},{viewType},{priceFrom},{priceTo},{producers},{attributes}', array('mode' => 'frontend', 'controller' => 'productnews', 'action' => 'index', 'param' => NULL, 'orderBy' => NULL, 'orderDir' => NULL, 'viewType' => NULL, 'currentPage' => NULL, 'priceFrom' => NULL, 'priceTo' => NULL, 'producers' => NULL, 'attributes' => NULL), array('_scheme' => 'http', 'currentPage' => '\\d{1,10}', 'orderBy' => '\\w+', 'orderDir' => 'asc|desc', 'priceFrom' => '[\\d+\\.]+', 'priceTo' => '[\\d+\\.]+', 'producers' => '[\\d_]+', 'attributes' => '[\\d_]+')));
$this->routes->add('frontend.productpromotion', new Route('/' . Seo::getSeo('productpromotion') . '/{currentPage},{orderBy},{orderDir},{viewType},{priceFrom},{priceTo},{producers},{attributes}', array('mode' => 'frontend', 'controller' => 'productpromotion', 'action' => 'index', 'param' => NULL, 'orderBy' => NULL, 'orderDir' => NULL, 'viewType' => NULL, 'currentPage' => NULL, 'priceFrom' => NULL, 'priceTo' => NULL, 'producers' => NULL, 'attributes' => NULL), array('_scheme' => 'http', 'currentPage' => '\\d{1,10}', 'orderBy' => '\\w+', 'orderDir' => 'asc|desc', 'priceFrom' => '[\\d+\\.]+', 'priceTo' => '[\\d+\\.]+', 'producers' => '[\\d_]+', 'attributes' => '[\\d_]+')));
$this->routes->add('frontend.news', new Route('/' . Seo::getSeo('news') . '/{param}/{slug}', array('mode' => 'frontend', 'controller' => 'news', 'action' => 'index', 'param' => NULL, 'slug' => NULL), array('_scheme' => 'http', 'param' => '.+')));
$this->routes->add('frontend.kodyrabatowe', new Route('/kodyrabatowe', array('mode' => 'frontend', 'controller' => 'kodyrabatowe', 'action' => 'index', 'param' => NULL), array('_scheme' => 'http', 'param' => '.+')));
$this->routes->add('frontend.payment', new Route('/' . Seo::getSeo('payment') . '/{action}/{param}', array('mode' => 'frontend', 'controller' => 'payment', 'action' => 'index', 'param' => NULL), array('_scheme' => SSLNAME, 'param' => '.+')));
$this->routes->add('frontend.instancereport', new Route('/instancereport/{action}/{param}', array('mode' => 'frontend', 'controller' => 'instancereport', 'action' => 'index', 'param' => NULL), array('_scheme' => 'http', 'param' => '.+')));
$this->routes->add('admin.login', new Route('/' . __ADMINPANE__, array('mode' => 'admin', 'controller' => 'login', 'action' => 'index', 'param' => NULL), array('_scheme' => 'http')));
$this->routes->add('admin', new Route('/' . __ADMINPANE__ . '/{controller}/{action}/{param}', array('mode' => 'admin', 'action' => 'index', 'param' => NULL), array('_scheme' => 'http')));
$this->routes->add('frontend.sitemap', new Route('/xmlsitemap', array('mode' => 'frontend', 'controller' => 'sitemap', 'action' => 'sitemap', 'param' => NULL), array('_scheme' => 'http')));
return $this->routes;