[contribution] CGDiscountSpecials 1.4

Questo forum è dedicato alle discussioni riguardanti le contribution per osCommerce

Moderatore: mod Generali

Avatar utente
Simona67
membro Veteran
membro Veteran
Messaggi: 786
Iscritto il: 10/11/2003, 1:00
Località: Milano
Contatta:

Messaggio da Simona67 »

southmodel ha scritto: vorrei darvi una mano anche io ma ho perso il conto di quante contrib. ho inserito nel mio sito!!! (penso almeno 30 più qualche migliaio di ritocchi qua e la..)

fateci un giro (area admin a parte chiaramente...) e se trovate qualche modifica che vi ispira avvertitemi...
Puoi elencare le contribution inserite nel tuo sito......

Per la gestione del tracking della postacelere 3 hai installato qualche contrib per la parte admin?
southmodel
membro Regular
membro Regular
Messaggi: 116
Iscritto il: 18/09/2003, 0:00
Località: Italia
Contatta:

Messaggio da southmodel »

Simona67 ha scritto:Puoi elencare le contribution inserite nel tuo sito...
impossibile...non me le ricordo +....
Simona67 ha scritto:Per la gestione del tracking della postacelere 3 hai installato qualche contrib per la parte admin?
no, no, se vuoi te la mando, praticamente è uguale alla contrib. per il Tracking del Corriere TNT, cambia solamente il codice HTML per il tracciamento.....
Avatar utente
IMS
membro Junior
membro Junior
Messaggi: 24
Iscritto il: 30/04/2004, 0:00
Località: IT

Problema con GDiscount

Messaggio da IMS »

Ho un piccolo problema con la contrib.
Non mi aggiorna i prezzi in
shopping_cart.php (solo il TOTALE a dx del prodotto, il Sub-Totale è ok)
checkout_confirmation.php (sia costo prodotto in alto che sub-totale ordine)
Mi potreste indirizzare sulle linee da controllare?

GRAZIE!!!!!!!
Avatar utente
Simona67
membro Veteran
membro Veteran
Messaggi: 786
Iscritto il: 10/11/2003, 1:00
Località: Milano
Contatta:

Re: Problema con GDiscount

Messaggio da Simona67 »

IMS ha scritto:Ho un piccolo problema con la contrib.
Non mi aggiorna i prezzi in
shopping_cart.php (solo il TOTALE a dx del prodotto, il Sub-Totale è ok)
checkout_confirmation.php (sia costo prodotto in alto che sub-totale ordine)
Mi potreste indirizzare sulle linee da controllare?

GRAZIE!!!!!!!
Intendi dire quando hai un prodotto nel carrello e con quantità 1 e poi vuoi cambiare la quantità e mettere che ne so 2 non ti aggiorna l'importo?

Se è così è forse perchè non schiacci il pulsantino aggiorna il carrello così facendo controlla le quantità e se ci sono dei prodotti spuntati e quindi i prodotti spuntati gli elimina e le quantità variate le moltiplica per l'importo unitario.

Sei sicuro di aver fatto il procedimento giusto io ho controllato e tutto funziona.
Avatar utente
hozone
Amministratore
Amministratore
Messaggi: 1199
Iscritto il: 23/12/2002, 1:00
Località: Italy
Contatta:

Messaggio da hozone »

Da questo momento al posto di questa contribution consiglio di usare:

Total B2B

ulteriori info: http://www.oscommerceitalia.com/modules ... =5038#5038
Avatar utente
IMS
membro Junior
membro Junior
Messaggi: 24
Iscritto il: 30/04/2004, 0:00
Località: IT

Re: Problema con GDiscount

Messaggio da IMS »

Simona67 ha scritto:
IMS ha scritto:Ho un piccolo problema con la contrib.
Non mi aggiorna i prezzi in
shopping_cart.php (solo il TOTALE a dx del prodotto, il Sub-Totale è ok)
checkout_confirmation.php (sia costo prodotto in alto che sub-totale ordine)
Mi potreste indirizzare sulle linee da controllare?

GRAZIE!!!!!!!
Intendi dire quando hai un prodotto nel carrello e con quantità 1 e poi vuoi cambiare la quantità e mettere che ne so 2 non ti aggiorna l'importo?

Se è così è forse perchè non schiacci il pulsantino aggiorna il carrello così facendo controlla le quantità e se ci sono dei prodotti spuntati e quindi i prodotti spuntati gli elimina e le quantità variate le moltiplica per l'importo unitario.
.............beh, se fosse questo il pb non ci sarebbe codice da controllare, no?? :) :)

Cmq ho risolto, mi ero dimenticato di integrare un pezzo di codice. nei file in oggetto..
La prtossima sfida è integrare alla contrib GDiscount la Price-Break
Ciaoo
Avatar utente
didjemaster
membro Regular
membro Regular
Messaggi: 110
Iscritto il: 21/05/2004, 0:00
Località: Italia
Contatta:

Problema

Messaggio da didjemaster »

Ciao a tutti.

Dopo aver installato la CGDiscountSpeciales1.4fix mi genera un errore nel debug e gli articoli che decido di allegare al gruppo non li visualizza.

Qualcuno ha avuto problemi simili o mi può aiutare?

Sono abbastanza disperato.
:cry:
Ciao Grazie
Rogers
membro Junior
membro Junior
Messaggi: 2
Iscritto il: 21/10/2004, 0:00
Località: France

Problem

Messaggio da Rogers »

Hi there,

I'm french and sorry if I don't speak Italian.

I hope you can help me. I've got a MS1 Creload 5, and I have installed (with adaptations) the CGDiscountSpecials mod and all is correct. But when I actived specials the subtotal in the shopping cart isn't correct.

See here :
http://www.seriesmax.com/pb.gif

My includes/classes/shopping_cart.php page :

Codice: Seleziona tutto

<?php
/*
  $Id: shopping_cart.php,v 1.2 2003/01/15 20:23:38 wilt Exp $

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

  Copyright (c) 2002 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 (!$customer_id) return 0;

// insert current cart contents in database
      if ($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 = '" . $customer_id . "' and products_id = '" . $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 ('" . $customer_id . "', '" . $products_id . "', '" . $qty . "', '" . date('Ymd') . "')");
            if ($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 ('" . $customer_id . "', '" . $products_id . "', '" . $option . "', '" . $value . "')");
              }
            }
          } else {
            tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $qty . "' where customers_id = '" . $customer_id . "' and products_id = '" . $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 = '" . $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 = '" . $customer_id . "' and products_id = '" . $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->content_type = false;

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

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

    function add_cart($products_id, $qty = '', $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 {
        if ($qty == '') $qty = '1'; // if no quantity is supplied, then add '1' to the customers basket

        $this->contents[] = array($products_id);
        $this->contents[$products_id] = array('qty' => $qty);
// insert into database
        if ($customer_id) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . $customer_id . "', '" . $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 ($customer_id) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . $customer_id . "', '" . $products_id . "', '" . $option . "', '" . $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 ($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 ($customer_id) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $quantity . "' where customers_id = '" . $customer_id . "' and products_id = '" . $products_id . "'");

      if (is_array($attributes)) {
        reset($attributes);
        while (list($option, $value) = each($attributes)) {
          $this->contents[$products_id]['attributes'][$option] = $value;
// update database
          if ($customer_id) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . $value . "' where customers_id = '" . $customer_id . "' and products_id = '" . $products_id . "' and products_options_id = '" . $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 ($customer_id) {
            tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "' and products_id = '" . $key . "'");
            tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . $customer_id . "' and products_id = '" . $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 ($this->contents[$products_id]) {
        return $this->contents[$products_id]['qty'];
      } else {
        return 0;
      }
    }

    function in_cart($products_id) {
      if ($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 ($customer_id) {
        tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "' and products_id = '" . $products_id . "'");
        tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . $customer_id . "' and products_id = '" . $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_virtual = 0;
      $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 from " . TABLE_PRODUCTS . " where products_id='" . tep_get_prid($products_id) . "'");
        if ($product = tep_db_fetch_array($product_query)) {
// ICW ORDER TOTAL CREDIT CLASS Start Amendment
          $no_count=1;
          $gv_query=tep_db_query("select products_model from ".TABLE_PRODUCTS." where products_id='".$products_id."'");
          $gv_result=tep_db_fetch_array($gv_query);
          if (ereg('^GIFT', $gv_result['products_model'])) {
            $no_count=0;
          }
// ICW ORDER TOTAL  CREDIT CLASS End Amendment
          $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'];
          
          
          $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . $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'];
          }
          
           	      //CGDiscountSpecials start
	      global $customer_id;
          $query = tep_db_query("select g.customers_groups_discount from " . TABLE_CUSTOMERS_GROUPS . " g inner join  " . TABLE_CUSTOMERS  . " c on g.customers_groups_id = c.customers_groups_id and c.customers_id = '" . $customer_id . "'");
          $query_result = tep_db_fetch_array($query);
          $customers_groups_discount = $query_result['customers_groups_discount'];
		  $query = tep_db_query("select customers_discount from " . TABLE_CUSTOMERS . " where customers_id =  '" . $customer_id . "'");
          $query_result = tep_db_fetch_array($query);
          $customer_discount = $query_result['customers_discount'];
          $customer_discount = $customer_discount + $customers_groups_discount;
		  if ($customer_discount >= 0) {
		     $products_price = $products_price + $products_price * abs($customer_discount) / 100;
	      } else {
		     $products_price = $products_price - $products_price * abs($customer_discount) / 100;
	      }
		  if ($special_price = tep_get_products_special_price($prid)) $products_price = $special_price - $special_price * abs($customer_discount) / 100;
		  //CGDiscountSpecials end         
          
          $this->total_virtual += tep_add_tax($products_price, $products_tax) * $qty*$no_count;// CREDIT CLASS;
          $this->weight_virtual += ($qty * $products_weight)*$no_count;// CREDIT CLASS;
          $this->total += tep_add_tax($products_price, $products_tax) * $qty;
          $this->weight += ($qty * $products_weight);
        }

// attributes price
        if ($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 = '" . $prid . "' and options_id = '" . $option . "' and options_values_id = '" . $value . "'");
            $attribute_price = tep_db_fetch_array($attribute_price_query);
            
          //CGDiscountSpecials start
	      global $customer_id;
          $query = tep_db_query("select g.customers_groups_discount from " . TABLE_CUSTOMERS_GROUPS . " g inner join  " . TABLE_CUSTOMERS  . " c on g.customers_groups_id = c.customers_groups_id and c.customers_id = '" . $customer_id . "'");
          $query_result = tep_db_fetch_array($query);
          $customers_groups_discount = $query_result['customers_groups_discount'];
		  $query = tep_db_query("select customers_discount from " . TABLE_CUSTOMERS . " where customers_id =  '" . $customer_id . "'");
          $query_result = tep_db_fetch_array($query);
          $customer_discount = $query_result['customers_discount'];
          $customer_discount = $customer_discount + $customers_groups_discount;
		  if ($customer_discount >= 0) {
		     $attribute_price['options_values_price'] = $attribute_price['options_values_price'] + $attribute_price['options_values_price'] * abs($customer_discount) / 100;
	      } else {
		     $attribute_price['options_values_price'] = $attribute_price['options_values_price'] - $attribute_price['options_values_price'] * abs($customer_discount) / 100;
	      }
          //CGDiscountSpecials end            
            
            
            
            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) {
      if ($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 = '" . $products_id . "' and options_id = '" . $option . "' and options_values_id = '" . $value . "'");
          $attribute_price = tep_db_fetch_array($attribute_price_query);
          
                    //CGDiscountSpecials start
	      global $customer_id;
          $query = tep_db_query("select g.customers_groups_discount from " . TABLE_CUSTOMERS_GROUPS . " g inner join  " . TABLE_CUSTOMERS  . " c on g.customers_groups_id = c.customers_groups_id and c.customers_id = '" . $customer_id . "'");
          $query_result = tep_db_fetch_array($query);
          $customers_groups_discount = $query_result['customers_groups_discount'];
		  $query = tep_db_query("select customers_discount from " . TABLE_CUSTOMERS . " where customers_id =  '" . $customer_id . "'");
          $query_result = tep_db_fetch_array($query);
          $customer_discount = $query_result['customers_discount'];
          $customer_discount = $customer_discount + $customers_groups_discount;
		  if ($customer_discount >= 0) {
		     $attribute_price['options_values_price'] = $attribute_price['options_values_price'] + $attribute_price['options_values_price'] * abs($customer_discount) / 100;
	      } else {
		     $attribute_price['options_values_price'] = $attribute_price['options_values_price'] - $attribute_price['options_values_price'] * abs($customer_discount) / 100;
	      }
          //CGDiscountSpecials end
          
          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 0;
      $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_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='" . tep_get_prid($products_id) . "' and pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "'");
        if ($products = tep_db_fetch_array($products_query)) {
          $prid = $products['products_id'];
          $products_price = $products['products_price'];

          //CGDiscountSpecials start
 	      global $customer_id;
           $query = tep_db_query("select g.customers_groups_discount from " . TABLE_CUSTOMERS_GROUPS . " g inner join  " . TABLE_CUSTOMERS  . " c on g.customers_groups_id = c.customers_groups_id and c.customers_id = '" . $customer_id . "'");
           $query_result = tep_db_fetch_array($query);
           $customers_groups_discount = $query_result['customers_groups_discount'];
 		  $query = tep_db_query("select customers_discount from " . TABLE_CUSTOMERS . " where customers_id =  '" . $customer_id . "'");
           $query_result = tep_db_fetch_array($query);
           $customer_discount = $query_result['customers_discount'];
           $customer_discount = $customer_discount + $customers_groups_discount;
 		  if (strstr($customer_discount, "+") != null) {
 		     $products_price = $products_price + $products_price * abs($customer_discount) / 100;
 	      } else {
 		     $products_price = $products_price - $products_price * abs($customer_discount) / 100;
 	      }
 		  if ($special_price = tep_get_products_special_price($prid)) $products_price = $special_price;
           //CGDiscountSpecials end

           $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'],
                                    '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' => $this->contents[$products_id]['attributes']);
        }
      }
      return $products_array;
    }

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

      return $this->total;
    }

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

      return $this->weight;
    }

// CREDIT CLASS Start Amendment    
    function show_total_virtual() {
      $this->calculate();

      return $this->total_virtual;
    }

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

      return $this->weight_virtual;
    }
// CREDIT CLASS End Amendment
    function generate_cart_id($length = 5) {
      return tep_create_random_value($length, 'digits');
    }

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

    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 = '" . $products_id . "' and pa.options_values_id = '" . $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;
     }

    // ------------------------ ICWILSON Gift Voucher Addittion-------------------------------Start
   // amend count_contents to show nil contents for shipping
   // as we don't want to quote for 'virtual' item
   // GLOBAL CONSTANTS if NO_COUNT_ZERO_WEIGHT is true then we don't count any product with a weight 
   // which is less than or equal to MINIMUM_WEIGHT
   // otherwise we just don't count gift certificates

    function count_contents_virtual() {  // get total number of items in cart disregard gift vouchers 
        $total_items = 0;
        if (is_array($this->contents)) {
            reset($this->contents);
            while (list($products_id, ) = each($this->contents)) {
              $no_count=false;
              $gv_query=tep_db_query("select products_model from ".TABLE_PRODUCTS." where products_id='".$products_id."'");
              $gv_result=tep_db_fetch_array($gv_query);
              if (ereg('^GIFT', $gv_result['products_model'])) {
                $no_count=true;
              }
              if (NO_COUNT_ZERO_WEIGHT==1) {
                $gv_query = tep_db_query("select products_weight from " . TABLE_PRODUCTS . " where products_id='" . tep_get_prid($products_id) . "'");
                $gv_result=tep_db_fetch_array($gv_query);
                if ($gv_result['products_weight']<=MINIMUM_WEIGHT) {
                  $no_count=true;
                }
              }
              if ($no_count==false) $total_items += $this->get_quantity($products_id);
            }
        }
        return $total_items;
    }
// ------------------------ ICWILSON Gift Voucher Addittion-------------------------------End
  }
?>
I've got an other problem whith specials.

When I active specials only for normal customers, the box specials is ok, no special, but if I go on the product page I've got a reduction even if I am on a special group.

Could you help me ?

Thanks
Avatar utente
hozone
Amministratore
Amministratore
Messaggi: 1199
Iscritto il: 23/12/2002, 1:00
Località: Italy
Contatta:

Messaggio da hozone »

it works sure with 2.2 ms2, with ms1, i dont' know how to help you.

anyway. i dismissi this contrib, case there are some bug, it's better if u use TotalB2b
Rogers
membro Junior
membro Junior
Messaggi: 2
Iscritto il: 21/10/2004, 0:00
Località: France

Messaggio da Rogers »

I know that it's for MS2 but since two months I'm on this problem.

The problem of subtotal is on shopping_cart.php, on the lines with specials.

Have you got an idea, if there is no solution ? I don't want to make a special e-shop for retailers.

Thanks for giving me a part of your time.
Avatar utente
hozone
Amministratore
Amministratore
Messaggi: 1199
Iscritto il: 23/12/2002, 1:00
Località: Italy
Contatta:

Messaggio da hozone »

really i don't know.
sorry
Rispondi