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

Bienvenue invité ( Connexion | Inscription )

 
Reply to this topicStart new topic
> spu Phoenix [Résolu], Livraison Drive-in
chti_poupon
posté 28 Apr 2020, 11:14
Message #1


Ceinture noire OSC
Icône de groupe

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



Bonjour
Je viens de reprendre le vieux module d'expédition spu pour l'adapter.

catalog/includes/languages/french/modules/shipping/spu.php
Code
<?php
/*
  $Id$

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

  Copyright (c) 2002 osCommerce
Adapté à patir de :   Based upon flat.php / spu.php by M. Halvorsen (http://www.arachnia-web.com)

  Made to work with latest check-out procedure by Matthijs (Mattice)
     >> e-mail:    mattice@xs4all.nl
     >> site:      http://www.matthijs.org
  
   CHANGES:
   - formatted to work with latest checkout procedure
   - removed icon references
   - updated the db queries

  Released under the GNU General Public License
*/

define('MODULE_SHIPPING_SPU_TEXT_TITLE', 'R&eacute;cup&eacute;ration des articles au magasin, &agrave; Douai (Nord)');   // ATTENTION Reporter le premier mot et sa longueur (&...; comptent) dans le module ot_loworderfree.php, vers la ligne 40 (pas de petite commande qui tienne en cas d'enl&egrave;vement.
define('MODULE_SHIPPING_SPU_TEXT_DESCRIPTION', 'Enl&egrave;vement des articles au magasin durant les heures &oelig;uvr&eacute;es.');
define('MODULE_SHIPPING_SPU_TEXT_WAY', 'Pour disponibilit&eacute;s et heure de passage, appellez-nous au 0327 955 103 d&egrave;s apr&egrave;s 11h le matin et 16h l\'apr&egrave;s-midi,<a href="' . tep_href_link(HTTP_SERVER.'/index.php?papier=horaire') . '"><b> aux heures d\'ouverture.</b></a>');
?>


et catalog/includes/modules/shipping/spu.php
Code
<?php
/*
  $Id$

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

  Copyright (c) 2003 osCommerce
Adapté à patir de :   Based upon flat.php / spu.php by M. Halvorsen (http://www.arachnia-web.com)

  Made to work with latest check-out procedure by Matthijs (Mattice)
     >> e-mail:    mattice@xs4all.nl
     >> site:      http://www.matthijs.org
  
   CHANGES:
   - formatted to work with latest checkout procedure
   - removed icon references
   - updated the db queries

  Released under the GNU General Public License
*/

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

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

      $this->code = 'spu';
      $this->title = MODULE_SHIPPING_SPU_TEXT_TITLE;
      $this->description = MODULE_SHIPPING_SPU_TEXT_DESCRIPTION;
    if ( defined('MODULE_SHIPPING_SPU_STATUS') ) {
      $this->sort_order = MODULE_SHIPPING_SPU_SORT_ORDER;
      $this->icon = '';
      $this->tax_class = MODULE_SHIPPING_SPU_TAX_CLASS;
      $this->enabled = ((MODULE_SHIPPING_SPU_STATUS == 'true') ? true : false);
    }
      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_SPU_ZONE > 0) ) {
        $check_flag = false;
        
        $delivery_country_id = $order->delivery['country']['id'] ?? STORE_COUNTRY ?? 0;
        $delivery_zone_id = $order->delivery['zone_id'] ?? STORE_ZONE ?? 0;
        
        $check_query = tep_db_query("select zone_id from zones_to_geo_zones where geo_zone_id = '" . MODULE_SHIPPING_SPU_ZONE . "' and zone_country_id = '" . $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'] == $delivery_zone_id) {
            $check_flag = true;
            break;
          }
        }

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

// class methods

    function quote($method = '') {
      global $order;

      $this->quotes = array('id' => $this->code,
                            'module' => MODULE_SHIPPING_SPU_TEXT_TITLE,
                            'methods' => array(array('id' => $this->code,
                                                     'title' => MODULE_SHIPPING_SPU_TEXT_WAY,
                                                     'cost'  => MODULE_SHIPPING_SPU_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, htmlspecialchars($this->title));

      return $this->quotes;
    }

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

    function install() {
      tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Activer le Drive-in', 'MODULE_SHIPPING_SPU_STATUS', 'true', 'Do you want to offer spu rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
      tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_SPU_COST', '5.00', 'The shipping cost for all orders using this shipping method.', '6', '0', now())");
      tep_db_query("insert into 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_SPU_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 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_SPU_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 configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_SPU_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
    }

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

    function keys() {
      return array('MODULE_SHIPPING_SPU_STATUS', 'MODULE_SHIPPING_SPU_COST', 'MODULE_SHIPPING_SPU_TAX_CLASS', 'MODULE_SHIPPING_SPU_ZONE', 'MODULE_SHIPPING_SPU_SORT_ORDER');
    }
  }
?>


Curieusement, quand j'active "install" dans l'admin, j'obtiens l'erreur:
Code
Notice: Use of undefined constant MODULE_SHIPPING_SPU_TEXT_TITLE - assumed 'MODULE_SHIPPING_SPU_TEXT_TITLE' in C:\Users\Chtibebecash\Documents\CE-Phoenix-master\CE-Phoenix-master\includes\modules\shipping\spu.php on line 31

qui disparaît si le copie mon fichier french dans la partie english !
J'ai décidément quelque chose qui ne va pas dans la langue...
Belle journée !
Go to the top of the page
 
Bonbec
posté 28 Apr 2020, 12:02
Message #2


Ceinture marron OSC
Icône de groupe

Groupe : Modérateurs
Messages : 1543
Inscrit : 30-May 06
Lieu : Vichy (03)
Membre no 10583



Bonjour,
Essaye d'effacer tes cookies pour voir ce que cela donne. Des fois çà remet le site d'aplomb.


--------------------
Config 1 en live : Osc 2.2 très fortement modifié ... UTF-8 et Php 5.4.
Contribs installées : down_for_maintenance_v 2.3 | Estimated Shipping v1.5 | imprint_1_3_5 | low_stock_report_v2.04 | visible_countries_1.2b | Products Tabs | shoppingCart_cleanup_v1.01.0 | + trop de bidouilles persos pas très OsCommerce (erreurs de jeunesse)
Config 2 en local avec UwAmp : Osc Phoenix
Go to the top of the page
 
chti_poupon
posté 28 Apr 2020, 16:35
Message #3


Ceinture noire OSC
Icône de groupe

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



smile.gif Merci ! belle idée les cookies: j'avais oublié cet élément: çà fonctionne !
Merci ! biggrin.gif
PS: mais j'ai toujours
Citation
session_start(): Failed to decode session object. Session has been destroyed
en cliquant "ajouter au panier" de n'importe où. Je ne peux donc pas tester ce module spu ! Cette panne n'existant pas au début de l'installation, il faut que parcoure les fichiers french qui ont reçu des modifications.
PS ' : Je mets ce post sur [Résolu]
Go to the top of the page
 
chti_poupon
posté 2 May 2020, 14:13
Message #4


Ceinture noire OSC
Icône de groupe

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



spu testé en local jusque validation commande. RAS
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 : 28th March 2024 - 18:38
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)