Jump to content

[SURCHARGE 1.5 RC1] Frais de port gratuit uniquement pour le pays de la boutique


Recommended Posts

Salut,

Encore et toujours les problèmes de fdp gratuit que pour le pays de la boutique, toujours pas régler dans la RC.1

Comme il risque d'y avoir encore pas mal de demande sur le sujet, je post ici une modeste contribution, qui vous permettras d'offrir les fdp pour le pays que vous voulez, le groupe que vous voulez ainsi que l'affichage de la phrase "Pour obtenir la gratuité des frais de port, vous devez encore commander pour XXX €" en conséquence.

Créer un fichier Cart.php dans lequel vous insérez les lignes suivante:

<?php
class Cart extends CartCore
{
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null)
{
 if ($this->isVirtualCart())
  return 0;
 if (!$default_country)
  $default_country = Context::getContext()->country;
 $complete_product_list = $this->getProducts();
 if (is_null($product_list))
  $products = $complete_product_list;
 else
  $products = $product_list;
 if (Configuration::get('PS_TAX_ADDRESS_TYPE') == 'id_address_invoice')
  $address_id = (int)$this->id_address_invoice;
 elseif (count($product_list))
 {
  $prod = current($product_list);
  $address_id = (int)$prod['id_address_delivery'];
 }
 else
  $address_id = null;
 if (!Address::addressExists($address_id))
  $address_id = null;
 // Order total in default currency without fees
 $order_total = $this->getOrderTotal(true, Cart::ONLY_PHYSICAL_PRODUCTS_WITHOUT_SHIPPING, $product_list);
 // Start with shipping cost at 0
 $shipping_cost = 0;
 // If no product added, return 0
 if ($order_total <= 0
  && (
!(Cart::getNbProducts($this->id) && is_null($product_list))
||
(count($product_list) && !is_null($product_list))
 ))
  return $shipping_cost;
 // Get id zone
 if (!$this->isMultiAddressDelivery()
  && isset($this->id_address_delivery) // Be carefull, id_address_delivery is not usefull one 1.5
  && $this->id_address_delivery
  && Customer::customerHasAddress($this->id_customer, $this->id_address_delivery
 ))
  $id_zone = Address::getZoneById((int)$this->id_address_delivery);
 else
 {
  if (!Validate::isLoadedObject($default_country))
$default_country = new Country(Configuration::get('PS_COUNTRY_DEFAULT'), Configuration::get('PS_LANG_DEFAULT'));
  $id_zone = (int)$default_country->id_zone;
 }
 if ($id_carrier && !$this->isCarrierInRange((int)$id_carrier, (int)$id_zone))
  $id_carrier = '';
 if (empty($id_carrier) && $this->isCarrierInRange((int)Configuration::get('PS_CARRIER_DEFAULT'), (int)$id_zone))
  $id_carrier = (int)Configuration::get('PS_CARRIER_DEFAULT');
 if (empty($id_carrier))
 {
  if ((int)$this->id_customer)
  {
$customer = new Customer((int)$this->id_customer);
$result = Carrier::getCarriers((int)Configuration::get('PS_LANG_DEFAULT'), true, false, (int)$id_zone, $customer->getGroups());
unset($customer);
  }
  else
$result = Carrier::getCarriers((int)Configuration::get('PS_LANG_DEFAULT'), true, false, (int)$id_zone);
  foreach ($result as $k => $row)
  {
if ($row['id_carrier'] == Configuration::get('PS_CARRIER_DEFAULT'))
 continue;
if (!isset(self::$_carriers[$row['id_carrier']]))
 self::$_carriers[$row['id_carrier']] = new Carrier((int)$row['id_carrier']);
$carrier = self::$_carriers[$row['id_carrier']];
// Get only carriers that are compliant with shipping method
if (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT && $carrier->getMaxDeliveryPriceByWeight((int)$id_zone) === false)
|| ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE && $carrier->getMaxDeliveryPriceByPrice((int)$id_zone) === false))
{
 unset($result[$k]);
 continue;
}
// If out-of-range behavior carrier is set on "Desactivate carrier"
if ($row['range_behavior'])
{
 $check_delivery_price_by_weight = Carrier::checkDeliveryPriceByWeight($row['id_carrier'], $this->getTotalWeight(), (int)$id_zone);
 $total_order = $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING, $product_list);
 $check_delivery_price_by_price = Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $total_order, (int)$id_zone, (int)$this->id_currency);
 // Get only carriers that have a range compatible with cart
 if (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT && !$check_delivery_price_by_weight)
 || ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE && !$check_delivery_price_by_price))
 {
  unset($result[$k]);
  continue;
 }
}
if ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT)
 $shipping = $carrier->getDeliveryPriceByWeight($this->getTotalWeight($product_list), (int)$id_zone);
else
 $shipping = $carrier->getDeliveryPriceByPrice($order_total, (int)$id_zone, (int)$this->id_currency);
if (!isset($min_shipping_price))
 $min_shipping_price = $shipping;
if ($shipping <= $min_shipping_price)
{
 $id_carrier = (int)$row['id_carrier'];
 $min_shipping_price = $shipping;
}
  }
 }
 if (empty($id_carrier))
  $id_carrier = Configuration::get('PS_CARRIER_DEFAULT');
 if (!isset(self::$_carriers[$id_carrier]))
  self::$_carriers[$id_carrier] = new Carrier((int)$id_carrier, Configuration::get('PS_LANG_DEFAULT'));
 $carrier = self::$_carriers[$id_carrier];
 if (!Validate::isLoadedObject($carrier))
  die(Tools::displayError('Fatal error: "no default carrier"'));
 if (!$carrier->active)
  return $shipping_cost;
 // Free fees if free carrier
 if ($carrier->is_free == 1)
  return 0;
 // Select carrier tax
 if ($use_tax && !Tax::excludeTaxeOption())
  $carrier_tax = $carrier->getTaxesRate(new Address((int)$address_id));
 $configuration = Configuration::getMultiple(array(
  'PS_SHIPPING_FREE_PRICE',
  'PS_SHIPPING_HANDLING',
  'PS_SHIPPING_METHOD',
  'PS_SHIPPING_FREE_WEIGHT'
 ));
 // Free fees
 $free_fees_price = 0;
 // Free fees
 if (isset($configuration['PS_SHIPPING_FREE_PRICE'])){
 $customer = Context::getContext()->customer;
 $id_group = (int)Configuration::get('PS_UNIDENTIFIED_GROUP');
 if (Validate::isLoadedObject($customer))
 $id_group = (int)$customer->id_default_group;
 if  (intval($id_group) == 3) // Le n° doit correspondre au groupe pour lequel les fdp sont gratuits
 {
 $free_fees_price = Tools::convertPrice((float)$configuration['PS_SHIPPING_FREE_PRICE'], Currency::getCurrencyInstance((int)$this->id_currency));
 $orderTotalwithDiscounts = $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING);
 if ($orderTotalwithDiscounts >= (float)($free_fees_price) && (float)($free_fees_price) > 0 AND intval($id_zone) == 1) // Le n° doit correspondre au pays pour lequel les fdp sont gratuits
  return $shipping_cost;
  }
}
 if (isset($configuration['PS_SHIPPING_FREE_WEIGHT'])
  && $this->getTotalWeight() >= (float)$configuration['PS_SHIPPING_FREE_WEIGHT']
  && (float)$configuration['PS_SHIPPING_FREE_WEIGHT'] > 0)
  return $shipping_cost;
 // Get shipping cost using correct method
 if ($carrier->range_behavior)
 {
  // Get id zone
  if (isset($this->id_address_delivery)
&& $this->id_address_delivery
&& Customer::customerHasAddress($this->id_customer, $this->id_address_delivery))
$id_zone = Address::getZoneById((int)$this->id_address_delivery);
  else
$id_zone = (int)$default_country->id_zone;
  $check_delivery_price_by_weight = Carrier::checkDeliveryPriceByWeight((int)$carrier->id, $this->getTotalWeight(), (int)$id_zone);
  // Code Review V&V TO FINISH
  $check_delivery_price_by_price = Carrier::checkDeliveryPriceByPrice(
$carrier->id,
$this->getOrderTotal(
 true,
 Cart::BOTH_WITHOUT_SHIPPING,
 $product_list
),
$id_zone,
(int)$this->id_currency
  );
  if ((
 $carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT
 && !$check_delivery_price_by_weight
) || (
 $carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE
 && !$check_delivery_price_by_price
  ))
$shipping_cost += 0;
  else
  {
if ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT)
 $shipping_cost += $carrier->getDeliveryPriceByWeight($this->getTotalWeight($product_list), $id_zone);
else // by price
 $shipping_cost += $carrier->getDeliveryPriceByPrice($order_total, $id_zone, (int)$this->id_currency);
  }
 }
 else
 {
  if ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT)
$shipping_cost += $carrier->getDeliveryPriceByWeight($this->getTotalWeight($product_list), $id_zone);
  else
$shipping_cost += $carrier->getDeliveryPriceByPrice($order_total, $id_zone, (int)$this->id_currency);
 }
 // Adding handling charges
 if (isset($configuration['PS_SHIPPING_HANDLING']) && $carrier->shipping_handling)
  $shipping_cost += (float)$configuration['PS_SHIPPING_HANDLING'];
 // Additional Shipping Cost per product
 foreach ($products as $product)
  if (!$product['is_virtual'])
$shipping_cost += $product['additional_shipping_cost'] * $product['cart_quantity'];
 $shipping_cost = Tools::convertPrice($shipping_cost, Currency::getCurrencyInstance((int)$this->id_currency));
 //get external shipping cost from module
 if ($carrier->shipping_external)
 {
  $module_name = $carrier->external_module_name;
  $module = Module::getInstanceByName($module_name);
  if (Validate::isLoadedObject($module))
  {
if (array_key_exists('id_carrier', $module))
 $module->id_carrier = $carrier->id;
if ($carrier->need_range)
 if (method_exists($module, 'getPackageShippingCost'))
  $shipping_cost = $module->getPackageShippingCost($this, $shipping_cost, $products);
 else
  $shipping_cost = $module->getOrderShippingCost($this, $shipping_cost);
else
 $shipping_cost = $module->getOrderShippingCostExternal($this);
// Check if carrier is available
if ($shipping_cost === false)
 return false;
  }
  else
return false;
 }
 // Apply tax
 if (isset($carrier_tax))
  $shipping_cost *= 1 + ($carrier_tax / 100);
 return (float)Tools::ps_round((float)$shipping_cost, 2);
}

public function getSummaryDetails($id_lang = null, $refresh = false)
{
 $context = Context::getContext();
 if (!$id_lang)
  $id_lang = $context->language->id;
 $customer = Context::getContext()->customer;
 $id_group = (int)Configuration::get('PS_UNIDENTIFIED_GROUP');
 if (Validate::isLoadedObject($customer))
 $id_group = (int)$customer->id_default_group;
 $delivery = new Address((int)$this->id_address_delivery);
 $invoice = new Address((int)$this->id_address_invoice);
 // New layout system with personalization fields
 $formatted_addresses['invoice'] = AddressFormat::getFormattedLayoutData($invoice);
 $formatted_addresses['delivery'] = AddressFormat::getFormattedLayoutData($delivery);
 $total_tax = $this->getOrderTotal() - $this->getOrderTotal(false);
 if ($total_tax < 0)
  $total_tax = 0;
 $total_free_ship = 0;
 if ($free_ship = Tools::convertPrice((float)(Configuration::get('PS_SHIPPING_FREE_PRICE')), new Currency((int)($this->id_currency))))
 {
  $discounts = $this->getCartRules();
  $total_free_ship =  $free_ship - ($this->getOrderTotal(true, Cart::ONLY_PRODUCTS) + $this->getOrderTotal(true, Cart::ONLY_DISCOUNTS));
  foreach ($discounts as $discount)
if ($discount['id_cart_rule_type'] == 3)
{
 $total_free_ship = 0;
 break;
}
 }

 $currency = new Currency($this->id_currency);
 $products = $this->getProducts($refresh);
 $gift_products = array();
 $cart_rules = $this->getCartRules();
 $total_shipping = $this->getTotalShippingCost();
 $total_shipping_tax_exc = $this->getTotalShippingCost(null, false);
 $total_products_wt = $this->getOrderTotal(true, Cart::ONLY_PRODUCTS);
 $total_products = $this->getOrderTotal(false, Cart::ONLY_PRODUCTS);
 $total_discounts = $this->getOrderTotal(true, Cart::ONLY_DISCOUNTS);
 $total_discounts_tax_exc = $this->getOrderTotal(false, Cart::ONLY_DISCOUNTS);

 // The cart content is altered for display
 foreach ($cart_rules as &$cart_rule)
 {
  // If the cart rule is automatic (wihtout any code) and include free shipping, it should not be displayed as a cart rule but only set the shipping cost to 0
  if ($cart_rule['free_shipping'] && empty($cart_rule['code']))
  {
$cart_rule['value_real'] -= $total_shipping;
$cart_rule['value_tax_exc'] = $total_shipping_tax_exc;
// Update total shipping
$total_shipping = 0;
$total_shipping_tax_exc = 0;
  }
  if ($cart_rule['gift_product'])
  {
foreach ($products as $key => &$product)
 if (empty($product['gift']) && $product['id_product'] == $cart_rule['gift_product'] && $product['id_product_attribute'] == $cart_rule['gift_product_attribute'])
 {
  // Update total products
  $total_products_wt = Tools::ps_round($total_products_wt - $product['price_wt'], (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
  $total_products = Tools::ps_round($total_products - $product['price'], (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);

  // Update total discounts
  $total_discounts = Tools::ps_round($total_discounts - $product['price_wt'], (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
  $total_discounts_tax_exc = Tools::ps_round($total_discounts_tax_exc - $product['price'], (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);

  // Update cart rule value
  $cart_rule['value_real'] = Tools::ps_round($cart_rule['value_real'] - $product['price_wt'], (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
  $cart_rule['value_tax_exc'] = Tools::ps_round($cart_rule['value_tax_exc'] - $product['price'], (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);

  // Update product quantity
  $product['total_wt'] = Tools::ps_round($product['total_wt'] - $product['price_wt'], (int)$currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
  $product['total'] = Tools::ps_round($product['total'] - $product['price'], (int)$currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
  $product['cart_quantity']--;

  if (!$product['cart_quantity'])
   unset($products[$key]);

  // Add a new product line
  $gift_product = $product;
  $gift_product['cart_quantity'] = 1;
  $gift_product['price'] = 0;
  $gift_product['price_wt'] = 0;
  $gift_product['total_wt'] = 0;
  $gift_product['total'] = 0;
  $gift_product['gift'] = true;
  $gift_products[] = $gift_product;

  break; // One gift product per cart rule
 }
  }
 }
 foreach ($cart_rules as $key => &$cart_rule)
  if ($cart_rule['value_real'] == 0)
unset($cart_rules[$key]);

 return array(
  'delivery' => $delivery,
  'delivery_state' => State::getNameById($delivery->id_state),
  'invoice' => $invoice,
  'invoice_state' => State::getNameById($invoice->id_state),
  'formattedAddresses' => $formatted_addresses,
  'products' => array_values($products),
  'gift_products' => $gift_products,
  //'products_raw' => $this->getProducts(false),
  'discounts' => $cart_rules,
  'is_virtual_cart' => (int)$this->isVirtualCart(),
  'total_discounts' => $total_discounts,
  'total_discounts_tax_exc' => $total_discounts_tax_exc,
  'total_wrapping' => $this->getOrderTotal(true, Cart::ONLY_WRAPPING),
  'total_wrapping_tax_exc' => $this->getOrderTotal(false, Cart::ONLY_WRAPPING),
  'total_shipping' => $total_shipping,
  'total_shipping_tax_exc' => $total_shipping_tax_exc,
  'total_products_wt' => $total_products_wt,
  'total_products' => $total_products,
  'total_price' => $this->getOrderTotal(),
  'total_tax' => $total_tax,
  'total_price_without_tax' => $this->getOrderTotal(false),
  'is_multi_address_delivery' => $this->isMultiAddressDelivery() || ((int)Tools::getValue('multi-shipping') == 1),
  'free_ship' => $total_shipping ? 0 : 1,
  'IDzone' => Address::getZoneById(intval($this->id_address_delivery)),// Ajout d'une variable group pour product.tpl
  'IDgroup' => $id_group, // Ajout d'une variable group pour product.tpl
  'free_shipping' => $total_free_ship, // Ajout d'une variable free shipping pour product.tpl
  'carrier' => new Carrier($this->id_carrier, $id_lang),
 );
}
}

 

Sauvgarder le ficher par ftp dans monsite.com/override/classes

Ouvrez le fichier monsite.com/themes/montheme/shopping-cart.tpl

Rechercher les lignes suivantes:

  <tr class="cart_total_tax">
<td colspan="5">{l s='Total tax:'}</td>
<td colspan="2" class="price" id="total_tax">{displayPrice price=$total_tax}</td>
  </tr>

Ajouter à la suite:

  {if $free_shipping > 0 AND $IDzone eq 1 AND $IDgroup eq 3 || $isVirtualCart}
  <tr id="free_shipping" class="cart_free_shipping">
 <td class="cart_free_shipping_txt" colspan="7" style="white-space: normal; color: green;"><span class="txt_shipping">{l s='Remaining amount to be added to your cart in order to obtain free shipping:'}</span>
 <span class="price_shipping" style="color: red;" class="price">{displayPrice price=$free_shipping}</span></td>
  </tr>
  {elseif $free_shipping <= 0 AND $IDzone eq 1 AND $IDgroup eq 3 || $isVirtualCart}
  <tr id="free_shipping" class="cart_free_shipping">
 <td class="cart_free_shipping_txt" colspan="7" style="white-space: normal; color: green;"><span class="txt_shipping">{l s='Free Shipping !!'}</span> <span class="price_shipping" style="color: red;" class="price"> </span></td>
  </tr>
  {/if}

Les N° de zone et les n° de groupe dans Cart.php et shopping-cart.tpl doivent correspondre à vos propre n°

Traduisez les phrases dans le BO

Voila, j'espère que cela vous seras utile.

@+

pdriss

Edited by pdriss (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Bonsoir,

 

pourquoi ne pas créer un transporteur gratuit valable uniquement dans le pays de la boutique et les autres seront valables que pour les autres pays ?

si les fdp doivent être gratuit à partir d'un certain montant il faut créer des tranches de prix qui vont bien.

 

ça revient au même je crois

Link to comment
Share on other sites

Salut,

Pas vraiment, parce que dans ce cas tu "perd" le rappel de la phrase dans le panier "Pour obtenir la gratuité des frais de port, vous devez encore commander pour XXX €", sans compter que ca ne fonctionne pas pour les groupes, par ex gratuit à partir d'un certain montant uniquement pour les particuliers, pas pour les pro.

Link to comment
Share on other sites

Certe, le message est perdu mais personnellement je préfère ajouter un petit module pour cela qui sera simple et configurable facilement plutôt qu'une grosse surcharge + modification de thème qu'il faudra adapter pour toutes les versions de Prestashop.

 

Les transporteurs sont activable par groupe, je pense qu'on peut sans sortir comme ça mais j'ai pas testé.

Le prend pas mal, c'est une bonne astuce, je propose juste une solution alternative qui a aussi des avantages et des défauts.

Link to comment
Share on other sites

t'inquiete je le prend pas mal, pour le module je suis d'accord mais on le trouve ou ?

pour les modifications de thème, je le fait qu'une fois puisque je ne vend pas de boutique, c'est pour la mienne.

les transporteur sont activable par groupe, mais dans ce cas il faut en créer un pour les particulier et un pour les pro pour chaque tarif postal concernée et tous les modifier a chaque changement de tarif, pas sur que ce soit mieux....

Link to comment
Share on other sites

  • 4 months later...

Cette solution fonctionne sous PS 1.5.2 mais pas complètement : en cas de mise à jour du récap (suppression d'un article de la liste par exemple), le montant free_shipping n'est pas rafraîchi :-(

 

QQ'un aurait une idée de comment le mettre à jour, ou au pire de comment désactiver le mode ajax sur cette page ?

 

Merci, a+

 

EDIT : Solution qui semble fonctionner : forcer systématiquement le location.reload() dans les méthodes upQuantity(), downQuantity() et deleteProductFromSummary() de cart-summary.js... Pas très propre, mais opérationnel !

Edited by lpivtt (see edit history)
Link to comment
Share on other sites

  • 4 months later...

chez moi ça ne fonctionne pas , j'ai mit 60 euros dans transport/free shipping dans le BO (qui est d'ailleurs moitié français moitié anglais...) puis j'ai bien mit les fichiers cart.php dans /override/classes et shopping-cart.tpl dans /themes/montheme/shopping-cart.tpl

 

j'ai modifié ça comme ça :

 

if  (intval($id_group) == 3) // Le n° doit correspondre au groupe pour lequel les fdp sont gratuits
...
if ($orderTotalwithDiscounts >= (float)($free_fees_price) && (float)($free_fees_price) > 0 AND intval($id_zone) == 1) // Le n° doit correspondre au pays pour lequel les fdp sont gratuits


 

par :

 

if  (intval($id_group) == 1) // Le n° doit correspondre au groupe pour lequel les fdp sont gratuits
...
if ($orderTotalwithDiscounts >= (float)($free_fees_price) && (float)($free_fees_price) > 0 AND intval($id_zone) == 13) // Le n° doit correspondre au pays pour lequel les fdp sont gratuits

13 étant l'id zone de la france à priori dans ps_country..

mais en créant un compte belge j'ai quand même les fdp offert à partir de 60 euros...

 

prestashop : 1.5.4.1

Edited by Dagostino (see edit history)
Link to comment
Share on other sites

Salut,

Sur prestashop 1.5.4.1 les fichiers ont été profondement modifiés et la variable free_shipping à été désactivé.

La gestion des frais de port ce fait désormais via l'onglet "Promotions"=>"Règle de panier"=>"Créer".

A vous de créer les conditions (client, transporteur, groupe, produits, duré etc..) et les regles correspondantes port gratuit, reduction, cadeau).

Vala,

@+

pdriss

Link to comment
Share on other sites

merci pour votre réponse

à priori (je dis bien à priori) ceci à fonctionné :

 

sur le fichier cart.php dans /classes , j'ai modifié cette ligne (2654) :

 

if ($orderTotalwithDiscounts >= (float)($free_fees_price) && (float)($free_fees_price) > 0 )

 

par

 

if ($orderTotalwithDiscounts >= (float)($free_fees_price) && (float)($free_fees_price) > 0 and $id_zone==13)

 

et au delà de 60 € j'ai bien les ports pour la belgique mais gratuit pour la france.

Je vérifierai si ça marche pour les autres pays aussi

Edited by Dagostino (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 3 months later...

Bonjour,

Merci Pdriss pour la contribution.

 

Si l'on veut offrir les frais de port à 2 pays, en proposant un transporteur défini comment doit on l'indiquer?

J'ai aucun problème pour un pays mais pour 2 cela ne fonctionne pas.

 

Merci de votre aide.

Fred

 

Vers. Prestashop 1.5.4.1

Link to comment
Share on other sites

Salut,

Comme je l'ai dis au dessus, sur prestashop 1.5.4.1 la gestion des frais de port ce fait désormais via l'onglet "Promotions"=>"Règle de panier"=>"Créer".
A vous de créer les conditions (client, transporteur, groupe, produits, duré etc..) et les règles correspondantes port gratuit, réduction, cadeau).
Vala,
@+
pdriss          

Link to comment
Share on other sites

Bonjour,

Effectivement cela fonctionne, mais le système n'est pas logique, puisque tout le long du processus de commande le prix des frais de livraison est indiqué.
Il n'y a qu'au moment du choix de paiement que le client  constate que la livraison est offerte.

Il y à 99.9% de chance que le client arrête son processus de commande aux choix du transporteur.

 

Fred

Link to comment
Share on other sites

  • 5 months later...

Bonjour

 

Cela fonctionne sur 1.5.6 je viens de tester.

 

Merci !

 

merci pour votre réponse
à priori (je dis bien à priori) ceci à fonctionné :

sur le fichier cart.php dans /classes , j'ai modifié cette ligne (2654) :
 

if ($orderTotalwithDiscounts >= (float)($free_fees_price) && (float)($free_fees_price) > 0 )
par

if ($orderTotalwithDiscounts >= (float)($free_fees_price) && (float)($free_fees_price) > 0 and $id_zone==13)
et au delà de 60 € j'ai bien les ports pour la belgique mais gratuit pour la france.
Je vérifierai si ça marche pour les autres pays aussi

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...