eagleman Posted June 29, 2022 Share Posted June 29, 2022 Bonjour, Je voudrais afficher les produits d'une catégorie spécifique quand je mets ce code il m'affiche tous les produits {foreach from=$products item=product name=products} {$product.name|escape:'htmlall':'UTF-8'} {/foreach} J'utilise la version PS 1.7.8.6 Cordialement, Link to comment Share on other sites More sharing options...
Mediacom87 Posted June 29, 2022 Share Posted June 29, 2022 Où ? Link to comment Share on other sites More sharing options...
eagleman Posted June 29, 2022 Author Share Posted June 29, 2022 Bonjour, J'ai créé une page dans /public_html/controllers/front/AutoDiagController.php public function initContent() { $module = new cdkeys(); $psversion = $module->psversion(); $cdkeys = CdKeysArchive::getAllByCustomer($this->context->customer->id); if (!is_array($cdkeys)) { $cdkeys = array(); } parent::initContent(); $products_partial = Product::getProducts($this->context->language->id, 0, 50, 'name', 'asc'); $products = Product::getProductsProperties($this->context->language->id, $products_partial); $this->context->smarty->assign(array( 'products' => $products, 'homeSize' => Image::getSize('home_default'), 'cdkeys' => $cdkeys, 'cdkeys_count' => count($cdkeys), 'cdkeys_customer' => $this->context->customer, 'psversion' => $psversion )); $this->setTemplate('AutoDiag.tpl'); } /public_html/themes/mytheme/templates/AutoDiag.tpl Cordialement, Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now