Index: www-lp/www/includes/classes/PriceFormatter.php =================================================================== diff -u -r37 -r45 --- www-lp/www/includes/classes/PriceFormatter.php (.../PriceFormatter.php) (revision 37) +++ www-lp/www/includes/classes/PriceFormatter.php (.../PriceFormatter.php) (revision 45) @@ -38,6 +38,8 @@ */ // <- [SI-LINDER-PARTNER-2][OSC] - Refonte du site Internet pour supporter le Responsive Design + + class PriceFormatter { function PriceFormatter() { @@ -50,16 +52,17 @@ $this->lowPrice = -1; $this->hasSpecialPrice = false; //tep_not_null($this->specialPrice); $this->specialPrice = NULL; //$prices['specials_new_products_price']; + // -> OSC-94 - Prix par palier reservé aux professionnels - if ( is_pro_customer() or ! is_null($price_breaks_from_listing) ) // on fournit une liste dans $price_breaks_from_listing, on doit donc autoriser les prix par palier - $this->price_breaks_allowed = true; + + global $um; // user manager object + + if ($um->is_pro() or ! is_null($price_breaks_from_listing)) + $this->price_breaks_allowed = true; else $this->price_breaks_allowed = false; // <- OSC-94 - Prix par palier reservé aux professionnels $this->Partner_price = -1; - - - } function loadProduct($product_id, $language_id = 1, $listing = NULL, $price_breaks_from_listing = NULL) { @@ -864,29 +867,32 @@ // ([7])-->[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::BEGIN $cssClassOfPriceDisplay_HT = ''; $cssClassOfPriceDisplay_TTC = ''; - - if (tep_session_is_registered('customer_id')) { - if ($is_partner == true OR is_pro_customer() == true) { - $cssClassOfPriceDisplay_HT = '--pleaseDisplayMyPriceString'; - $cssClassOfPriceDisplay_TTC = '--pleaseNotDisplayMyPriceString'; - // ([10])-->BEGIN[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::END - // echo '$is_partner = '; var_dump($is_partner); die ('
STOP'); - // ([9])-->[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::BEGIN - if ($is_partner == true) { - $customerProfile = 'pf:Partenaire'; - } - else if (is_pro_customer() == true) { - $customerProfile = 'pf:Professionnel'; - } - // ([9])-->[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::END - } else { - $cssClassOfPriceDisplay_HT = '--pleaseNotDisplayMyPriceString'; - $cssClassOfPriceDisplay_TTC = '--pleaseDisplayMyPriceString'; - } - } else { + + + global $um; // user manager object + + if ($um->is_partner() OR $um->is_pro() ) { + $cssClassOfPriceDisplay_HT = '--pleaseDisplayMyPriceString'; + $cssClassOfPriceDisplay_TTC = '--pleaseNotDisplayMyPriceString'; + // ([10])-->BEGIN[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::END + // echo '$is_partner = '; var_dump($is_partner); die ('
STOP'); + // ([9])-->[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::BEGIN + } + else if ($um->is_partner()) { + $customerProfile = 'pf:Partenaire'; + } + else if ($um->is_pro()) { + $customerProfile = 'pf:Professionnel'; + } + // ([9])-->[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::END + else if ($um->is_end_user() ) { $cssClassOfPriceDisplay_HT = '--pleaseNotDisplayMyPriceString'; $cssClassOfPriceDisplay_TTC = '--pleaseDisplayMyPriceString'; } + else { // $um->is_anonymous + $cssClassOfPriceDisplay_HT = '--pleaseNotDisplayMyPriceString'; + $cssClassOfPriceDisplay_TTC = '--pleaseDisplayMyPriceString'; + } // ([7])-->[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::END // -> OSC-70 : Gestion HT/TTC : affichage prix HT et TTC @@ -970,7 +976,7 @@ $lc_text = '' // ([5])-->[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::BEGIN // ([7])-->BEGIN[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::END - /* + . '' // ([8])-->[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::BEGIN . '' @@ -982,7 +988,7 @@ // ([3])-->BEGIN[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::END . '
' . '
' - */ + // ([5])-->[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::END // ([3])-->BEGIN[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::END // . '
' @@ -1209,7 +1215,7 @@ // ([1])-->[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::BEGIN // ([2])-->[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::BEGIN // -> VDQPBPP135 : possibilité d'aligner les prix à gauche/droite - function getPriceStringVersion2($style='productPriceInBox', $align='right', $mode='Standard', $ttc_displayer='Non!') { + function getPriceStringVersion2($style='productPriceInBox', $align='right', $mode='Standard', $ttc_displayer='Oui!') { // <- VDQPBPP135 global $currencies; @@ -1218,33 +1224,34 @@ // ([6])-->BEGIN[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::END $customerProfile = 'pf:Standard'; - + $affichageTTC = $ttc_displayer; // ([18])-->[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::BEGIN $cssClassOfTableDisplayPriceBreak = ''; - - if (tep_session_is_registered('customer_id')) { - if ($is_partner == true OR is_pro_customer() == true) { - $cssClassOfTableDisplayPriceBreak = '--pleaseDisplayMyPriceTable ---orAdaptFor --proOrPartnerCustomer'; - // ([9])-->BEGIN[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::END - // echo '$is_partner = '; var_dump($is_partner); die ('
STOP'); - // ([7])-->[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::BEGIN - if ($is_partner == true) { - $customerProfile = 'pf:Partenaire'; - } - else if (is_pro_customer() == true) { - $customerProfile = 'pf:Professionnel'; - } - // ([7])-->[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::END - } else { - $cssClassOfTableDisplayPriceBreak = '--pleaseNotDisplayMyPriceTable ---orAdaptFor --standardOrVisitorCustomer'; - } - } else { - $cssClassOfTableDisplayPriceBreak = '--pleaseNotDisplayMyPriceTable ---orAdaptFor --standardOrVisitorCustomer'; + + global $um; // user manager object + + if ($um->is_partner()) { + $customerProfile = 'pf:Partenaire'; + $affichageTTC = 'Non!'; + $cssClassOfTableDisplayPriceBreak = '--pleaseDisplayMyPriceTable ---orAdaptFor --proOrPartnerCustomer'; } + else if ($um->is_pro()) { + $customerProfile = 'pf:Professionnel'; + $affichageTTC = 'Non!'; + $cssClassOfTableDisplayPriceBreak = '--pleaseDisplayMyPriceTable ---orAdaptFor --proOrPartnerCustomer'; + } + // ([9])-->[VTAB-TEAM-LINDER-PARTNER-1][OSC][SubTaskDescription]::END + else if ($um->is_end_user()) { + $cssClassOfTableDisplayPriceBreak = '--pleaseNotDisplayMyPriceTable ---orAdaptFor --standardOrVisitorCustomer'; + } + else { // $um->is_anonymous + $cssClassOfTableDisplayPriceBreak = '--pleaseNotDisplayMyPriceTable ---orAdaptFor --standardOrVisitorCustomer'; + } + // ([18])-->[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::END // ([6])-->BEGIN[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::END - $affichageTTC = $ttc_displayer; + //$affichageTTC = $ttc_displayer; permet de changer les prix par palliers en TTC // ([9])-->[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::BEGIN $classPriceFormatter__referencers = array( @@ -1309,14 +1316,17 @@ . $price_break['products_qty'] .'+ '; } + // VDALLOWPB : do not display price in HT for end-user + if ($affichageTTC == 'Non!') { - // -> OSC-70 : Gestion HT/TTC : affichage prix HT et TTC - /* - * Modification informative du texte d'une ligne dans le tableau des prix par palliers - * (renommage de l'ancienne constante: "TEXT_PRICE_PER_PIECE" par "TEXT_PRICE_PER_PIECE__HT"). - * De fait l'on se sert d'un texte prévenant que dans cette ligne du tableau, les prix affichés sont en HT. - * - */ + + // -> OSC-70 : Gestion HT/TTC : affichage prix HT et TTC + /* + * Modification informative du texte d'une ligne dans le tableau des prix par palliers + * (renommage de l'ancienne constante: "TEXT_PRICE_PER_PIECE" par "TEXT_PRICE_PER_PIECE__HT"). + * De fait l'on se sert d'un texte prévenant que dans cette ligne du tableau, les prix affichés sont en HT. + * + */ // ([4])-->[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::BEGIN if ($mode == 'OnlyPriceBreaker') { // ([18])-->BEGIN[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::END @@ -1330,7 +1340,7 @@ $lc_text .= '' . TEXT_PRICE_PER_PIECE__HT . ''; } // ([4])-->[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::END - // <- OSC-70 : Créér un double-affichage des prix pour les produits (HT/TTC) + // <- OSC-70 : Créér un double-affichage des prix pour les produits (HT/TTC) // ([5])-->[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::BEGIN @@ -1350,7 +1360,7 @@ } // -> OSC-94 - Prix par palier reservé aux professionnels - if ( ! $this->price_breaks_allowed) + if ( !$this->price_breaks_allowed) // ([15])-->BEGIN[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::END $lc_text .= 'Accès PRO'; else @@ -1483,8 +1493,11 @@ // ([5])-->[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::END $lc_text .= ''; + // VDALLOWPB : do not display price in HT for end-user + } + // ([7])-->[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::BEGIN if ($affichageTTC != 'Non!' and $affichageTTC == 'Oui!') { // -> OSC-70 : Gestion HT/TTC : affichage prix HT et TTC @@ -1560,7 +1573,7 @@ // <- OSC-70 : Gestion HT/TTC : affichage prix HT et TTC } // ([7])-->[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::END - + // ([8])-->[SI-LINDER-PARTNER-2][OSC][SubTaskDescription]::BEGIN if ($mode == 'OnlyPriceBreaker') {