c )  nderungen an bestehenden Dateien:

###################################################
/lang/german/german.php
###################################################

Am Ende vor ?>
einfgen:

define('FREE_SHIPPING_TITLE','Versandkostenfrei');
define('FREE_SHIPPING_DESCRIPTION','Diese Artikel erhalten Sie von uns versandkostenfrei!');
define('SHIPPING_NO_COSTS_CART', 'fr diese Artikel berechnen wir keine Versandkosten');
define('SHIPPING_NO_COSTS_PRODUCT', 'fr diesen Artikel berechnen wir keine Versandkosten');
define('SHIPPING_MAXIMUM_CART','von diesem Produkt knnen Sie maximal {xx} Exemplare bestellen.');
define('PRODUCT_MAXIMUM_AMOUNT_EXCEEDED','Sie haben mehr als die erlaubte Menge eines Produktes in den Warenkorb gelegt. Die Menge wurde automatisch auf die mamximal erhltliche Anzahl reduziert!');


###################################################
lang/german/lang_german.conf
###################################################

Suche:

text_gccover = 'Ihr Kupon deckt den Warenwert

Diese Zeile komplett ersetzen mit:
text_gccover = 'Die Gesamtsumme betr&auml;gt 0,00 Euro. Sie m&uuml;ssen nun lediglich Unsere AGB akzeptieren und den Bestellprozess mit klick auf Weiter fortsetzen'

###################################################
lang/german/admin/categories.php
###################################################

Em Ende vor ?> folgenden Code einfgen:

define('TEXT_PRODUCTS_FREE_SHIPPING','Produkt Versandkostenfrei? ');
define('TEXT_PRODUCTS_MAX_FREE_SHIPPING_AMOUNT','Maximale versandkostenfreie Menge: ');
define('TEXT_PRODUCTS_MAX_FREE_SHIPPING_CART','Maximale Menge im Warenkorb: ');
define('TEXT_FREE_SHIPPING_TIP',' (0 = unbegrenzt) ');


###################################################
/checkout_process.php
###################################################

Suche:

if ((xtc_not_null(MODULE_PAYMENT_INSTALLED)) && (!isset ($_SESSION['payment']))):

und ndern in:

if ((xtc_not_null(MODULE_PAYMENT_INSTALLED)) && (!isset ($_SESSION['payment'])) && ($order->info['total'] > 0)):

###################################################
/includes/modules/default.php
###################################################

4 mal die Zeilen suchen, die beginnen mit:

$listing_sql = "select

und dann wenige Zeilen darunter jeweils hinter der Zeile:

p.products_id,

in neuer Zeile hinzufgen:

p.free_shipping,


Diesen Vorgang mssen Sie in dieser Datei an allen 4 Vorkommen von $listing_sql = "select durchfhren!! Es kann auch SELECT sein!!


###################################################
/templates/.../module/shopping_cart.html
###################################################

die Zeile suchen:
{if $info_message!=''}
	<div class="headerInfo">{$info_message}</div><br />
{/if}

Danach einfgen:

{if $info_message_3!=''}
	<div class="headerInfo">{$info_message_3}</div><br />
{/if}



Falls Sie eine automatisierte Kennzeichnung von mengenlimitierten Produkten wnschen, ffnen Sie in Ihrem Template
die product_info  Vorlage und fgen an gewnschter Stelle ein:

{if $PRODUCTS_SHIPPING_NOTICE} {$PRODUCTS_SHIPPING_NOTICE} {if}


###################################################
/checkout_shipping.php
###################################################

Suche:

} else {
	$free_shipping = false;
}

Fge danach an:

// free shipping start - new code
// get all free products
$free_shipping_products_query = "SELECT products_id, max_free_shipping_amount FROM ".TABLE_PRODUCTS." WHERE free_shipping ='1';";
$free_shipping_products_query = xtDBquery($free_shipping_products_query);
$free_amount = true;
$free_contents = 0;

while ($free_shipping_products = xtc_db_fetch_array($free_shipping_products_query)){
  // check if product is in cart
  $products_id_fs = $_SESSION['cart']->in_cart_fs($free_shipping_products['products_id']);
  if ($products_id_fs){
    // if in_cart -> get ammount of this product in_cart and add it to the free-products counter
    $free_contents += $_SESSION['cart']->get_quantity_fs($products_id_fs);

    // check if ammount of product is free
    if (($free_shipping_products['max_free_shipping_amount'] >0)&&($_SESSION['cart']->get_quantity_fs($products_id_fs) > $free_shipping_products['max_free_shipping_amount'])){
    $free_amount = false;
    }
  }
}

// decide if shipping is free
if (($free_contents > 0) && ($free_contents == $_SESSION['cart']->count_contents()) && ($free_amount == true)){
  $free_shipping = true;
}

// free shipping - end of code


###################################################
/shopping_cart.php
###################################################

Suche:

include (DIR_WS_MODULES.'cart_specials.php');

Fge DAVOR ein:


// free shipping start - new code
if ($_SESSION['MAXIMUM_CART_AMOUNT'] == true) {
echo 'treu';
	$smarty->assign('info_message_3', PRODUCT_MAXIMUM_AMOUNT_EXCEEDED);
	unset ($_SESSION['MAXIMUM_CART_AMOUNT']);
}
// free shipping - end of code


###################################################
/admin/includes/classes/categories.php
###################################################

Suche:

$sql_data_array = array('products_quantity' => xtc_db_prepare_input($products_data['products_quantity']), 

Fge danach ein:

								'free_shipping' => xtc_db_prepare_input($products_data['free_shipping']), 
								'max_free_shipping_cart' => xtc_db_prepare_input($products_data['max_free_shipping_cart']), 
								'max_free_shipping_amount' => xtc_db_prepare_input($products_data['max_free_shipping_amount']), 


###################################################
/admin/includes/modules/new_product.php
###################################################

Suche:

				<tr>
					<td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td>
					<td class="main"><?php echo xtc_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?></td>
				</tr>


Frge danach ein:

				<tr>
					<td class="main"><?php echo TEXT_PRODUCTS_FREE_SHIPPING.xtc_draw_selection_field('free_shipping', 'checkbox', '1',$pInfo->free_shipping==1 ? true : false); ?></td>
					<td class="main"><?php echo TEXT_PRODUCTS_MAX_FREE_SHIPPING_CART.xtc_draw_input_field('max_free_shipping_cart', $pInfo->max_free_shipping_cart, 'size=3'); ?></td>
				</tr>
				<tr>
					<td class="main"><?php echo TEXT_PRODUCTS_MAX_FREE_SHIPPING_AMOUNT.xtc_draw_input_field('max_free_shipping_amount', $pInfo->max_free_shipping_amount, 'size=3'); ?></td>
					<td>&nbsp;</td>
				</tr>



###################################################
/includes/classes/shopping_cart.php
###################################################

Suche:

require_once (DIR_FS_INC.'xtc_get_tax_description.inc.php');

Fge danach ein:

require_once (DIR_FS_INC.'check_allowed_amount.inc.php');


Suche:

$products_id = xtc_get_uprid($products_id, $attributes);

Fge danach ein:

$qty = check_allowed_amount($products_id, $qty);


Suche:

	// ------------------------ ICW CREDIT CLASS Gift Voucher Addittion-------------------------------End
	//GV Code End

Fge danach ein:

	// free shipping start - new code
	
	function in_cart_fs($p_id) {
    $product_id_list = ', ';
		if (is_array($this->contents)) {
			reset($this->contents);
			while (list ($products_id,) = each($this->contents)) {
				$product_id_list = ', '.$products_id.'{';
        $string_needle = ', '.$p_id.'{';
        if (substr_count($product_id_list, $string_needle) != '0'){
          return $products_id;
        }
			}
			return false;
		}   
  }
	
	
	
	function get_quantity_fs($p_id) {
	 if (is_array($this->contents)) {
		reset($this->contents);
    if (substr_count($p_id, '{') == '0'){
      return $this->get_quantity($p_id);
    } else {
      $p_quantity = 0;
      $p_root_id = substr($p_id, 0, strpos($p_id, '{')  );
      while (list ($products_id,) = each($this->contents)) {
				$product_id_list = ', '.$products_id.'{';
        $string_needle = ', '.$p_root_id.'{';
        if (substr_count($product_id_list, $string_needle) != '0'){
          $p_quantity += $this->get_quantity($products_id); 
        }
			}
      return $p_quantity;
    }
   }
  }

  // free shipping - end of code


###################################################
/includes/classes/checkout.php
###################################################

Suche:

return $free_shipping;

Fge DAVOR ein:



// free shipping start - new code
// get all free products
$free_shipping_products_query = "SELECT products_id, max_free_shipping_amount FROM ".TABLE_PRODUCTS." WHERE free_shipping ='1';";
$free_shipping_products_query = xtDBquery($free_shipping_products_query);
$free_amount = true;
$free_contents = 0;

while ($free_shipping_products = xtc_db_fetch_array($free_shipping_products_query)){
  // check if product is in cart
  $products_id_fs = $_SESSION['cart']->in_cart_fs($free_shipping_products['products_id']);
  if ($products_id_fs){
    // if in_cart -> get ammount of this product in_cart and add it to the free-products counter
    $free_contents += $_SESSION['cart']->get_quantity_fs($products_id_fs);

    // check if ammount of product is free
    if (($free_shipping_products['max_free_shipping_amount'] >0)&&($_SESSION['cart']->get_quantity_fs($products_id_fs) > $free_shipping_products['max_free_shipping_amount'])){
    $free_amount = false;
    }
  }
}

// decide if shipping is free
if (($free_contents > 0) && ($free_contents == $_SESSION['cart']->count_contents()) && ($free_amount == true)){
  $free_shipping = true;
}

// free shipping - end of code			






###################################################
/includes/modules/order_details_cart.php
###################################################

Suche:

if (SHOW_SHIPPING == 'true') {

DAVOR einfgen:

// free shipping start - new code
// get all free products
$free_shipping_products_query = "SELECT products_id, max_free_shipping_amount FROM ".TABLE_PRODUCTS." WHERE free_shipping ='1';";
$free_shipping_products_query = xtDBquery($free_shipping_products_query);
$free_contents = 0;
$free_amount = true;
$free_shipping_cart = false;

while ($free_shipping_products = xtc_db_fetch_array($free_shipping_products_query)){
  // check if product is in cart
  $products_id_fs = $_SESSION['cart']->in_cart_fs($free_shipping_products['products_id']);
  if ($products_id_fs){
    // if in_cart -> get ammount of this product in_cart and add it to the free-products counter
    $free_contents += $_SESSION['cart']->get_quantity_fs($products_id_fs);
    
    // check if ammount of product is free
    if (($free_shipping_products['max_free_shipping_amount'] >0)&&($_SESSION['cart']->get_quantity_fs($products_id_fs) > $free_shipping_products['max_free_shipping_amount'])){
    $free_amount = false;
    }
  }
}

// decide if shipping is free
if (($free_contents > 0) && ($free_contents == $_SESSION['cart']->count_contents()) && ($free_amount == true)){
  $free_shipping_cart = true;
}
// free shipping - end of code






4. Fertig!
5. Anleitung:
Auf der Produktdetail-Seite im Admin-Bereich sind im Block oben rechts drei neue Optionen hinzugefgt:
- Produkt Versandkostenfrei
- Maximale Menge im Warenkorb
- Maximale versandkostenfreie Menge
ber diese Einstellungen knnen Sie das Verhalten Ihrer versandkostenfreien Artikel steuern.
Um einen Artikel als versandkostenfrei zu deklarieren, muss das entsprechende Feld aktiviert sein. Darberhinaus
knnen Sie die Menge dieses Produktes begrenzen, so da ein Kunde z.B. Ihren Gratis-Katalog gleich nur einmal in den
Warenkorb legen kann. Alternativ knnen Sie auch die Menge dieses Produktes bestimmen, bis zu der dieses Produkt
versandkostenfrei bleibt. Bestellt ein Kunde mehr als die erlaubte Menge, werden wieder Versandkosten berechnet. Es
empfiehlt sich, die Kunden hierrber im Produkttext hinzuweisen, da ein automatischer Hinweis nicht erfolgt.