Jump to content

intercepter les variable passer à Smarty (presta 1.7)


amaneuz

Recommended Posts

Bonjour,

 

Je viens vers vous pour savoir comment on fait pour intercepter les variables smarty:  exemple product['prix_min'] et product['prix_max']:

 

foreach ($product_collection as $key => $product) {
            if (isset($filter_value) && $filter_value && isset($product['price_min']) && isset($product['id_product'])
            && (($product['price_min'] < (int) $filter_value[0] && $product['price_max'] > (int) $filter_value[0])
                || ($product['price_max'] > (int) $filter_value[1] && $product['price_min'] < (int) $filter_value[1]))) {
                $price = Product::getPriceStatic($product['id_product'], $ps_layered_filter_price_usetax);
                if ($ps_layered_filter_price_rounding) {
                    $price = (int) $price;
                }
                if ($price < $filter_value[0] || $price > $filter_value[1]) {
                    unset($product_collection[$key]);
                }
            }
        }
       
        $smarty->assign(array('produits',$product)); // j'ai ajouté ces deux lignes
        $smarty->display(__PS_THEME_DIR__, 'templates/catalog/_partials/facets.tpl');
        return $product_collection;
 
je veux afficher dans le .tpl les variable prix_min et prix_max, du coup quand je mets : {$produits} dans le fichier facets.tpl, ça m'affiche rien.
 
 
merci d'avance.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...