public function execute()
 {
     $plugin = wa('shop')->getPlugin('lang');
     $lang = $plugin->getSettings('langs');
     $this->view->assign('langs', $lang);
     $model = new shopLangPluginProductModel();
     $data = $model->getById(waRequest::get('id', 0, waRequest::TYPE_INT));
     $this->view->assign('data', $data);
 }
Пример #2
0
 public static function frontendProduct(&$product, &$features, &$features_selectable)
 {
     $plugin = wa('shop')->getPlugin('lang');
     $main = $plugin->getSettings('main');
     if (self::currentLang() !== $main) {
         $model = new shopLangPluginProductModel();
         $data = $model->getById($product['id'], self::currentLang());
         $product = shopLangPluginHelper::prepareProduct($product, $data);
         $fm = new shopLangPluginFeatureModel();
         $product->features = $fm->getValues($product['id'], self::currentLang());
         if (!empty($features)) {
             $features = $fm->getFeatures($features, self::currentLang());
         }
         if (!empty($features_selectable)) {
             $features_selectable = $fm->getFeatures($features_selectable, self::currentLang());
         }
         shopLangPluginHelper::prepareMeta($data);
     }
 }