Jump to content
Sign in to follow this  
caco

[RESOLU] Prix mimimun pour une commande

Recommended Posts

Bonjour,

Je voudrais savoir s'il est possible de faire en sorte que les clients ne puissent commander qu'à partir d'un certain prix.
Par exemple s'ils commandent pour moins de 100euros, le seule mode de "livraison" est le retrait au magasin. Au delà de 100 euros, ils peuvent être livrés chez eux.
Je n'ai pas l'impression que ce soit possible, mais je voudrais en être sûre.

Merci d'avance de vos réponses! ;)

Share this post


Link to post
Share on other sites

Hi there! I can't speak French - hopefully Babelfish can translate this for you.

Two things you have to do here:

a) In admin/shipping/carriers, edit your carrier and set out of range behavior to "disable carrier."

B) See my comments in this bug report:
http://www.prestashop.com/bug_tracker/view/2605/

apply my fix and it will work. Just tested on 1.2.4.

Share this post


Link to post
Share on other sites

I just realized I left out some background steps which you may not have already done:

i) In Admin->Shipping, set Billing to be done according to total price.

ii) In Admin->Shipping->Price Ranges, set the range for the shipping option you want to disable under E100 to start at E100 (and go to some large number).

Share this post


Link to post
Share on other sites

Please post only in French in this forums. Next time I'll have to delete your posts.

Share this post


Link to post
Share on other sites
Hi there! I can't speak French - hopefully Babelfish can translate this for you.

Two things you have to do here:

a) In admin/shipping/carriers, edit your carrier and set out of range behavior to "disable carrier."

B) See my comments in this bug report:
http://www.prestashop.com/bug_tracker/view/2605/

apply my fix and it will work. Just tested on 1.2.4.


Peux tu me dire où mettre
AND ‘.floatval($orderTotal).’ >= r.`delimiter1`

exactement?
J'ai peur de faire une bêtise... :-)

Share this post


Link to post
Share on other sites

Version 1.2.4 classes/Carrier.php

remplacez la fonction -checkDeliveryPriceByWeight- checkDeliveryPriceByPrice avec


   
   static public function checkDeliveryPriceByPrice($id_carrier, $orderTotal, $id_zone)
   {
       $result = Db::getInstance()->getRow('
       SELECT d.`price`
       FROM `'._DB_PREFIX_.'delivery` d
       LEFT JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price`
       WHERE d.`id_zone` = '.intval($id_zone).'
       AND ‘.floatval($orderTotal).’ >= r.`delimiter1` 
       AND '.floatval($orderTotal).' <= r.`delimiter2`
       AND d.`id_carrier` = '.intval($id_carrier).'
       ORDER BY r.`delimiter1` ASC');
       if (!isset($result['price']))
           return false;
       return true;
   }



Note: checkDeliveryPriceByWeight inexactement dit original message.

Share this post


Link to post
Share on other sites

J'ai la version 1.2.4 et quand je remplace

static public function checkDeliveryPriceByWeight($id_carrier, $totalWeight, $id_zone)
   {
       $result = Db::getInstance()->getRow('
       SELECT d.`price`
       FROM `'._DB_PREFIX_.'delivery` d
       LEFT JOIN `'._DB_PREFIX_.'range_weight` w ON d.`id_range_weight` = w.`id_range_weight`
       WHERE d.`id_zone` = '.intval($id_zone).'
       AND '.floatval($totalWeight).' <= w.`delimiter2`
       AND d.`id_carrier` = '.intval($id_carrier).'
       ORDER BY w.`delimiter1` ASC');
       if (!isset($result['price']))
           return false;
       return true;
   }



par le code que tu proposes, mon panier disparaît, et du coup, impossible de commander quoi que ce soit ! :-(

C'est bien cette partie qu'il faut remplacer par ton code?

Share this post


Link to post
Share on other sites

Fonction fausse. Pas checkDeliveryPriceByWeight. Vous voulez *checkDeliveryPriceByPrice*.

Share this post


Link to post
Share on other sites

Je dois avoir l'esprit embrumé, mais je dois remplacer quoi par quoi finalement? :)

Share this post


Link to post
Share on other sites

Désolé pour la confusion. L'inscription en français est très difficile pour moi.

remplacez la fonction *checkDeliveryPriceByPrice()* avec

static public function checkDeliveryPriceByPrice($id_carrier, $orderTotal, $id_zone)
   {
       $result = Db::getInstance()->getRow('
       SELECT d.`price`
       FROM `'._DB_PREFIX_.'delivery` d
       LEFT JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price`
       WHERE d.`id_zone` = '.intval($id_zone).'
       AND ‘.floatval($orderTotal).’ >= r.`delimiter1` 
       AND '.floatval($orderTotal).' <= r.`delimiter2`
       AND d.`id_carrier` = '.intval($id_carrier).'
       ORDER BY r.`delimiter1` ASC');
       if (!isset($result['price']))
           return false;
       return true;
   } 

Share this post


Link to post
Share on other sites

Great!!!!!
C'est exactement ce que je cherchais!
Merci beaucoup, ça fonctionne à merveille!
:)

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More