Jump to content

Prix des produits affiché si client identifié


Jean-Bruno

Recommended Posts

Bonjour à tous
J'aimerais essayé de n'afficher mes prix que si l'internaute s'est connecter et identifié (en gros qu'il a accès à la rubrique "mon compte")
Il y a un fil un peu similaire qui donnait une piste mais je ne vois pas en pratique comment procédé.
http://www.prestashop.com/forums/viewthread/4016/
Il me semblait aussi avoir vu une case à cocher "affiché les prix". J'ai révé ?
En vous remerciant

Link to comment
Share on other sites

Bonjour,

comme indiqué dans la réponse de Pierre Yves, tu dois utiliser ce bout de code dans la page product.tpl.
Si tu utilises le template de base, recherche la partie suivante :

            


               {if $product->on_sale}

{l s='On sale!'}
               {elseif ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))}
{l s='Price lowered!'}
               {/if}


{convertPrice price=$product->getPrice(true, NULL, 2)} {if $product->getPrice(true, NULL, 2) != $product->getPrice(false, NULL, 2)}{l s='incl. tax'}{/if}


               {if $displayPreTax AND $display_ht AND $product->id_tax}


{l s='('}{convertPrice price=$product->getPrice(false, NULL, 2)} {l s='tax not incl.)'}
               {/if}

           {if ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))}

{convertPrice price=$product->getPriceWithoutReduct()} {l s='incl. tax'}
           {/if}
           {if $product->reduction_percent != 0 && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))}

{l s='(price reduced by'} {$product->reduction_percent|floatval} %{l s=')'}
           {/if}
           {if $product->ecotax != 0}

{l s='include'} {convertPrice price=$product->ecotax} {l s='for green tax'}
           {/if}


pour la remplacer par ceci :

            {if $logged == true}


               {if $product->on_sale}

{l s='On sale!'}
               {elseif ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))}
{l s='Price lowered!'}
               {/if}


{convertPrice price=$product->getPrice(true, NULL, 2)} {if $product->getPrice(true, NULL, 2) != $product->getPrice(false, NULL, 2)}{l s='incl. tax'}{/if}


               {if $displayPreTax AND $display_ht AND $product->id_tax}


{l s='('}{convertPrice price=$product->getPrice(false, NULL, 2)} {l s='tax not incl.)'}
               {/if}

           {if ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))}

{convertPrice price=$product->getPriceWithoutReduct()} {l s='incl. tax'}
           {/if}
           {if $product->reduction_percent != 0 && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))}

{l s='(price reduced by'} {$product->reduction_percent|floatval} %{l s=')'}
           {/if}
           {if $product->ecotax != 0}

{l s='include'} {convertPrice price=$product->ecotax} {l s='for green tax'}
           {/if}
           {else}{l s='Please log in to see our prices'}{/if}



répète l'opération pour les autres pages de ton template où sont afficher les prix.

@+

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