Jump to content

[RESOLU]Prix d'achat HT :


jherbaux

Recommended Posts

Bonjour, bonjour

Alors voila, j'aimerai afficher les prix du panier en Prix d'achat HT, comme je les fait pour ma boutique c'est donc le wholesale_price dans la bdd si je ne me trompe pas.

Problème je n'est pas cette valeur dans mon panier... alors pour aller la rechercher je pense qu'il faut la rentrer dans la variable $products du fichier blockcart.php a ce niveau là

        $products = $params['cart']->getProducts(true);
       foreach ($products as $k => $product)
           $products[$k]['real_price'] = Product::getPriceStatic($product['id_product'], intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true, $product['id_product_attribute'], 6, NULL, false, true, $product['cart_quantity']) * $product['cart_quantity'];



et donc sa redirige dans le fichier product.php a cette endroit là

        $result = Db::getInstance()->getRow('
       SELECT p.`price`, p.`reduction_price`, p.`reduction_percent`, p.`reduction_from`, p.`reduction_to`, p.`id_tax`, p`wholesale_price`, t.`rate`, 
       '.($id_product_attribute ? 'pa.`price`' : 'IFNULL((SELECT pa.price FROM `'._DB_PREFIX_.'product_attribute` pa WHERE id_product = '.intval($id_product).' AND default_on = 1), 0)').' AS attribute_price
       FROM `'._DB_PREFIX_.'product` p
       '.($id_product_attribute ? 'LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON pa.`id_product_attribute` = '.intval($id_product_attribute) : '').'
       LEFT JOIN `'._DB_PREFIX_.'tax` AS t ON t.`id_tax` = p.`id_tax`
       WHERE p.`id_product` = '.intval($id_product));
       $price = $result['price'];



J'ai donc rajouter le p`wholesale_price` mais ca ne marche pas... J'ai du oublier un truc...
Pourtant j'ai tous fait, j'ai été chercher mon champ, m table... J'ai prier... et toujours rien...

Merci de votre aide.


[edit]J'ai pas fait 3 fois le tour de la piéce c'est pour sa....

c'était pas le fichier product.php qui fallais modifier mais le cart.php
a cette fonction la: getProducts

[/edit]

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...