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

Bienvenue invité ( Connexion | Inscription )

4 Pages V  < 1 2 3 4 >  
Reply to this topicStart new topic
> [Résolu] Méthode d'expédition dépendant du produit, Lettre ou Colissimo
LOLO84
posté 28 Dec 2005, 15:01
Message #26


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 23
Inscrit : 17-June 05
Membre no 6244



je te le copie dans le message cest shopping cart dans includes classes de la parti catalog


<?php
/*
$Id: shopping_cart.php,v 1.35 2003/06/25 21:14:33 hpdl Exp $

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

Copyright © 2003 osCommerce

Released under the GNU General Public License
*/

class shoppingCart {
var $contents, $total, $weight, $cartID, $content_type;

function shoppingCart() {
$this->reset();
}

function restore_contents() {
global $customer_id;

if (!tep_session_is_registered('customer_id')) return false;

// insert current cart contents in database
if (is_array($this->contents)) {
reset($this->contents);
while (list($products_id, ) = each($this->contents)) {
$qty = $this->contents[$products_id]['qty'];
$product_query = tep_db_query("select products_id from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
if (!tep_db_num_rows($product_query)) {
tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "')");
if (isset($this->contents[$products_id]['attributes'])) {
reset($this->contents[$products_id]['attributes']);
while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')");
}
}
} else {
tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $qty . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
}
}
}

// reset per-session cart contents, but not the database contents
$this->reset(false);

$products_query = tep_db_query("select products_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
while ($products = tep_db_fetch_array($products_query)) {
$this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity']);
// attributes
$attributes_query = tep_db_query("select products_options_id, products_options_value_id from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'");
while ($attributes = tep_db_fetch_array($attributes_query)) {
$this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id'];
}
}

$this->cleanup();
}

function reset($reset_database = false) {
global $customer_id;

$this->contents = array();
$this->total = 0;
$this->weight = 0;
$this->oversized = 0;
$this->content_type = false;

if (tep_session_is_registered('customer_id') && ($reset_database == true)) {
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "'");
}

unset($this->cartID);
if (tep_session_is_registered('cartID')) tep_session_unregister('cartID');
}

function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) {
global $new_products_id_in_cart, $customer_id;

$products_id = tep_get_uprid($products_id, $attributes);
if ($notify == true) {
$new_products_id_in_cart = $products_id;
tep_session_register('new_products_id_in_cart');
}

if ($this->in_cart($products_id)) {
$this->update_quantity($products_id, $qty, $attributes);
} else {
$this->contents[] = array($products_id);
$this->contents[$products_id] = array('qty' => $qty);
// insert into database
if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "')");

if (is_array($attributes)) {
reset($attributes);
while (list($option, $value) = each($attributes)) {
$this->contents[$products_id]['attributes'][$option] = $value;
// insert into database
if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')");
}
}
}
$this->cleanup();

// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
$this->cartID = $this->generate_cart_id();
}

function update_quantity($products_id, $quantity = '', $attributes = '') {
global $customer_id;

if (empty($quantity)) return true; // nothing needs to be updated if theres no quantity, so we return true..

$this->contents[$products_id] = array('qty' => $quantity);
// update database
if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");

if (is_array($attributes)) {
reset($attributes);
while (list($option, $value) = each($attributes)) {
$this->contents[$products_id]['attributes'][$option] = $value;
// update database
if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'");
}
}
}

function cleanup() {
global $customer_id;

reset($this->contents);
while (list($key,) = each($this->contents)) {
if ($this->contents[$key]['qty'] < 1) {
unset($this->contents[$key]);
// remove from database
if (tep_session_is_registered('customer_id')) {
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'");
}
}
}
}

function count_contents() { // get total number of items in cart
$total_items = 0;
if (is_array($this->contents)) {
reset($this->contents);
while (list($products_id, ) = each($this->contents)) {
$total_items += $this->get_quantity($products_id);
}
}

return $total_items;
}

function get_quantity($products_id) {
if (isset($this->contents[$products_id])) {
return $this->contents[$products_id]['qty'];
} else {
return 0;
}
}

function in_cart($products_id) {
if (isset($this->contents[$products_id])) {
return true;
} else {
return false;
}
}

function remove($products_id) {
global $customer_id;

unset($this->contents[$products_id]);
// remove from database
if (tep_session_is_registered('customer_id')) {
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
}

// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
$this->cartID = $this->generate_cart_id();
}

function remove_all() {
$this->reset();
}

function get_product_id_list() {
$product_id_list = '';
if (is_array($this->contents)) {
reset($this->contents);
while (list($products_id, ) = each($this->contents)) {
$product_id_list .= ', ' . $products_id;
}
}

return substr($product_id_list, 2);
}

function calculate() {
$this->total = 0;
$this->weight = 0;
if (!is_array($this->contents)) return 0;

reset($this->contents);
while (list($products_id, ) = each($this->contents)) {
$qty = $this->contents[$products_id]['qty'];

// products price
$product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight, products_oversize from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
if ($product = tep_db_fetch_array($product_query)) {
$prid = $product['products_id'];
$products_tax = tep_get_tax_rate($product['products_tax_class_id']);
$products_price = $product['products_price'];
$products_weight = $product['products_weight'];
$products_oversize = $product['products_oversize'];



$specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
if (tep_db_num_rows ($specials_query)) {
$specials = tep_db_fetch_array($specials_query);
$products_price = $specials['specials_new_products_price'];
}

$this->total += tep_add_tax($products_price, $products_tax) * $qty;
$this->weight += ($qty * $products_weight);
$this->oversized += $products_oversize;
}


}

// attributes price
if (isset($this->contents[$products_id]['attributes'])) {
reset($this->contents[$products_id]['attributes']);
while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
$attribute_price = tep_db_fetch_array($attribute_price_query);
if ($attribute_price['price_prefix'] == '+') {
$this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
} else {
$this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
}
}
}
}
}

function attributes_price($products_id) {
$attributes_price = 0;

if (isset($this->contents[$products_id]['attributes'])) {
reset($this->contents[$products_id]['attributes']);
while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
$attribute_price = tep_db_fetch_array($attribute_price_query);
if ($attribute_price['price_prefix'] == '+') {
$attributes_price += $attribute_price['options_values_price'];
} else {
$attributes_price -= $attribute_price['options_values_price'];
}
}
}

return $attributes_price;
}

function get_products() {
global $languages_id;

if (!is_array($this->contents)) return false;

$products_array = array();
reset($this->contents);
while (list($products_id, ) = each($this->contents)) {
$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
if ($products = tep_db_fetch_array($products_query)) {
$prid = $products['products_id'];
$products_price = $products['products_price'];

$specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
if (tep_db_num_rows($specials_query)) {
$specials = tep_db_fetch_array($specials_query);
$products_price = $specials['specials_new_products_price'];
}

$products_array[] = array('id' => $products_id,
'name' => $products['products_name'],
'model' => $products['products_model'],
'image' => $products['products_image'],
'price' => $products_price,
'quantity' => $this->contents[$products_id]['qty'],
'weight' => $products['products_weight'],
'final_price' => ($products_price + $this->attributes_price($products_id)),
'tax_class_id' => $products['products_tax_class_id'],
'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));
}
}

return $products_array;
}

function show_total() {
$this->calculate();

return $this->total;
}

function show_weight() {
$this->calculate();

return $this->weight;
}

function generate_cart_id($length = 5) {
return tep_create_random_value($length, 'digits');
}

function get_content_type() {
$this->content_type = false;

if ( (DOWNLOAD_ENABLED == 'true') && ($this->count_contents() > 0) ) {
reset($this->contents);
while (list($products_id, ) = each($this->contents)) {
if (isset($this->contents[$products_id]['attributes'])) {
reset($this->contents[$products_id]['attributes']);
while (list(, $value) = each($this->contents[$products_id]['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)$products_id . "' and pa.options_values_id = '" . (int)$value . "' and pa.products_attributes_id = pad.products_attributes_id");
$virtual_check = tep_db_fetch_array($virtual_check_query);

if ($virtual_check['total'] > 0) {
switch ($this->content_type) {
case 'physical':
$this->content_type = 'mixed';

return $this->content_type;
break;
default:
$this->content_type = 'virtual';
break;
}
} else {
switch ($this->content_type) {
case 'virtual':
$this->content_type = 'mixed';

return $this->content_type;
break;
default:
$this->content_type = 'physical';
break;
}
}
}
} else {
switch ($this->content_type) {
case 'virtual':
$this->content_type = 'mixed';

return $this->content_type;
break;
default:
$this->content_type = 'physical';
break;
}
}
}
} else {
$this->content_type = 'physical';
}

return $this->content_type;
}

function unserialize($broken) {
for(reset($broken);$kv=each($broken)wink.gif {
$key=$kv['key'];
if (gettype($this->$key)!="user function")
$this->$key=$kv['value'];
}
}

}
function show_oversized() {
$this->calculate();

return $this->oversized;
?>
Go to the top of the page
 
isnogood
posté 28 Dec 2005, 15:14
Message #27


Ceinture noire OSC
Icône de groupe

Groupe : Membres
Messages : 2045
Inscrit : 22-February 04
Membre no 2022



Remplace à la fin :

CODE
}
function show_oversized() {
$this->calculate();

return $this->oversized;


par

CODE
function show_oversized() {
$this->calculate();

return $this->oversized;
}

Go to the top of the page
 
LOLO84
posté 28 Dec 2005, 15:21
Message #28


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 23
Inscrit : 17-June 05
Membre no 6244



g une erreur sur la ligne 380 maintenant

la fin du code est :

$this->content_type = 'physical';
}

return $this->content_type;
}

function unserialize($broken) { <----- ligne 380
for(reset($broken);$kv=each($broken)wink.gif {
$key=$kv['key'];
if (gettype($this->$key)!="user function")
$this->$key=$kv['value'];
}
}

function show_oversized() {
$this->calculate();

return $this->oversized;
}
?>
Go to the top of the page
 
LOLO84
posté 28 Dec 2005, 18:09
Message #29


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 23
Inscrit : 17-June 05
Membre no 6244



bonjour

je nai plus lerreur pour shopping cart mais jai de nouveau cette erreur :

Fatal error: Call to undefined function: show_oversized() in d:\www\*******.com\htdocs\figurine\catalog\includes\modules\shipping\colis.php on line 53

desoler pour tous ces embetement

merci


ligne 53 :

if (is_object($cart)) {$OversizedProducts = $cart->show_oversized();}
if ($this->oversized_module == true) {
if ( $OversizedProducts == 0 ) {$this->enabled = false;}
} else {
if ( $OversizedProducts > 0 ) {$this->enabled = false;}
}
Go to the top of the page
 
fissiaux
posté 28 Dec 2005, 21:52
Message #30


5eme dan OSC
Icône de groupe

Groupe : Membres
Messages : 17048
Inscrit : 26-November 03
Lieu : Chez moi
Membre no 1669



Peux tu nous montrer les 70 premières lignes de ce fichier colis.php
Go to the top of the page
 
LOLO84
posté 29 Dec 2005, 09:47
Message #31


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 23
Inscrit : 17-June 05
Membre no 6244



bonjour,

voici les 70 premiere ligne du fichier colis.php, ce sont les meme ke dans ce topic vu ke c'est juste un copier coller


CODE
<?php
/*
$Id: colis.php,v 1.00 2005/03/07 10:37:00 Phocea $

osCommerce, Open Source E-Commerce Solutions
[URL=http://www.oscommerce.com]http://www.oscommerce.com[/URL]

Copyright © 2002 - 2003 osCommerce

Released under the GNU General Public License
*/
/********************************************************************
* Copyright © 2001 - 2003 TheMedia, Dipl.-Ing Thomas Plänkers
*       [URL=http://www.themedia.at]http://www.themedia.at[/URL] & [URL=http://www.oscommerce.at]http://www.oscommerce.at[/URL]
*
*                    All rights reserved
*
* This program is free software licensed under the GNU General Public License (GPL).
*
*    This program is free software; you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation; either version 2 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with this program; if not, write to the Free Software
*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
*    USA
*
*********************************************************************/

class colis {
  var $code, $title, $description, $icon, $enabled, $num_frc, $types;
// class constructor
  function colis() {
    global $order, $cart;

    $this->code = 'colis';
    $this->title = MODULE_SHIPPING_FRC_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_FRC_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_FRC_SORT_ORDER;
    $this->icon = DIR_WS_ICONS . 'shipping_frc.gif';
    $this->tax_class = MODULE_SHIPPING_FRC_TAX_CLASS;
    $this->oversized_module = ((MODULE_SHIPPING_FRC_OVERSIZE == 'True') ? true : false);
    $this->enabled = ((MODULE_SHIPPING_FRC_STATUS == 'True') ? true : false);
   
    if (is_object($cart)) {$OversizedProducts = $cart->show_oversized();}
    if ($this->oversized_module == true) {
     if ( $OversizedProducts == 0 ) {$this->enabled = false;}
    } else {
     if ( $OversizedProducts > 0 ) {$this->enabled = false;}
    }


    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FRC_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_FRC_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;
      }
    }

    $this->types = array('ECO' => MODULE_SHIPPING_FRC_ECONOMY,
                         'INS' => MODULE_SHIPPING_FRC_INSURANCE,
                         'URG' => MODULE_SHIPPING_FRC_URGENT,
                         'URGINS' => MODULE_SHIPPING_FRC_URGENT_INSURANCE,);

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

// class methods
Go to the top of the page
 
polo
posté 12 Jan 2006, 22:33
Message #32


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1441
Inscrit : 24-April 03
Membre no 1102



Bonsoir,

Moi aussi j'ai le même soucis que LOLO84, la ligne :

CODE
 function show_oversized() {
    $this->calculate();

    return $this->oversized;
  }


et bien si je la met comme indiqué dans l'explication j'ai ceci comme message:

CODE
Fatal error: Call to undefined function: show_oversized() in d:\easyphp\www\monsite.com\shop\includes\modules\shipping\colis.php on line 53


J'ai donc mis cette ligne au haut avec les autre function , j'ai plus de message d'erreur mais je me demande si la contrib fonctionne réelement dans ce cas la ???


--------------------
OSC 2.1.3 et MS2 (PHP Version 5.2.17)
Go to the top of the page
 
maxcdr
posté 13 Jan 2006, 08:09
Message #33


Ceinture verte OSC
Icône de groupe

Groupe : Membres
Messages : 754
Inscrit : 10-April 05
Lieu : Haute-Savoie
Membre no 5449



QUOTE (polo @ 12 jan 2006, 16:33)
J'ai donc mis cette ligne au haut avec les autre function , j'ai plus de message d'erreur mais je me demande si la contrib fonctionne réelement dans ce cas la ???

C'est ce que j'ai fait et cela fonctionne.

La fin de mon fichier shopping_cart.php :

CODE

     return $products_array;
   }

   function show_total() {
     $this->calculate();

     return $this->total;
   }

   function show_weight() {
     $this->calculate();

     return $this->weight;
   }
             function show_oversized() {
    $this->calculate();

    return $this->oversized;
  }

   function generate_cart_id($length = 5) {
     return tep_create_random_value($length, 'digits');
   }

   function get_content_type() {
     $this->content_type = false;

     if ( (DOWNLOAD_ENABLED == 'true') && ($this->count_contents() > 0) ) {
       reset($this->contents);
       while (list($products_id, ) = each($this->contents)) {
         if (isset($this->contents[$products_id]['attributes'])) {
           reset($this->contents[$products_id]['attributes']);
           while (list(, $value) = each($this->contents[$products_id]['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)$products_id . "' and pa.options_values_id = '" . (int)$value . "' and pa.products_attributes_id = pad.products_attributes_id");
             $virtual_check = tep_db_fetch_array($virtual_check_query);

             if ($virtual_check['total'] > 0) {
               switch ($this->content_type) {
                 case 'physical':
                   $this->content_type = 'mixed';

                   return $this->content_type;
                   break;
                 default:
                   $this->content_type = 'virtual';
                   break;
               }
             } else {
               switch ($this->content_type) {
                 case 'virtual':
                   $this->content_type = 'mixed';

                   return $this->content_type;
                   break;
                 default:
                   $this->content_type = 'physical';
                   break;
               }
             }
           }
         } else {
           switch ($this->content_type) {
             case 'virtual':
               $this->content_type = 'mixed';

               return $this->content_type;
               break;
             default:
               $this->content_type = 'physical';
               break;
           }
         }
       }
     } else {
       $this->content_type = 'physical';
     }

     return $this->content_type;
   }

   function unserialize($broken) {
     for(reset($broken);$kv=each($broken);) {
       $key=$kv['key'];
       if (gettype($this->$key)!="user function")
       $this->$key=$kv['value'];
     }
   }

 }

?>


--------------------
Go to the top of the page
 
polo
posté 15 Jan 2006, 20:11
Message #34


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1441
Inscrit : 24-April 03
Membre no 1102



Ok je suis content que chez toi çà marche biggrin.gif , par contre peut tu me dire comment tu configure ton admin (au niveau expedition, quel module tu as intégré et comment ils sont configuré) ? et ce que tu as mis sur ton produit ? si tu as mis un poids, qu'est ce que tu as mis dans "produits emcombrant" car chez moi cela ne fait strictement rien. que je mette "0" ou "100".. dans produit encombrant cela ne change rien... dry.gif


--------------------
OSC 2.1.3 et MS2 (PHP Version 5.2.17)
Go to the top of the page
 
maxcdr
posté 15 Jan 2006, 20:38
Message #35


Ceinture verte OSC
Icône de groupe

Groupe : Membres
Messages : 754
Inscrit : 10-April 05
Lieu : Haute-Savoie
Membre no 5449



Dans l'admin il faut mettre 1 si le produit est encombrant (envoyé par colis).
Quand tu dis "Cela ne fais strictement rien", que fais-tu pour le constater ?
Je te pose cette question parce que lorsque je rentre 1 dans le champs encombrant, que je valide et que ré-édite la fiche du produit, le 1 n'apparait plus. Mais il est bien présent dans la base.


--------------------
Go to the top of the page
 
polo
posté 15 Jan 2006, 21:03
Message #36


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1441
Inscrit : 24-April 03
Membre no 1102



Bah disons que j'ai toujours le même montant des frais de port et la même proposition de type d'envois:

Pour un produits avec 0 en poids et 1 en emcombrement j'ai ceci comme proposition:

Colis économique, j+5 max 7.00 €
Colis économique avec Assurance, j+5 max 11.00 €
Colissimo, j+2 max 8.00 €
Colissimo avec Assurance, j+2 max 11.00 €


Pour un produits avec 0 en poids et 0 en emcombrement j'ai ceci comme proposition:

Colis économique, j+5 max 7.00 €
Colis économique avec Assurance, j+5 max 11.00 €
Colissimo, j+2 max 8.00 €
Colissimo avec Assurance, j+2 max 11.00 €



Pour un produits avec 1 en poids et 0 en emcombrement j'ai ceci comme proposition:

Colis économique, j+5 max 8.30 €
Colis économique avec Assurance, j+5 max 12.30 €
Colissimo, j+2 max 9.00 €
Colissimo avec Assurance, j+2 max 12.20 €


Pour un produits avec 1 en poids et 0 en emcombrement j'ai ceci comme proposition:

Colis économique, j+5 max 8.30 €
Colis économique avec Assurance, j+5 max 12.30 €
Colissimo, j+2 max 9.00 €
Colissimo avec Assurance, j+2 max 12.20 €

Pour un produits avec 1 en poids et 1 en emcombrement j'ai ceci comme proposition:

Colis économique, j+5 max 8.30 €
Colis économique avec Assurance, j+5 max 12.30 €
Colissimo, j+2 max 9.00 €
Colissimo avec Assurance, j+2 max 12.20 €

Donc l'emcombrement n'a aucun effet pour moi blush.gif sinon c'est soit une mauvaise intégration au niveau du fichier categorie.php, soit une mauvaise configuration au niveau de l'admin:

Pour les module d'expedition je n'ai mis que "Colis de La Poste (Large)" et "Colis de La Poste (normal lettre)":

Colis de La Poste (Large) :
French PostOffice - Letter -> True
Zone -> France
Enable Oversized -> True

Colis de La Poste (normal lettre):
French PostOffice - Letter -> True
Zone -> France
Enable Oversized -> False

Sinon moi la valeur "1" dans le champ produit emcombrant reste sauvé... bref sinon pourrait tu m'envoyer ton fichiers categorie.php en PV afin de voir si c'est bien un problème d'intégration.. question.gif


--------------------
OSC 2.1.3 et MS2 (PHP Version 5.2.17)
Go to the top of the page
 
polo
posté 16 Jan 2006, 01:46
Message #37


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1441
Inscrit : 24-April 03
Membre no 1102



Bon j'y suis arrivé il s'agissait de mon shopping_cart... dry.gif

Si j'ai ben compris ce systeme et plutôt dépendant du poids, seulement voila j'aimerais pouvoir affecter un prix de frais de transport individuel pour chaque produits, je connais bien sur la contribution "Individual price" mais le seul Hic c'est que cette dernière au lieu de confondre la somme des frais de ports (dans le cas ou le client commande plusieurs produits encombrant..) , elle additionne tous les frais de ports, c'est assez embettant car imaginez la facture du client ohmy.gif

Comment faire pour que seulement le prix individuel le plus haut soit pris en compte ?


--------------------
OSC 2.1.3 et MS2 (PHP Version 5.2.17)
Go to the top of the page
 
Phocea
posté 17 Jan 2006, 09:59
Message #38


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1448
Inscrit : 12-March 05
Lieu : Chuiche
Membre no 5120



Salut me revoilou ...
Bon desole pour les messages non repondu j'etais pas vraiment la, pb personnel mais ca s'arrange.
Merci a maxcdr pour faire le support ..d ailleurs pour ton probleme je pense que dans le code de categories.php de l admin tu as du inserer ce qu il fallait pour "updater" la base avec la nouvelle valeur mais je pense que tu as du oublier de rajouter la colonne au select de depart.
Ce qui explique pourquoi ca ne s'affiche pas.

Je dois reinstaller tout ca sur une base neuve, alors je vais faire du nettoyage au passage !!

Polo, cette contrib n'attribut pas une classe de frais de port en fonction du poid mais en fonction d'une categorie de produit. Ici on parle de produit encombrant ou pas et on utilise la valeur 0/1 mais tu pourrais tres bien etendre cette contrib en lui affectant plus de categorie a/b/c/d.
A la fin par contre, elle prend bien en compte le poids de tout les produits pour calculer les frais de port.
Dans ton cas tu devrais plutot mouliner sur individual shipping per product et change le code du module pour trouver la valeur la plus grande et s'en servir plutot que d'additionner
Go to the top of the page
 
maxcdr
posté 17 Jan 2006, 10:25
Message #39


Ceinture verte OSC
Icône de groupe

Groupe : Membres
Messages : 754
Inscrit : 10-April 05
Lieu : Haute-Savoie
Membre no 5449



QUOTE
d ailleurs pour ton probleme je pense que dans le code de categories.php de l admin tu as du inserer ce qu il fallait pour "updater" la base avec la nouvelle valeur mais je pense que tu as du oublier de rajouter la colonne au select de depart.
Ce qui explique pourquoi ca ne s'affiche pas.

En fait j'avais oublié un product_oversize après un product_weight dans mon categorie.php... C'est maintenant résolu (Merci Polo wink.gif)


--------------------
Go to the top of the page
 
polo
posté 18 Jan 2006, 13:53
Message #40


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1441
Inscrit : 24-April 03
Membre no 1102



Merci Phocea pour ta réponse et bon courage avec ta famille ;o)


Revenons à nos moutons, en fait pour "individual shipping per product ", je ne connais pas, j'ai installé "Individual Product Shipping Prices - v1.0", "individual product shipping price" et même "Multiple Individual Product Shipping Prices", cette dernière et la meilleur et plus simple à mettre en oeuvres, elles fonctionnent tous plus ou moin bien mais le problème c'est qu'elles additionnent tous les frais produits par produits..

Donc comme je suis un peu limité au niveau php je sais pas quel code je doit modifier pour "Multiple Individual Product Shipping Prices" afin de confondre les prix, je pense que ce module colerais mieu au tien , surtout dans le cas de gros transporteur, imagine un client qui achete 2 colis très encombrant, je ne le vois pas payer 2 fois les frias de port d'autant que ce sera dans le même camion.


--------------------
OSC 2.1.3 et MS2 (PHP Version 5.2.17)
Go to the top of the page
 
Phocea
posté 18 Jan 2006, 14:45
Message #41


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1448
Inscrit : 12-March 05
Lieu : Chuiche
Membre no 5120



C'est dans les fonctions de la classe shopping_cart.php

Dans la fonction calculate, c est la que la somme des pois total et autres attributs et faite selons ce qui est dans le panier. Ce poids est ensuite utilises dans n importe quel module de livraison, selon le poid le tarif est choisi


Dans cette fonction il y a une boucle sur chaque prouits du panier
CODE
while (list($products_id, ) = each($this->contents)) {


Puis a un moment
CODE
$products_weight = $product['products_weight'];

Et enfin ce qui nous interesse:
CODE
this->weight += ($qty * $products_weight);


Dans ton cas si j ai bien compris tu ne veux pas que ce poids s'aditionne mais que le pois de l article le plus lourd soit pris en compte ?
Il faudrait donc que dans cette boucle tu fasses un trucs du genre

CODE
if ($products_weight > this->weight ){
this->weight = $products_weight;
}

a la place de la ligne
CODE
this->weight += ($qty * $products_weight);


Apres ca tu peux utiliser un module de shipping tout simple en donnant le tarif par rapport au poid, et seul le poid de l article le plus lourd du panier sera utilise
Go to the top of the page
 
polo
posté 18 Jan 2006, 18:13
Message #42


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1441
Inscrit : 24-April 03
Membre no 1102



Ok ta methode fonctionne biggrin.gif seul les frais sont confondu, j'ai couplé avec le module "multiple individuel shipping"


-------------------------------------

Donc j'ai essayé d'ajouter une clé comme tu dit pour ce module mais çà ne change rien, j'ai du me planter voici le code de multiple indicidual shipping que j'ai modifié:


CODE

<?php

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

// class constructor
   function indvship2() {
     global $order;
  // oversize
  $this->oversized_module = ((MODULE_SHIPPING_FRL_OVERSIZE == 'True') ? true : false);
  // oversize
     $this->code = 'indvship2';
     $this->title = MODULE_SHIPPING_INDVSHIP2_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_INDVSHIP2_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_INDVSHIP2_SORT_ORDER;
     $this->icon = '';
     $this->tax_class = MODULE_SHIPPING_INDVSHIP2_TAX_CLASS;
     $this->enabled = ((MODULE_SHIPPING_INDVSHIP2_STATUS == 'True') ? true : false);

  // oversize
if (is_object($cart)) {$OversizedProducts = $cart->show_oversized();}
    if ($this->oversized_module == true) {
     if ( $OversizedProducts == 0 ) {$this->enabled = false;}
    } else {
     if ( $OversizedProducts > 0 ) {$this->enabled = false;}
    }
  // oversize
 
// Enable Individual Shipping Module
     $this->enabled = MODULE_SHIPPING_INDVSHIP2_STATUS;
     if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_INDVSHIP2_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_INDVSHIP2_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'] < 2) {
           $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, $cart;
  $shiptotal2 = $cart->get_shiptotal2();

     $this->quotes = array('id' => $this->code,
                           'module' => MODULE_SHIPPING_INDVSHIP2_TEXT_TITLE,
                           'methods' => array(array('id' => $this->code,
                                                    'title' => MODULE_SHIPPING_INDVSHIP2_TEXT_WAY,
                                                    'cost' => $shiptotal2)));

     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_INDVSHIP2_STATUS'");
       $this->_check = tep_db_num_rows($check_query);
     }
     return $this->_check;
   }

   function install() {

  // oversize
    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 Oversized', 'MODULE_SHIPPING_FRL_OVERSIZE', 'True', 'Does this method handle oversized items', '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, set_function, date_added) values ('Enable Individual Shipping Prices 2', 'MODULE_SHIPPING_INDVSHIP2_STATUS', 'True', 'Do you want to offer individual shipping prices?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
  // oversize
    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_INDVSHIP2_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_INDVSHIP2_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_INDVSHIP2_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_INDVSHIP2_STATUS', 'MODULE_SHIPPING_INDVSHIP2_TAX_CLASS', 'MODULE_SHIPPING_INDVSHIP2_ZONE', 'MODULE_SHIPPING_INDVSHIP2_SORT_ORDER');
   }
 }
?>



J'ai donc rajouté les 3 élements de code qui sont entre // oversize mais çà ne change rien, même si j'installe et désinstalle le module, donc peut tu me dire ou sont mes erreurs ? merci Phocea ! ;o) rolleyes.gif


--------------------
OSC 2.1.3 et MS2 (PHP Version 5.2.17)
Go to the top of the page
 
Phocea
posté 18 Jan 2006, 18:55
Message #43


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1448
Inscrit : 12-March 05
Lieu : Chuiche
Membre no 5120



Tu t embetes pour rien je pense, recupere un module de shipping de base, pour les colieco ou autres et dans l'admin tu rentres juste tes tarifs par zone et poids.
En changeant la fonction calculate le calcul se fera toujours uniquement sur l article le plus lourd et basta.

Donc pas besoin e faire d autre changement ou d introduire la notion de produits encombrant (oversize)
Go to the top of the page
 
polo
posté 18 Jan 2006, 19:02
Message #44


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1441
Inscrit : 24-April 03
Membre no 1102



Non mais çà marche l'oversize et c'est exactement ce qu'il me faut car certain produits sont très specifique et je doit gerer çà en therme de poids/volume et surtout pouvoir ajouter un prix specifique pour certain produits, donc c'est ok pour moi de ce coté la, par contre je n'arrive pas à intégrer le clé pour activer ou non mon module "multiple individual shipping" , comment faire ? question.gif


--------------------
OSC 2.1.3 et MS2 (PHP Version 5.2.17)
Go to the top of the page
 
polo
posté 20 Jan 2006, 13:59
Message #45


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1441
Inscrit : 24-April 03
Membre no 1102



Bonjour,

Personne ne peux m'aider ?

car il faudrais juste mettre dans le code suivants la clé pour utiliser ou non oversize ?:

CODE
<?php

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

// class constructor
   function indvship3() {
     global $order;
     $this->code = 'indvship3';
     $this->title = MODULE_SHIPPING_INDVSHIP3_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_INDVSHIP3_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_INDVSHIP3_SORT_ORDER;
     $this->icon = '';
     $this->tax_class = MODULE_SHIPPING_INDVSHIP3_TAX_CLASS;
     $this->enabled = ((MODULE_SHIPPING_INDVSHIP3_STATUS == 'True') ? true : false);

// Enable Individual Shipping Module
     $this->enabled = MODULE_SHIPPING_INDVSHIP3_STATUS;
     if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_INDVSHIP3_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_INDVSHIP3_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'] < 2) {
           $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, $cart;
  $shiptotal3 = $cart->get_shiptotal3();

     $this->quotes = array('id' => $this->code,
                           'module' => MODULE_SHIPPING_INDVSHIP3_TEXT_TITLE,
                           'methods' => array(array('id' => $this->code,
                                                    'title' => MODULE_SHIPPING_INDVSHIP3_TEXT_WAY,
                                                    'cost' => $shiptotal3)));

     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_INDVSHIP3_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 Individual Shipping Prices 3', 'MODULE_SHIPPING_INDVSHIP3_STATUS', 'True', 'Do you want to offer individual shipping prices?', '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_INDVSHIP3_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_INDVSHIP3_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_INDVSHIP3_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_INDVSHIP3_STATUS', 'MODULE_SHIPPING_INDVSHIP3_TAX_CLASS', 'MODULE_SHIPPING_INDVSHIP3_ZONE', 'MODULE_SHIPPING_INDVSHIP3_SORT_ORDER');
   }
 }
?>



Merci pour votre aide car j'ai juste besoin de mettre la clé et tous sera ok ..


--------------------
OSC 2.1.3 et MS2 (PHP Version 5.2.17)
Go to the top of the page
 
Phocea
posté 20 Jan 2006, 14:16
Message #46


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1448
Inscrit : 12-March 05
Lieu : Chuiche
Membre no 5120



Relis bien le tuto de la 1ere page vca te dis tout ce qu il faut faire et la clef uniquement ca ne suffira pas il faut aussi faire les changements en debut de classe pour que ca active/desactive le module automatiquement selon le contenu du panier
Go to the top of the page
 
polo
posté 20 Jan 2006, 21:59
Message #47


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1441
Inscrit : 24-April 03
Membre no 1102



Merci pour ta réponse Phocea wink.gif

Oui je pense avoir correctement suivi tes annotations, pour la class c'est bien sur le fichier module qu'il faut faire les modifs ?, en fait c'est bien expliqué sur le 2ieme post au tous début.

Le module que je désire intégré est ici:
Multiple individual shipping


voici le fichier module shipping une fois modifié:

CODE
<?php


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

// class constructor
   function indvship2() {
     global $order;
$this->oversized_module = ((MODULE_SHIPPING_FRL_OVERSIZE == 'True') ? true : false);
$this->code = 'indvship2';
 
 
     $this->title = MODULE_SHIPPING_INDVSHIP2_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_INDVSHIP2_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_INDVSHIP2_SORT_ORDER;
//    $this->icon = DIR_WS_ICONS . 'shipping_frc.gif';
     $this->tax_class = MODULE_SHIPPING_INDVSHIP2_TAX_CLASS;
     $this->enabled = ((MODULE_SHIPPING_INDVSHIP2_STATUS == 'True') ? true : false);

// Ici l'initialisation de Oversize

    if (is_object($cart)) {$OversizedProducts = $cart->show_oversized();}
    if ($this->oversized_module == true) {
     if ( $OversizedProducts == 0 ) {$this->enabled = false;}
    } else {
     if ( $OversizedProducts > 0 ) {$this->enabled = false;}
    }
// FIN INIT
 
// Enable Individual Shipping Module
     $this->enabled = MODULE_SHIPPING_INDVSHIP2_STATUS;
     if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_INDVSHIP2_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_INDVSHIP2_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'] < 2) {
           $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, $cart;
  $shiptotal2 = $cart->get_shiptotal2();

     $this->quotes = array('id' => $this->code,
                           'module' => MODULE_SHIPPING_INDVSHIP2_TEXT_TITLE,
                           'methods' => array(array('id' => $this->code,
                                                    'title' => MODULE_SHIPPING_INDVSHIP2_TEXT_WAY,
                                                    'cost' => $shiptotal2)));

     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_INDVSHIP2_STATUS'");
       $this->_check = tep_db_num_rows($check_query);
     }
     return $this->_check;
   }

   function install() {
// ajouter une cle de config dans chaque module de shipping
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 Oversized', 'MODULE_SHIPPING_FRL_OVERSIZE', 'True', 'Does this method handle oversized items', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
// fin ajouter une cle de config dans chaque module de shipping

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 ('Transporteur Colis encombrant', 'MODULE_SHIPPING_FRC_STATUS', 'True', 'Désirez vous proposer cette solution ?', '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, set_function, date_added) values ('Enable Individual Shipping Prices 2', 'MODULE_SHIPPING_INDVSHIP2_STATUS', 'True', 'Do you want to offer individual shipping prices?', '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_INDVSHIP2_TAX_CLASS', '0', 'Utiliser la classe de taxe suivante sur les frais d\'expédition.', '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_INDVSHIP2_ZONE', '0', 'Si une zone est selectionné seulement cette zone sera employé', '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 ('Ordre d\'affichage.', 'MODULE_SHIPPING_INDVSHIP2_SORT_ORDER', '0', 'Ordre d\'affichage.', '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_INDVSHIP2_STATUS', 'MODULE_SHIPPING_INDVSHIP2_TAX_CLASS', 'MODULE_SHIPPING_INDVSHIP2_ZONE', 'MODULE_SHIPPING_INDVSHIP2_SORT_ORDER');
   }
 }
?>


Si cela ne marche pas c'est que j'ai du oublié quelques chose , non ?

Il n'y à rien à faire dans le shopping cart ?


--------------------
OSC 2.1.3 et MS2 (PHP Version 5.2.17)
Go to the top of the page
 
fissiaux
posté 19 Feb 2006, 13:57
Message #48


5eme dan OSC
Icône de groupe

Groupe : Membres
Messages : 17048
Inscrit : 26-November 03
Lieu : Chez moi
Membre no 1669



Montre nous l'ensemble de la fonction calculate, car sortie de son contexte, c'est dur dindiquer où est l'erreur.
Go to the top of the page
 
Phocea
posté 20 Feb 2006, 07:57
Message #49


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1448
Inscrit : 12-March 05
Lieu : Chuiche
Membre no 5120



Essaye plutot comme ca

CODE
$current_weight = this->weight;
if ($products_weight > $current_weight){
this->weight = $products_weight;
}
Go to the top of the page
 
Phocea
posté 20 Feb 2006, 19:24
Message #50


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1448
Inscrit : 12-March 05
Lieu : Chuiche
Membre no 5120



Et la ligne 245 c est quoi ??
Go to the top of the page
 

4 Pages V  < 1 2 3 4 >
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 : 29th March 2024 - 00:07
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)