didier.auss Posted September 28, 2010 Share Posted September 28, 2010 Bonjour,Étant entrain de finaliser un site, je suis entrain de vérifier le module PARRAINAGE. Il a été décider d'appliquer une remise en % et non en montant d'euro.Il y a un bug dans un des emails envoyés au filleul la valeur de la remise s'exprime en montant d'euro, voir la copie ci-dessous :Voici le numéro de votre bon de réduction : {voucher_num}, de {voucher_amount} Il faut juste changer la {variable} qui n'est pas la bonne : {voucher_amount} = 10 € alors que l'on voudrait {voucher_???} = 10 %Si quelqu'un connait la bonne variable car n'etant pas développeur … c'est pas simple Link to comment Share on other sites More sharing options...
bliscar Posted December 4, 2010 Share Posted December 4, 2010 Bonjour,J'ai le même problème.As-tu trouver une solution à ce problème ?Merci par avance de ta réponse. Link to comment Share on other sites More sharing options...
BVince Posted December 4, 2010 Share Posted December 4, 2010 Bonjour,je pense que le problème se situe à la ligne 440 du fichier referralprogram.php : $data = array( '{firstname}' => $newCustomer->firstname, '{lastname}' => $newCustomer->lastname, '{voucher_num}' => $discount->name, '{voucher_amount}' => Tools::displayPrice(floatval(Configuration::get('REFERRAL_DISCOUNT_VALUE_'.intval($cookie->id_currency))), intval(Configuration::get('PS_CURRENCY_DEFAULT')))); je changerai de cette manière : $data = array( '{firstname}' => $newCustomer->firstname, '{lastname}' => $newCustomer->lastname, '{voucher_num}' => $discount->name, '{voucher_amount}' => Configuration::get('REFERRAL_DISCOUNT_TYPE') == 2 ? Tools::displayPrice(floatval(Configuration::get('REFERRAL_DISCOUNT_VALUE_'.intval($cookie->id_currency)), intval(Configuration::get('PS_CURRENCY_DEFAULT')))) : Configuration::get('REFERRAL_DISCOUNT_VALUE')."%"); à essayer... Link to comment Share on other sites More sharing options...
Wlieo Posted December 6, 2010 Share Posted December 6, 2010 Bonjour,ça n'a pas fonctionné pour moi, le symbole du pourcentage est bien affiché mais la valeur n'apparaît plus.Ex. : ...d'un montant total de %Merci d'avance pour ceux qui trouverons la solution. Link to comment Share on other sites More sharing options...
BVince Posted December 6, 2010 Share Posted December 6, 2010 Pardon, une erreur s'est glissée dans ma modification : $data = array( '{firstname}' => $newCustomer->firstname, '{lastname}' => $newCustomer->lastname, '{voucher_num}' => $discount->name, '{voucher_amount}' => Configuration::get('REFERRAL_DISCOUNT_TYPE') == 2 ? Tools::displayPrice(floatval(Configuration::get('REFERRAL_DISCOUNT_VALUE_'.intval($cookie->id_currency)), intval(Configuration::get('PS_CURRENCY_DEFAULT')))) : Configuration::get('REFERRAL_DISCOUNT_VALUE_'.intval($cookie->id_currency)."%"); Link to comment Share on other sites More sharing options...
Wlieo Posted December 6, 2010 Share Posted December 6, 2010 J'ai trouvé une solution qui fonctionne pour moi dans les 2 cas (Pourcentage et Montant):v1.3.1 if (Validate::isLoadedObject($discount)) { if (Configuration::get('REFERRAL_DISCOUNT_TYPE') == 2) { $data = array( '{firstname}' => $newCustomer->firstname, '{lastname}' => $newCustomer->lastname, '{voucher_num}' => $discount->name, '{voucher_amount}' => Tools::displayPrice(floatval(Configuration::get('REFERRAL_DISCOUNT_VALUE_'.intval($cookie->id_currency))), intval(Configuration::get('PS_CURRENCY_DEFAULT')))); } else { $data = array( '{firstname}' => $newCustomer->firstname, '{lastname}' => $newCustomer->lastname, '{voucher_num}' => $discount->name, '{voucher_amount}' => Configuration::get('REFERRAL_DISCOUNT_VALUE_'.intval($cookie->id_currency))."%"); } Mail::Send(intval($cookie->id_lang), 'referralprogram-voucher', $this->l('Congratulations!'), $data, $newCustomer->email, $newCustomer->firstname.' '.$newCustomer->lastname, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/'); } A confirmer... Link to comment Share on other sites More sharing options...
Wlieo Posted December 6, 2010 Share Posted December 6, 2010 Salut BVince,J'ai testé ton code mais lorsqu'on passe en Type de bon "Montant", la valeur affichée est à 0. '{voucher_amount}' => Configuration::get('REFERRAL_DISCOUNT_TYPE') == 2 ? Tools::displayPrice(floatval(Configuration::get('REFERRAL_DISCOUNT_VALUE_'.intval($cookie->id_currency)), intval(Configuration::get('PS_CURRENCY_DEFAULT')))) : Configuration::get('REFERRAL_DISCOUNT_VALUE_'.intval($cookie->id_currency)."%")); PS : Il faut ajouter une parenthèse fermante à la ligne de code que tu nous as proposé. 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