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); }
public static function frontendProductList(&$product, $products) { $plugin = wa('shop')->getPlugin('lang'); $main = $plugin->getSettings('main'); if (self::currentLang() !== $main) { $model = new shopLangPluginProductModel(); $product_ids = array_keys($products); $data = $model->getFromList($product['id'], $product_ids, self::currentLang()); $product = shopLangPluginHelper::prepareProduct($product, $data); } }