osCommerce France : Accueil Forum Portail osCommerce France Réponses aux questions Foire aux contributions

Bienvenue invité ( Connexion | Inscription )

 
Reply to this topicStart new topic
> [resolu]Quel module de frais de port adapté a mon cas ?
Budington
posté 17 Mar 2012, 21:22
Message #1


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 30
Inscrit : 4-February 12
Membre no 30570



Bonjour/Bonsoir

Je vous explique grosso merdo... je suis en train de mettre en place une boutique pour mon Association, nous somme basé en Suisse et forcément on risque de devoir faire des expéditions...

au niveaux de la tarification pour le local c'est relativement simple



pour l'international sa ce gatte plutôt



Donc je dois pouvoir gérer et la zone géographique et le poids, petit bonus, certain produit sont présenter sous la forme de deux colis de poids différant...

La question qui tue...... Quel contrib. compatible 2.3 serais a même a répondre a sa ? ohmy.gif


D'avance je vous remercie smile.gif

Ce message a été modifié par Budington - 30 Apr 2012, 02:22.
Go to the top of the page
 
chti_poupon
posté 18 Mar 2012, 13:37
Message #2


Ceinture noire OSC
Icône de groupe

Groupe : TechDev
Messages : 2161
Inscrit : 9-September 08
Lieu : Douai
Membre no 22915



Bonjour
Il y a cette contrib ancienne qui n'est peut-être même pas pertinente ici
Et en plus elle est en 2.1 !
Sinon, vois les modules colissimo, mais il va falloir revoir une partie du code.
Sinon, zones pourrait s'adapter (liste poids prix par zone).
Mais il faut doubler le module (l'appeler zones1) pour l'envoi économique.
Sur le multi colis c'est là mais en 2.2
Chti poupon
Go to the top of the page
 
Budington
posté 18 Mar 2012, 13:46
Message #3


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 30
Inscrit : 4-February 12
Membre no 30570



ok, je vais déjà essayer avec zonea l'aide de ce tuto,mais ya des chances que je revienne te voir blink.gif

Ce message a été modifié par Budington - 18 Mar 2012, 13:47.
Go to the top of the page
 
krokus
posté 18 Mar 2012, 14:00
Message #4


Ceinture orange OSC
Icône de groupe

Groupe : Membres
Messages : 289
Inscrit : 23-February 07
Membre no 15518



Bonjour, a moins que je n'ai rien compris l'addon colissimo fait ça


--------------------
Ms2.3+Category Description+Ckeditor+Colissimo+EasyPopulate+Header tags seo+Otf autothumb+PIM osSlideshow+Theme switcher+Ultimate Seo Urls+Icone stock+crawlprotect+Who's Online Enhancement+Master password
Go to the top of the page
 
Budington
posté 18 Mar 2012, 14:01
Message #5


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 30
Inscrit : 4-February 12
Membre no 30570



je savais bien que je reviendrais biggrin.gif

donc j'ai du zappé un truc (vue que je suis pas super a l'aise avec le code)

j'ai modifié pour adapté a mon cas

Code
for ($i = 1; $i <= $this->num_zones; $i++) {  
                  $default_countries = '';
                  if ($i == 1) { // France
                     $default_countries = 'FR';
                    $shipping_table = '0.500:7.20,1:8.40,2:8.90,3:9.60,5:10.70,7:11.70,10:13.60,15:14.90,30:19.50';  
                  }  
                  if ($i == 2) { // DOM
                     $default_countries = 'GP,GF,MQ,YT,RE,PM';
                    $shipping_table = '0.500:9.70,1:13.70,2:17.50,3:21.90,4:26.30,5:30.70,6:35.10,7:39.50,8:43.90,9:46.30,10:52.70';  
                  }  
                  if ($i == 3) { // TOM
                     $default_countries = 'NC,PF,TF,FX,WF';
                    $shipping_table = '0.500:10.30,1:15.20,2:24.20,3:36.10,5:54.40,7:77.50,10:105.20';  
                  }


par


Code
if ($i == 1) { // Suisse
                   $default_countries = 'CH';
                   $shipping_table = '0.500:7.20,1:8.40,2:8.90,3:9.60,5:10.70,7:11.70,10:13.60,15:14.90,30:19.50';
                 }
                 if ($i == 2) { // Zone 1
                   $default_countries = 'GP,GF,MQ,YT,RE,PM';
                   $shipping_table = '0.500:9.70,1:13.70,2:17.50,3:21.90,4:26.30,5:30.70,6:35.10,7:39.50,8:43.90,9:46.30,10:52.70';
                 }
                 if ($i == 3) { // Zone 2
                   $default_countries = 'NC,PF,TF,FX,WF';
                   $shipping_table = '0.500:10.30,1:15.20,2:24.20,3:36.10,5:54.40,7:77.50,10:105.20';
                 }
                 if ($i == 4) { // Zone 3
                   $default_countries = 'NC,PF,TF,FX,WF';
                   $shipping_table = '0.500:10.30,1:15.20,2:24.20,3:36.10,5:54.40,7:77.50,10:105.20';
                 }
                 if ($i == 5) { // Zone 4
                   $default_countries = 'NC,PF,TF,FX,WF';
                   $shipping_table = '0.500:10.30,1:15.20,2:24.20,3:36.10,5:54.40,7:77.50,10:105.20';
                 }
                 if ($i == 6) { // Zone 5
                   $default_countries = 'NC,PF,TF,FX,WF';
                   $shipping_table = '0.500:10.30,1:15.20,2:24.20,3:36.10,5:54.40,7:77.50,10:105.20';
                 }


les valeurs ne sont pas encore rentré j'ai donc mes 5 zones pour l'international et l'envoie en local... je vais simplicité en limitant pour l'instant un seul tarif, prioritaire pour la suisse et économique signature pour l'étranger...

question: ??

l'affichage dans la console d'admin est censé évoluer ? ou je modifie juste mes valeur dans zones et c'est bon ?

[EDIT]
j'ai effectivement du faire une connerie j'ai ce msg qui apparait
Code


[b]Warning[/b]:  constant() [[url="catalog/function.constant"]function.constant[/url]]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_2 in [b]/catalog/includes/modules/shipping/zones.php[/b] on line [b]123[/b]
        
  [b]Warning[/b]:  constant() [[url="catalog/function.constant"]function.constant[/url]]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_3 in [b]/catalog/includes/modules/shipping/zones.php[/b] on line [b]123[/b]
        
  [b]Warning[/b]:  constant() [[url="catalog/function.constant"]function.constant[/url]]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_4 in [b]/catalog/includes/modules/shipping/zones.php[/b] on line [b]123[/b]
        
  [b]Warning[/b]:  constant() [[url="catalog/function.constant"]function.constant[/url]]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_5 in [b]/catalog/includes/modules/shipping/zones.php[/b] on line [b]123[/b]
  
   [b]Warning[/b]:  constant()  [[url="catalog/function.constant"]function.constant[/url]]: Couldn't  find constant MODULE_SHIPPING_ZONES_COUNTRIES_6 in  [b]/catalog/includes/modules/shipping/zones.php[/b] on line [b]123[/b]


et sa c'est mon fichier zone.php

Code
<?php
  <?php
/*

  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License

  USAGE
  By default, the module comes with support for 1 zone.  This can be
  easily changed by editing the line below in the zones constructor
  that defines $this->num_zones.

  Next, you will want to activate the module by going to the Admin screen,
  clicking on Modules, then clicking on Shipping.  A list of all shipping
  modules should appear.  Click on the green dot next to the one labeled
  zones.php.  A list of settings will appear to the right.  Click on the
  Edit button.

  PLEASE NOTE THAT YOU WILL LOSE YOUR CURRENT SHIPPING RATES AND OTHER
  SETTINGS IF YOU TURN OFF THIS SHIPPING METHOD.  Make sure you keep a
  backup of your shipping settings somewhere at all times.

  If you want an additional handling charge applied to orders that use this
  method, set the Handling Fee field.

  Next, you will need to define which countries are in each zone.  Determining
  this might take some time and effort.  You should group a set of countries
  that has similar shipping charges for the same weight.  For instance, when
  shipping from the US, the countries of Japan, Australia, New Zealand, and
  Singapore have similar shipping rates.  As an example, one of my customers
  is using this set of zones:
    1: USA
    2: Canada
    3: Austria, Belgium, Great Britain, France, Germany, Greenland, Iceland,
       Ireland, Italy, Norway, Holland/Netherlands, Denmark, Poland, Spain,
       Sweden, Switzerland, Finland, Portugal, Israel, Greece
    4: Japan, Australia, New Zealand, Singapore
    5: Taiwan, China, Hong Kong

  When you enter these country lists, enter them into the Zone X Countries
  fields, where "X" is the number of the zone.  They should be entered as
  two character ISO country codes in all capital letters.  They should be
  separated by commas with no spaces or other punctuation. For example:
    1: US
    2: CA
    3: AT,BE,GB,FR,DE,GL,IS,IE,IT,NO,NL,DK,PL,ES,SE,CH,FI,PT,IL,GR
    4: JP,AU,NZ,SG
    5: TW,CN,HK

  Now you need to set up the shipping rate tables for each zone.  Again,
  some time and effort will go into setting the appropriate rates.  You
  will define a set of weight ranges and the shipping price for each
  range.  For instance, you might want an order than weighs more than 0
  and less than or equal to 3 to cost 5.50 to ship to a certain zone.  
  This would be defined by this:  3:5.5

  You should combine a bunch of these rates together in a comma delimited
  list and enter them into the "Zone X Shipping Table" fields where "X"
  is the zone number.  For example, this might be used for Zone 1:
    1:3.5,2:3.95,3:5.2,4:6.45,5:7.7,6:10.4,7:11.85, 8:13.3,9:14.75,10:16.2,11:17.65,
    12:19.1,13:20.55,14:22,15:23.45

  The above example includes weights over 0 and up to 15.  Note that
  units are not specified in this explanation since they should be
  specific to your locale.

  CAVEATS
  At this time, it does not deal with weights that are above the highest amount
  defined.  This will probably be the next area to be improved with the
  module.  For now, you could have one last very high range with a very
  high shipping rate to discourage orders of that magnitude.  For
  instance:  999:1000

  If you want to be able to ship to any country in the world, you will
  need to enter every country code into the Country fields. For most
  shops, you will not want to enter every country.  This is often
  because of too much fraud from certain places. If a country is not
  listed, then the module will add a $0.00 shipping charge and will
  indicate that shipping is not available to that destination.  
  PLEASE NOTE THAT THE ORDER CAN STILL BE COMPLETED AND PROCESSED!

  It appears that the osC shipping system automatically rounds the
  shipping weight up to the nearest whole unit.  This makes it more
  difficult to design precise shipping tables.  If you want to, you
  can hack the shipping.php file to get rid of the rounding.

  Lastly, there is a limit of 255 characters on each of the Zone
  Shipping Tables and Zone Countries.

*/

  class zones {
    var $code, $title, $description, $enabled, $num_zones;

// class constructor
    function zones() {
      $this->code = 'zones';
      $this->title = MODULE_SHIPPING_ZONES_TEXT_TITLE;
      $this->description = MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION;
      $this->sort_order = MODULE_SHIPPING_ZONES_SORT_ORDER;
      $this->icon = '';
      $this->tax_class = MODULE_SHIPPING_ZONES_TAX_CLASS;
      $this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);

      // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
      $this->num_zones = 6;
    }

// class methods
    function quote($method = '') {
      global $order, $shipping_weight, $shipping_num_boxes;

      $dest_country = $order->delivery['country']['iso_code_2'];
      $dest_zone = 0;
      $error = false;

      for ($i=1; $i<=$this->num_zones; $i++) {
        $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i);
        $country_zones = preg_split("/[,]/", $countries_table);
        if (in_array($dest_country, $country_zones)) {
          $dest_zone = $i;
          break;
        }
      }

      if ($dest_zone == 0) {
        $error = true;
      } else {
        $shipping = -1;
        $zones_cost = constant('MODULE_SHIPPING_ZONES_COST_' . $dest_zone);

        $zones_table = preg_split("/[:,]/" , $zones_cost);
        $size = sizeof($zones_table);
        for ($i=0; $i<$size; $i+=2) {
          if ($shipping_weight <= $zones_table[$i]) {
            $shipping = $zones_table[$i+1];
            $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_ZONES_TEXT_UNITS;
            break;
          }
        }

        if ($shipping == -1) {
          $shipping_cost = 0;
          $shipping_method = MODULE_SHIPPING_ZONES_UNDEFINED_RATE;
        } else {
          $shipping_cost = ($shipping * $shipping_num_boxes) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
        }
      }

      $this->quotes = array('id' => $this->code,
                            'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,
                            'methods' => array(array('id' => $this->code,
                                                     'title' => $shipping_method,
                                                     'cost' => $shipping_cost)));

      if ($this->tax_class > 0) {
        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
      }

      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);

      if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_ZONES_INVALID_ZONE;

      return $this->quotes;
    }

    function check() {
      if (!isset($this->_check)) {
        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_STATUS'");
        $this->_check = tep_db_num_rows($check_query);
      }
      return $this->_check;
    }

    function install() {
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Zones Method', 'MODULE_SHIPPING_ZONES_STATUS', 'True', 'Do you want to offer zone rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ZONES_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ZONES_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
      for ($i = 1; $i <= $this->num_zones; $i++) {
        $default_countries = '';
        if ($i == 1) { // Suisse
          $default_countries = 'CH';
          $shipping_table = '2:11.00,5:13.00,10:15.00,20:21.00,30:28.00';
        }
        if ($i == 2) { // Zone 1
          $default_countries = 'DE,AT,BE,FR,IT,LU,NL';
          $shipping_table = '2:41.00,5:51.00,10:59.00,15:70.00,20:75.00,25:81.00,30:86.00';
        }
        if ($i == 3) { // Zone 2
          $default_countries = 'BG,HR,DK,ES,RU,FI,GR,GB,HU,IE,NO,PT,CZ,SE,SI,TR';
          $shipping_table = '2:48.00,5:61.00,10:75.00,15:99.00,20:105.00,25:123.00,30:133.00';
        }
        if ($i == 4) { // Zone 3
          $default_countries = 'CA,US,IL,TN';
          $shipping_table = '2:52.00,5:73.00,15:103.00,15:128.00,20:164.00,25:185.00,30:205.00';
        }
        if ($i == 5) { // Zone 4
          $default_countries = 'KR,HK,IN,JP,CN,SG,TW,TH';
          $shipping_table = '2:59.00,5:91.00,10:133.00,15:185.00,20:234.00,25:271.00,30:299.00';
        }
        if ($i == 6) { // Zone 5
          $default_countries = 'AR,AU,BR,NZ';
          $shipping_table = '2:71.00,5:109.00,10:164.00,15:226.00,20:302.00,25:364.00,30:415.00';
        }
        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_ZONES_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".', '6', '0', now())");
        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_ZONES_COST_" . $i ."', '3:8.50,7:10.50,99:20.00', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', now())");
        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Table Zone " . $i ." (poids:tarifs)', 'MODULE_SHIPPING_ZONES_COST_" . $i ."', '" . $shipping_table . "', 'Exemple: 3:8.50,7:10.50,... Un poids inférieur ou égal à 3kg coutera 8.50€, 10,50€ de 3kg à 7kg...', '6', '0', now())");
      }
    }

    function remove() {
      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }

    function keys() {
      $keys = array('MODULE_SHIPPING_ZONES_STATUS', 'MODULE_SHIPPING_ZONES_TAX_CLASS', 'MODULE_SHIPPING_ZONES_SORT_ORDER');

      for ($i=1; $i<=$this->num_zones; $i++) {
        $keys[] = 'MODULE_SHIPPING_ZONES_COUNTRIES_' . $i;
        $keys[] = 'MODULE_SHIPPING_ZONES_COST_' . $i;
        $keys[] = 'MODULE_SHIPPING_ZONES_HANDLING_' . $i;
      }

      return $keys;
    }
  }
?>


Ce message a été modifié par Budington - 18 Mar 2012, 21:49.
Go to the top of the page
 
krokus
posté 18 Mar 2012, 16:53
Message #6


Ceinture orange OSC
Icône de groupe

Groupe : Membres
Messages : 289
Inscrit : 23-February 07
Membre no 15518



ou comment reinventer la roue


--------------------
Ms2.3+Category Description+Ckeditor+Colissimo+EasyPopulate+Header tags seo+Otf autothumb+PIM osSlideshow+Theme switcher+Ultimate Seo Urls+Icone stock+crawlprotect+Who's Online Enhancement+Master password
Go to the top of the page
 
Budington
posté 18 Mar 2012, 17:23
Message #7


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 30
Inscrit : 4-February 12
Membre no 30570



Citation (krokus @ 18 Mar 2012, 16:53) *
ou comment reinventer la roue


Oui et ? c'est quoi la diff, entre prendre le module collisimo et modifié toute les valeurs ? et directement customisé ce qui existe ? j'ai déjà installer le module colisimmo ey vue la quantité de valeur qui est dans le fichier, je vois pas ou est le soucis

Ce message a été modifié par Budington - 18 Mar 2012, 17:24.
Go to the top of the page
 
krokus
posté 18 Mar 2012, 19:27
Message #8


Ceinture orange OSC
Icône de groupe

Groupe : Membres
Messages : 289
Inscrit : 23-February 07
Membre no 15518



Si je reprend ce que tu voulais faire, 2 tarifs pour le national et 1 pour l'international le module colissimo le fais, maintenant le module que tu as installe est ce qu'il fait ce que tu voulais ? non.
l'installation et le parametrage du module colissimo prend environ 15mn, combien de temps as tu passé ?, alors oui j'appele ça reinventer la roue, maintenant chacun fait comme il veut.


--------------------
Ms2.3+Category Description+Ckeditor+Colissimo+EasyPopulate+Header tags seo+Otf autothumb+PIM osSlideshow+Theme switcher+Ultimate Seo Urls+Icone stock+crawlprotect+Who's Online Enhancement+Master password
Go to the top of the page
 
Budington
posté 18 Mar 2012, 20:32
Message #9


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 30
Inscrit : 4-February 12
Membre no 30570



... pour simplifié j'ai 2 tarif 1 local et 1 international 6 zone avec 5 tarif sois 40 tarifs pour 100% des cas couvert....
dans collisimo y'a dans les 200 tarifs et je doit tout les modifié, ensuite plusieurs fonctions ne me servent pas, comme les recommander et l'assurance...

quel est le plus simple prendre une usine a gaz pour tout modifié ou un truc simple et l'adapté a mes besoins ?

Le module... est installé d'origine dans osc et il fait exactement ce que je veux... si ce n'est que j'ai encore une ou deux erreur dans le code du a mon inexpérience...

[EDIT] je met de l'eau dans mon vin, j'ai répondu de manière cavalière mes excuse a krokus

Ce message a été modifié par Budington - 19 Mar 2012, 01:22.
Go to the top of the page
 
Budington
posté 18 Mar 2012, 21:36
Message #10


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 30
Inscrit : 4-February 12
Membre no 30570



Problème résolue pour "MODULE_SHIPPING_ZONES_COUNTRIE"

j'ai toute mes zones, avec les tarifs correspondant, le tarif correspond au poids et au pays...

mais j'ai une nouvelle erreur qui apparais

Code
Warning: constant() [function.constant]: Couldn't find constant MODULE_SHIPPING_ZONES_HANDLING_3 in /catalog/includes/modules/shipping/zones.php on line 151


[edit] l'erreur apparait selon la zone correspondant a la zone tarifaire de l'adresse d'expédition, le fichier zone.php dans sa dernière version est édité plus haut dans le topic

Ce message a été modifié par Budington - 19 Mar 2012, 01:23.
Go to the top of the page
 
chti_poupon
posté 19 Mar 2012, 10:13
Message #11


Ceinture noire OSC
Icône de groupe

Groupe : TechDev
Messages : 2161
Inscrit : 9-September 08
Lieu : Douai
Membre no 22915



Normalement, les constantes sont définies:
Soit dans le module de l'admin, par réglage d'un paramètre (la zone d'envoi pourrait en être un)
Soit dans le fichier langage correspondant catalog/includes/languages/french/modules/shipping/zones.php

Chti poupon
Go to the top of the page
 
Budington
posté 19 Mar 2012, 12:05
Message #12


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 30
Inscrit : 4-February 12
Membre no 30570



sa marche je creuse de ce coté merci
Go to the top of the page
 
Budington
posté 19 Mar 2012, 13:05
Message #13


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 30
Inscrit : 4-February 12
Membre no 30570



j'ai sa dans /catalog/includes/languages/french/modules/shipping/zone.php
Code
<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2002 osCommerce

  Released under the GNU General Public License
*/

define('MODULE_SHIPPING_ZONES_TEXT_TITLE', 'Tableau de coût de livraison par zone et régions');
define('MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION', 'Coût d envoie par zone et région');
define('MODULE_SHIPPING_ZONES_TEXT_WAY', 'Livraison vers');
define('MODULE_SHIPPING_ZONES_TEXT_UNITS', 'Kg');
define('MODULE_SHIPPING_ZONES_INVALID_ZONE', 'Pas de livraison possible vers le pays sélectionné');
define('MODULE_SHIPPING_ZONES_UNDEFINED_RATE', 'Le cout de livraison ne peut etre déterminé pour le moment');
?>
Go to the top of the page
 
Budington
posté 19 Mar 2012, 16:12
Message #14


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 30
Inscrit : 4-February 12
Membre no 30570



question ?
est ce que sa ne pourrais pas venir du fichier table.php ?

Code
<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2008 osCommerce

  Released under the GNU General Public License
*/

  class table {
    var $code, $title, $description, $icon, $enabled;

// class constructor
    function table() {
      global $order;

      $this->code = 'table';
      $this->title = MODULE_SHIPPING_TABLE_TEXT_TITLE;
      $this->description = MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION;
      $this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER;
      $this->icon = '';
      $this->tax_class = MODULE_SHIPPING_TABLE_TAX_CLASS;
      $this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);

      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_TABLE_ZONE > 0) ) {
        $check_flag = false;
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_TABLE_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
        while ($check = tep_db_fetch_array($check_query)) {
          if ($check['zone_id'] < 1) {
            $check_flag = true;
            break;
          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
            $check_flag = true;
            break;
          }
        }

        if ($check_flag == false) {
          $this->enabled = false;
        }
      }
    }

// class methods
    function quote($method = '') {
      global $order, $shipping_weight, $shipping_num_boxes;

      if (MODULE_SHIPPING_TABLE_MODE == 'price') {
        $order_total = $this->getShippableTotal();
      } else {
        $order_total = $shipping_weight;
      }

      $table_cost = preg_split("/[:,]/" , MODULE_SHIPPING_TABLE_COST);
      $size = sizeof($table_cost);
      for ($i=0, $n=$size; $i<$n; $i+=2) {
        if ($order_total <= $table_cost[$i]) {
          $shipping = $table_cost[$i+1];
          break;
        }
      }

      if (MODULE_SHIPPING_TABLE_MODE == 'weight') {
        $shipping = $shipping * $shipping_num_boxes;
      }

      $this->quotes = array('id' => $this->code,
                            'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE,
                            'methods' => array(array('id' => $this->code,
                                                     'title' => MODULE_SHIPPING_TABLE_TEXT_WAY,
                                                     'cost' => $shipping + MODULE_SHIPPING_TABLE_HANDLING)));

      if ($this->tax_class > 0) {
        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
      }

      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);

      return $this->quotes;
    }

    function check() {
      if (!isset($this->_check)) {
        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_TABLE_STATUS'");
        $this->_check = tep_db_num_rows($check_query);
      }
      return $this->_check;
    }

    function install() {
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Table Method', 'MODULE_SHIPPING_TABLE_STATUS', 'True', 'Do you want to offer table rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Table', 'MODULE_SHIPPING_TABLE_COST', '25:8.50,50:5.50,10000:0.00', 'The shipping cost is based on the total cost or weight of items. Example: 25:8.50,50:5.50,etc.. Up to 25 charge 8.50, from there to 50 charge 5.50, etc', '6', '0', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Table Method', 'MODULE_SHIPPING_TABLE_MODE', 'weight', 'The shipping cost is based on the order total or the total weight of the items ordered.', '6', '0', 'tep_cfg_select_option(array(\'weight\', \'price\'), ', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_TABLE_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_TABLE_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_TABLE_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_TABLE_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
    }

    function remove() {
      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }

    function keys() {
      return array('MODULE_SHIPPING_TABLE_STATUS', 'MODULE_SHIPPING_TABLE_COST', 'MODULE_SHIPPING_TABLE_MODE', 'MODULE_SHIPPING_TABLE_HANDLING', 'MODULE_SHIPPING_TABLE_TAX_CLASS', 'MODULE_SHIPPING_TABLE_ZONE', 'MODULE_SHIPPING_TABLE_SORT_ORDER');
    }

    function getShippableTotal() {
      global $order, $cart, $currencies;

      $order_total = $cart->show_total();

      if ($order->content_type == 'mixed') {
        $order_total = 0;

        for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
          $order_total += $currencies->calculate_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']);

          if (isset($order->products[$i]['attributes'])) {
            reset($order->products[$i]['attributes']);
            while (list($option, $value) = each($order->products[$i]['attributes'])) {
              $virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$order->products[$i]['id'] . "' and pa.options_values_id = '" . (int)$value['value_id'] . "' and pa.products_attributes_id = pad.products_attributes_id");
              $virtual_check = tep_db_fetch_array($virtual_check_query);

              if ($virtual_check['total'] > 0) {
                $order_total -= $currencies->calculate_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']);
              }
            }
          }
        }
      }

      return $order_total;
    }
  }
?>
Go to the top of the page
 
chti_poupon
posté 19 Mar 2012, 16:31
Message #15


Ceinture noire OSC
Icône de groupe

Groupe : TechDev
Messages : 2161
Inscrit : 9-September 08
Lieu : Douai
Membre no 22915



Bon, soyons clairs:
N'as tu pas implanté un module d'expédition (zonea) pour répondre à ton besoin?
C'est de ce module que tu as implanté que vient ton soucis, puisque tu n'en avait pas auparavent.
Attention ! va voir dans catalog/includes/languages/english/modules/shipping/zonea.php: là est ce que tu cherches, qu'il te faut traduire en français et sauvegarder sous catalog/includes/languages/french/modules/shipping/zonea.php
Bonne traduction (GG, çà peut aider mais pas trop) !
Chti poupon
Go to the top of the page
 
Budington
posté 19 Mar 2012, 17:08
Message #16


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 30
Inscrit : 4-February 12
Membre no 30570



je n'ai pas "implanté" de module j'ai modifié le module présent d'origine dans la 2.3.1... j'ai utilisé la procédure déscrite dans la FAQ afin de modifié le fichier et c'est depuis ce moment la que sa "merde"

Merci de ton aide
Go to the top of the page
 
Budington
posté 19 Mar 2012, 17:51
Message #17


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 30
Inscrit : 4-February 12
Membre no 30570



Bon alors j'ai repris a 0 le fichier fonctionne avec 6 zones et les tarifs. sa merde avec l'adaptation pour mettre en "dur" les tarifs
Go to the top of the page
 

Reply to this topicStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :

 



RSS Version bas débit Nous sommes le : 23rd May 2013 - 18:36
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)