Index: Z:/home/jshop/INSTALL/pack/jshopping.xml
===================================================================
--- Z:/home/jshop/INSTALL/pack/jshopping.xml	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/jshopping.xml	(revision 20)
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <extension type="component" version="1.7.0" method="new">
    <name>jshopping</name>
-   <creationDate>12.10.2012</creationDate>
+   <creationDate>23.11.2012</creationDate>
    <author>MAXXmarketing GmbH</author>
    <authorEmail>marketing@maxx-marketing.net</authorEmail>
    <authorUrl>http://www.webdesigner-profi.de</authorUrl>
    <copyright></copyright>
    <license>Open Source License, GNU GPL</license>
-   <version>3.11.4</version>
+   <version>3.12.0</version>
    <description>Joomshopping - shop component. Note: JoomShopping code files are named as jshopping</description>
 
    <installfile>install/install.php</installfile>
Index: Z:/home/jshop/INSTALL/pack/site/metadata.xml
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/metadata.xml	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/metadata.xml	(revision 20)
@@ -47,6 +47,7 @@
                 <option value="agb">Terms of Service</option>
                 <option value="return_policy">Return policy</option>
                 <option value="shipping">Shipping</option>
+                <option value="privacy_statement">Privacy statement</option>
             </field>
             <field name="price_from" type="text" default="" label="Price from" description="Price from" />
             <field name="price_to" type="text" default="" label="Price to" description="Price to" />
Index: Z:/home/jshop/INSTALL/pack/site/lang/ru-RU.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/lang/ru-RU.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/lang/ru-RU.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.0 22.01.2012
+* @version      3.12.0 22.01.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -446,5 +446,8 @@
 define('_JSHOP_BILL_ADDRESS', 'Адрес счета');
 define('_JSHOP_ZOOM_IMAGE', 'Увеличить изображение');
 define('_JSHOP_INVOICE_DATE','Дата счета-фактуры');
+define('_JSHOP_PRIVACY_STATEMENT','Заявление о конфиденциальности');
+define('_JSHOP_PACKAGE_PRICE','Стоимость упаковки');
+define('_JSHOP_DELIVERY_DATE','Дата поставки');
  
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/site/lang/de-DE.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/lang/de-DE.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/lang/de-DE.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.0 01.05.2012
+* @version      3.12.0 01.05.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -439,5 +439,8 @@
 define('_JSHOP_BILL_ADDRESS', 'Rechnungsadresse');
 define('_JSHOP_ZOOM_IMAGE', 'Großansicht öffnen');
 define('_JSHOP_INVOICE_DATE','Rechnungs-Datum');
+define('_JSHOP_PRIVACY_STATEMENT','"Datenschutzerklärung akzeptieren');
+define('_JSHOP_PACKAGE_PRICE','Verpackungskosten');
+define('_JSHOP_DELIVERY_DATE','Lieferdatum');
 
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/site/lang/en-GB.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/lang/en-GB.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/lang/en-GB.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.0 22.01.2012
+* @version      3.12.0 22.01.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -438,5 +438,8 @@
 define('_JSHOP_BILL_ADDRESS', 'Billing address');
 define('_JSHOP_ZOOM_IMAGE', 'Zoom image');
 define('_JSHOP_INVOICE_DATE','Invoice Date');
+define('_JSHOP_PRIVACY_STATEMENT','Privacy Statement');
+define('_JSHOP_PACKAGE_PRICE','Package price');
+define('_JSHOP_DELIVERY_DATE','Delivery date');
 
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/site/models/cart.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/models/cart.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/models/cart.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.9.1 20.08.2012
+* @version      3.12.0 10.11.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -29,7 +29,7 @@
         $session = JFactory::getSession();
         $objcart = $session->get($this->type_cart);
 
-        if (isset($objcart) && $objcart!='') {
+        if (isset($objcart) && $objcart!=''){
             $temp_cart = unserialize($objcart);
             $this->products = $temp_cart->products;
             $this->rabatt_id = $temp_cart->rabatt_id;
@@ -38,7 +38,7 @@
             $this->rabatt_summ = $temp_cart->rabatt_summ;
         }
         
-        if(isset($_COOKIE['jshopping_temp_cart']) && $this->type_cart=='wishlist' && !count($this->products)) {
+        if (isset($_COOKIE['jshopping_temp_cart']) && $this->type_cart=='wishlist' && !count($this->products)){
             $_tempcart = JModel::getInstance('tempcart', 'jshop');
             $products = $_tempcart->getTempCart($_COOKIE['jshopping_temp_cart'], $this->type_cart);
             if (count($products)){
@@ -55,7 +55,7 @@
         
         JPluginHelper::importPlugin('jshoppingcheckout');
         $dispatcher = JDispatcher::getInstance();
-        $dispatcher->trigger( 'onAfterCartLoad', array(&$this) );
+        $dispatcher->trigger('onAfterCartLoad', array(&$this));
     }
 
     function loadPriceAndCountProducts(){
@@ -63,8 +63,8 @@
         $this->price_product = 0;
         $this->price_product_brutto = 0;
         $this->count_product = 0;
-        if(count($this->products)) {
-            foreach ($this->products as $prod) {
+        if (count($this->products)){
+            foreach($this->products as $prod){
                 $this->price_product += $prod['price'] * $prod['quantity'];
                 if ($jshopConfig->display_price_front_current==1){
                     $this->price_product_brutto += ($prod['price']*(1+$prod['tax']/100)) * $prod['quantity'];
@@ -89,7 +89,7 @@
     }
 
     function updateTaxForProducts(){
-        if(count($this->products)) {
+        if (count($this->products)){
             $taxes = JSFactory::getAllTaxes();
             foreach ($this->products as $k=>$prod) {
                 $this->products[$k]['tax'] = $taxes[$prod['tax_id']];
@@ -113,8 +113,8 @@
         }
 
         if ($incShiping){
-            $price_shipping = $this->getShippingPrice();
-            $this->summ = $this->summ + $price_shipping;
+            $this->summ = $this->summ + $this->getShippingPrice();
+            $this->summ = $this->summ + $this->getPackagePrice();
         }
         
         if ($incPayment){
@@ -126,7 +126,7 @@
             $this->summ = $this->summ - $this->getDiscountShow();
             if ($this->summ < 0) $this->summ = 0;
         }
-        
+
         return $this->summ;
     }
 
@@ -148,36 +148,42 @@
         }
     }    
 
-    function getTax( $incShiping = 0, $incRabatt = 0, $incPayment = 0){
+    function getTax($incShiping = 0, $incRabatt = 0, $incPayment = 0){
         $taxes = $this->getTaxExt($incShiping, $incRabatt, $incPayment);
-        $tax_summ = array_sum($taxes);        
+        $tax_summ = array_sum($taxes);
     return $tax_summ;
     }
 
-    /**
-    * get cart tax    
-    * @param mixed $incShiping - include price shipping
-    * @param mixed $incRabatt - not used
-    * @param mixed $incPayment - include price payment
-    */
-    function getTaxExt( $incShiping = 0, $incRabatt = 0, $incPayment = 0) {
+    function getTaxExt($incShiping = 0, $incRabatt = 0, $incPayment = 0){
         $jshopConfig = JSFactory::getConfig();
         $tax_summ = array();
-        foreach ($this->products as $key => $value) {
+        foreach($this->products as $key=>$value){
             if ($value['tax']!=0){
                 $tax_summ[$value['tax']] += $value['quantity'] * getPriceTaxValue($value['price'], $value['tax'], $jshopConfig->display_price_front_current);                
             }
         }
 
         if ($incShiping){
-            if ($this->getShippingPriceTaxPercent()!=0 && $this->getShippingPriceTax()!=0){
-                $tax_summ[$this->getShippingPriceTaxPercent()] += $this->getShippingPriceTax();
+            $lst = $this->getShippingTaxList();
+            foreach($lst as $tax=>$value){
+                if ($tax!=0 && $value!=0){
+                    $tax_summ[$tax] += $value;
+                }
             }
+            $lst = $this->getPackageTaxList();
+            foreach($lst as $tax=>$value){
+                if ($tax!=0 && $value!=0){
+                    $tax_summ[$tax] += $value;
+                }
+            }
         }
 
         if ($incPayment){
-            if ($this->getPaymentTaxPercent()!=0 && $this->getPaymentTax()!=0){
-                $tax_summ[$this->getPaymentTaxPercent()] += $this->getPaymentTax();
+            $lpt = $this->getPaymentTaxList();
+            foreach($lpt as $tax=>$value){
+                if ($tax!=0 && $value!=0){
+                    $tax_summ[$tax] += $value;
+                }
             }
         }
         
@@ -190,29 +196,38 @@
 
     function getTaxExtCalcAfterDiscount($incShiping = 0, $incPayment = 0){
         $jshopConfig = JSFactory::getConfig();
-        
         $summ = array();
-
-        foreach ($this->products as $key => $value) {
+        foreach($this->products as $key=>$value){
             $summ[$value['tax']] += $value['quantity'] * $value['price'];
         }
 
         if ($jshopConfig->discount_use_full_sum){
             if ($incShiping && $this->display_item_shipping){
-                if ($this->getShippingPriceTaxPercent()!=0 && $this->getShippingPrice()!=0){
-                    $summ[$this->getShippingPriceTaxPercent()] += $this->getShippingPrice(); 
+                $lspt = $this->getShippingPriceForTaxes();
+                foreach($lspt as $tax=>$value){
+                    if ($tax!=0 && $value!=0){
+                        $summ[$tax] += $value;
+                    }
                 }
+                $lspt = $this->getPackagePriceForTaxes();
+                foreach($lspt as $tax=>$value){
+                    if ($tax!=0 && $value!=0){
+                        $summ[$tax] += $value;
+                    }
+                }
             }
             
             if ($incPayment && $this->display_item_payment){
-                if ($this->getPaymentTaxPercent()!=0 && $this->getPaymentPrice()!=0){
-                    $summ[$this->getPaymentTaxPercent()] += $this->getPaymentPrice(); 
+                $lppt = $this->getPaymentPriceForTaxes();
+                foreach($lppt as $tax=>$value){
+                    if ($tax!=0 && $value!=0){
+                        $summ[$tax] += $value;
+                    }
                 }
             }
         }
 
         $allsum = array_sum($summ);
-
         $discountsum = $this->getDiscountShow();
 
         $calc_taxes = array();
@@ -229,18 +244,30 @@
 
         if (!$jshopConfig->discount_use_full_sum){
             if ($incShiping && $this->display_item_shipping){
-                if ($this->getShippingPriceTaxPercent()!=0 && $this->getShippingPriceTax()!=0){
-                    $calc_taxes[$this->getShippingPriceTaxPercent()] += $this->getShippingPriceTax();
+                $lst = $this->getShippingTaxList();
+                foreach($lst as $tax=>$value){
+                    if ($tax!=0 && $value!=0){
+                        $calc_taxes[$tax] += $value;
+                    }
                 }
+                $lst = $this->getPackageTaxList();
+                foreach($lst as $tax=>$value){
+                    if ($tax!=0 && $value!=0){
+                        $calc_taxes[$tax] += $value;
+                    }
+                }
             }
 
             if ($incPayment && $this->display_item_payment){
-                if ($this->getPaymentTaxPercent()!=0 && $this->getPaymentTax()!=0){
-                    $calc_taxes[$this->getPaymentTaxPercent()] += $this->getPaymentTax();
+                $lpt = $this->getPaymentTaxList();
+                foreach($lpt as $tax=>$value){
+                    if ($tax!=0 && $value!=0){
+                        $calc_taxes[$tax] += $value;
+                    }
                 }
             }
         }
-        
+
         return $calc_taxes;
     }
 
@@ -274,6 +301,17 @@
         $this->display_item_shipping = $shipping;
         $this->display_item_payment = $payment;
     }
+    
+    function setShippingsDatas($prices, $shipping_method_price){
+        $this->setShippingPrice($prices['shipping']);
+        $this->setShippingTaxId($shipping_method_price->shipping_tax_id);
+        $this->setShippingTaxList($shipping_method_price->calculateShippingTaxList($prices['shipping'], $this));
+        $this->setShippingPriceForTaxes($shipping_method_price->getShipingPriceForTaxes($prices['shipping'], $this));
+        $this->setPackagePrice($prices['package']);
+        $this->setPackageTaxId($shipping_method_price->package_tax_id);
+        $this->setPackageTaxList($shipping_method_price->calculatePackageTaxList($prices['package'], $this));
+        $this->setPackagePriceForTaxes($shipping_method_price->getPackegePriceForTaxes($prices['package'], $this));
+    }
 
     function setShippingId($val){
         $session = JFactory::getSession();
@@ -291,21 +329,31 @@
     }
 
     function getShippingPrId() {
-        $session = JFactory::getSession();        
+        $session = JFactory::getSession();
         return $session->get("sh_pr_method_id");
     }
 
     function setShippingPrice($price){
-        $session = JFactory::getSession();        
+        $session = JFactory::getSession();
         $session->set("jshop_price_shipping", $price);
     }
-
     function getShippingPrice() {
         $session = JFactory::getSession();
         $price = $session->get("jshop_price_shipping");
         return floatval($price);
     }
+    
+    function setPackagePrice($price){
+        $session = JFactory::getSession();
+        $session->set("jshop_price_package", $price);
+    }
+    function getPackagePrice() {
+        $session = JFactory::getSession();
+        $price = $session->get("jshop_price_package");
+        return floatval($price);
+    }
 
+    //deprecated
     function setShippingPriceTax($price){
         $session = JFactory::getSession();
         $session->set("jshop_price_shipping_tax", $price);
@@ -317,33 +365,117 @@
         return floatval($price);
     }
 
+    //deprecated
     function setShippingPriceTaxPercent($price){
         $session = JFactory::getSession();
         $session->set("jshop_price_shipping_tax_percent", $price);
     }
 
-    function getShippingPriceTaxPercent() {
+    function getShippingPriceTaxPercent(){
+        $stl = $this->getShippingTaxList();
+        if (is_array($stl) && count($stl)==1){
+            $tmp = array_keys($stl);
+            return $tmp[0];
+        }else{
+            return 0;
+        }
+    }
+    
+    function setShippingTaxId($id){
         $session = JFactory::getSession();
-        return $session->get("jshop_price_shipping_tax_percent");
+        $session->set("jshop_price_shipping_tax_id", $id);
     }
+    function getShippingTaxId(){
+        $session = JFactory::getSession();
+        return $session->get("jshop_price_shipping_tax_id");
+    }
+    
+    function setPackageTaxId($id){
+        $session = JFactory::getSession();
+        $session->set("jshop_price_package_tax_id", $id);
+    }
+    function getPackageTaxId(){
+        $session = JFactory::getSession();
+        return $session->get("jshop_price_package_tax_id");
+    }
+    
+    function setShippingTaxList($list){
+        $session = JFactory::getSession();
+        $session->set("jshop_price_shipping_tax_list", $list);
+    }
+    function getShippingTaxList(){
+        $session = JFactory::getSession();
+        return $session->get("jshop_price_shipping_tax_list");
+    }
+    
+    function setPackageTaxList($list){
+        $session = JFactory::getSession();
+        $session->set("jshop_price_package_tax_list", $list);
+    }
+    function getPackageTaxList(){
+        $session = JFactory::getSession();
+        return $session->get("jshop_price_package_tax_list");
+    }
+    
+    function setShippingPriceForTaxes($list){
+        $session = JFactory::getSession();
+        $session->set("jshop_price_shipping_for_tax_list", $list);
+    }
+    function getShippingPriceForTaxes(){
+        $session = JFactory::getSession();
+        return $session->get("jshop_price_shipping_for_tax_list");
+    }
+    
+    function setPackagePriceForTaxes($list){
+        $session = JFactory::getSession();
+        $session->set("jshop_price_package_for_tax_list", $list);
+    }
+    function getPackagePriceForTaxes(){
+        $session = JFactory::getSession();
+        return $session->get("jshop_price_package_for_tax_list");
+    }
 
     function getShippingNettoPrice(){
         $jshopConfig = JSFactory::getConfig();
         if ($jshopConfig->display_price_front_current==1){
-            return $this->getShippingPrice() / (1 + $this->getShippingPriceTaxPercent() / 100);
+            return $this->getShippingPrice();
         }else{
-            return $this->getShippingPrice();
+            $price = $this->getShippingPrice();
+            $lst = $this->getShippingTaxList();
+            foreach($lst as $tax=>$value){
+                $price -= $value;
+            }
+            return $price;
         }
     }
 
     function getShippingBruttoPrice(){
         $jshopConfig = JSFactory::getConfig();
         if ($jshopConfig->display_price_front_current==1){
-            return $this->getShippingPrice() * (1 + ($this->getShippingPriceTaxPercent()/100) );
+            $price = $this->getShippingPrice();
+            $lst = $this->getShippingTaxList();
+            foreach($lst as $tax=>$value){
+                $price += $value;
+            }
+            return $price;
         }else{
             return $this->getShippingPrice();
         }
     }
+    
+    function getPackageBruttoPrice(){
+        $jshopConfig = JSFactory::getConfig();
+        if ($jshopConfig->display_price_front_current==1){
+            $price = $this->getPackagePrice();
+            $lst = $this->getPackageTaxList();
+            foreach($lst as $tax=>$value){
+                $price += $value;
+            }
+            return $price;
+        }else{
+            return $this->getPackagePrice();
+        }
+    }
 
     function setPaymentId($val){
         $session = JFactory::getSession();
@@ -365,36 +497,72 @@
         $price = $session->get("jshop_payment_price");
         return floatval($price);   
     }
+    
+    function setPaymentDatas($price, $payment){
+        $this->setPaymentPrice($price);
+        $this->setPaymentTaxList($payment->calculateTaxList($price));
+        $this->setPaymentPriceForTaxes($payment->getPriceForTaxes($price));
+    }
 
     function getPaymentBruttoPrice(){
         $jshopConfig = JSFactory::getConfig();
         if ($jshopConfig->display_price_front_current==1){
-            return $this->getPaymentPrice() * (1 + ($this->getPaymentTaxPercent()/100) );
+            $price = $this->getPaymentPrice();
+            $lpt = $this->getPaymentTaxList();
+            foreach($lpt as $tax=>$value){
+                $price += $value;
+            }
+            return $price;
         }else{
             return $this->getPaymentPrice();
         }
+        
     }
-
+    
+    function setPaymentTaxList($list){
+        $session = JFactory::getSession();
+        $session->set("jshop_price_payment_tax_list", $list);
+    }
+    function getPaymentTaxList(){
+        $session = JFactory::getSession();
+        return $session->get("jshop_price_payment_tax_list");
+    }
+    
+    function setPaymentPriceForTaxes($list){
+        $session = JFactory::getSession();
+        $session->set("jshop_price_payment_for_tax_list", $list);
+    }
+    function getPaymentPriceForTaxes(){
+        $session = JFactory::getSession();
+        return $session->get("jshop_price_payment_for_tax_list");
+    }
+    
+    //deprecated
     function setPaymentTax($val){
         $session = JFactory::getSession();
         $session->set("jshop_payment_tax", $val);
     }
-
+    
     function getPaymentTax(){
         $session = JFactory::getSession();
         $price = $session->get("jshop_payment_tax");
         return $price;
     }
-
+    
+    //deprecated
     function setPaymentTaxPercent($val){
         $session = JFactory::getSession();
         $session->set("jshop_payment_tax_percent", $val);
     }
 
     function getPaymentTaxPercent(){
-        $session = JFactory::getSession();
-        $price = $session->get("jshop_payment_tax_percent");
-        return $price;
+        $ptl = $this->getPaymentTaxList();
+        if (is_array($ptl) && count($ptl)==1){
+            $tmp = array_keys($ptl);
+            return $tmp[0];
+        }else{
+            return 0;
+        }
     }
 
     function setPaymentParams($val){
@@ -411,6 +579,15 @@
     function getCouponId(){
         return $this->rabatt_id;
     }
+    
+    function setDeliveryDate($date){
+        $session = JFactory::getSession();
+        $session->set("jshop_delivery_date", $date);
+    }
+    function getDeliveryDate(){
+        $session = JFactory::getSession();
+    return $session->get("jshop_delivery_date");
+    }
 
     function updateCartProductPrice() {
         foreach($this->products as $key=>$value) {
@@ -561,11 +738,13 @@
             $temp_product['pid_check_qty_value'] = $pidCheckQtyValue;
             $i = 0;
             if (is_array($attr_id) && count($attr_id)){
-                foreach ($attr_id as $key => $value){
+                foreach($attr_id as $key=>$value){
                     $attr = JTable::getInstance('attribut', 'jshop');
                     $attr_v = JTable::getInstance('attributvalue', 'jshop');
+                    $temp_product['attributes_value'][$i] = new stdClass();
                     $temp_product['attributes_value'][$i]->attr = $attr->getName($key);
-                    $temp_product['attributes_value'][$i++]->value = $attr_v->getName($value);
+                    $temp_product['attributes_value'][$i]->value = $attr_v->getName($value);
+                    $i++;
                 }
             }
             
@@ -574,7 +753,7 @@
                 $temp_product['extra_fields'] = $extra_field;
             }
 
-            $dispatcher->trigger( 'onBeforeSaveNewProductToCart', array(&$this, &$temp_product, &$product) );
+            $dispatcher->trigger('onBeforeSaveNewProductToCart', array(&$this, &$temp_product, &$product) );
 
             $this->products[] = $temp_product;
         }
@@ -582,7 +761,7 @@
         $this->loadPriceAndCountProducts();
         $this->reloadRabatValue();
         $this->saveToSession();
-        $dispatcher->trigger( 'onAfterAddProductToCart', array(&$this, &$product_id, &$quantity, &$attr_id, &$freeattributes) );
+        $dispatcher->trigger('onAfterAddProductToCart', array(&$this, &$product_id, &$quantity, &$attr_id, &$freeattributes) );
         return 1;
     }
 
@@ -680,7 +859,7 @@
     return $check;
     }
 
-    function getWeightProducts() {
+    function getWeightProducts(){
         $weight_sum = 0;
         foreach ($this->products as $prod) {
             $weight_sum += $prod['weight'] * $prod['quantity'];
@@ -699,21 +878,24 @@
     function getSummForCalculePlusPayment(){
         $jshopConfig = JSFactory::getConfig();
         $sum = $this->getPriceBruttoProducts();
-        if ($this->display_item_shipping) $sum += $this->getShippingBruttoPrice();
+        if ($this->display_item_shipping){
+            $sum += $this->getShippingBruttoPrice();
+            $sum += $this->getPackageBruttoPrice();
+        }
         return $sum;
     }
     
     function getSummForCalculeDiscount(){
         $jshopConfig = JSFactory::getConfig();
-        
         $sum = $this->getPriceProducts();
-        
         if ($jshopConfig->discount_use_full_sum && $jshopConfig->display_price_front_current==1){
             $sum = $this->getPriceBruttoProducts();
         }
-        
         if ($jshopConfig->discount_use_full_sum){
-            if ($this->display_item_shipping) $sum += $this->getShippingBruttoPrice();
+            if ($this->display_item_shipping) {
+                $sum += $this->getShippingBruttoPrice();
+                $sum += $this->getPackageBruttoPrice();
+            }
             if ($this->display_item_payment) $sum += $this->getPaymentBruttoPrice();
         }
         return $sum;
@@ -721,8 +903,7 @@
     
     function reloadRabatValue(){
         $jshopConfig = JSFactory::getConfig();
-        
-        if($this->rabatt_type == 1) {
+        if ($this->rabatt_type == 1){
             $this->rabatt_summ = $this->rabatt_value * $jshopConfig->currency_value; //value
         } else {
             $this->rabatt_summ = $this->rabatt_value / 100 * $this->getSummForCalculeDiscount(); //percent
@@ -814,11 +995,24 @@
     return $delivery;
     }
     
+    function getDeliveryDaysProducts(){
+        $deliverytimes = JSFactory::getAllDeliveryTime();
+        $deliverytimesdays = JSFactory::getAllDeliveryTimeDays();
+        $day = 0;
+        foreach($this->products as $prod){
+            if ($prod['delivery_times_id']){
+                if ($deliverytimesdays[$prod['delivery_times_id']]>$day){
+                    $day = $deliverytimesdays[$prod['delivery_times_id']];
+                }
+            }
+        }
+    return $day;
+    }
+    
     function clear(){
         JPluginHelper::importPlugin('jshoppingcheckout');
         $dispatcher = JDispatcher::getInstance();
-        $dispatcher->trigger( 'onBeforeClearCart', array(&$this) );
-        
+        $dispatcher->trigger('onBeforeClearCart', array(&$this));
         $session = JFactory::getSession();
         $this->products = array();
         $this->rabatt = 0;
@@ -839,17 +1033,17 @@
     function delete($number_id){
         JPluginHelper::importPlugin('jshoppingcheckout');
         $dispatcher = JDispatcher::getInstance();
-        $dispatcher->trigger( 'onBeforeDeleteProductInCart', array(&$number_id, &$this) );
-        
+        $dispatcher->trigger('onBeforeDeleteProductInCart', array(&$number_id, &$this) );
+
         unset($this->products[$number_id]);
         $this->loadPriceAndCountProducts();
         $this->reloadRabatValue();
         $this->saveToSession();
-        
-        $dispatcher->trigger( 'onAfterDeleteProductInCart', array(&$number_id, &$this) );
+
+        $dispatcher->trigger('onAfterDeleteProductInCart', array(&$number_id, &$this) );
     }
 
-    function saveToSession() {
+    function saveToSession(){
         $session = JFactory::getSession();
         $session->set($this->type_cart, serialize($this));        
         $_tempcart = JModel::getInstance('tempcart', 'jshop');
Index: Z:/home/jshop/INSTALL/pack/site/models/checkout.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/models/checkout.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/models/checkout.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.0 17.04.2012
+* @version      3.12.0 17.04.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -31,7 +31,7 @@
         $order->order_date = strftime($jshopConfig->store_date_format, strtotime($order->order_date));
         $order->products = $order->getAllItems();
         $order->weight = $order->getWeightItems();
-        if ($jshopConfig->show_delivery_time){
+        if ($jshopConfig->show_delivery_time_checkout){
             $deliverytimes = JSFactory::getAllDeliveryTime();
             $order->order_delivery_time = $deliverytimes[$order->delivery_times_id];
             if ($order->order_delivery_time==""){
@@ -54,6 +54,11 @@
         $d_country->load($order->d_country);
         $field_country_name = $lang->get("name");
         $order->d_country = $d_country->$field_country_name;
+        if ($jshopConfig->show_delivery_date && !datenull($order->delivery_date)){
+            $order->delivery_date_f = formatdate($order->delivery_date);
+        }else{
+            $order->delivery_date_f = '';
+        }
         
         $order->title = $jshopConfig->arr['title'][$order->title];
         $order->d_title = $jshopConfig->arr['title'][$order->d_title];
@@ -72,11 +77,17 @@
         if ($pm_method->show_descr_in_email) $order->payment_description = $pm_method->$description;  else $order->payment_description = "";
 
         $statictext = JTable::getInstance("statictext","jshop");
-        $rowstatictext = $statictext->loadData("order_email_descr");        
+        $rowstatictext = $statictext->loadData("order_email_descr");
         $order_email_descr = $rowstatictext->text;
         $order_email_descr = str_replace("{name}",$order->f_name, $order_email_descr);
         $order_email_descr = str_replace("{family}",$order->l_name, $order_email_descr);
         $order_email_descr = str_replace("{email}",$order->email, $order_email_descr);
+		
+		$rowstatictext = $statictext->loadData("order_email_descr_end");
+        $order_email_descr_end = $rowstatictext->text;
+        $order_email_descr_end = str_replace("{name}",$order->f_name, $order_email_descr_end);
+        $order_email_descr_end = str_replace("{family}",$order->l_name, $order_email_descr_end);
+        $order_email_descr_end = str_replace("{email}",$order->email, $order_email_descr_end);
                 
         $text_total = _JSHOP_ENDTOTAL;
         if (($jshopConfig->show_tax_in_product || $jshopConfig->show_tax_product_in_cart) && (count($order->order_tax_list)>0)){
@@ -117,6 +128,7 @@
         $view->assign('config_fields', $config_fields);
         $view->assign('count_filed_delivery', $count_filed_delivery);
         $view->assign('order_email_descr', $order_email_descr);
+        $view->assign('order_email_descr_end', $order_email_descr_end);
         $view->assign('config', $jshopConfig);
         $view->assign('order', $order);
         $view->assign('products', $order->products);
Index: Z:/home/jshop/INSTALL/pack/site/jshopping.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/jshopping.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/jshopping.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.4 06.06.2012
+* @version      3.12.0 06.06.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -12,7 +12,6 @@
 jimport('joomla.application.component.model');
 JModel::addIncludePath(JPATH_COMPONENT.'/models');
 require_once(JPATH_COMPONENT_SITE."/lib/factory.php");
-require_once(JPATH_COMPONENT_SITE.'/lib/functions.php');
 require("loadparams.php");
 
 $controller = JRequest::getCmd('controller');
Index: Z:/home/jshop/INSTALL/pack/site/templates/default/product/commentemail.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/templates/default/product/commentemail.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/templates/default/product/commentemail.php	(revision 20)
@@ -3,5 +3,5 @@
 <?php print _JSHOP_REVIEW_USER_EMAIL?>: <?php print $this->user_email;?><br/>
 <?php print _JSHOP_REVIEW_MARK_PRODUCT?>: <?php print $this->mark;?><br/>
 <?php print _JSHOP_COMMENT?>:<br/>
-<?php print $this->review;?>
+<?php print nl2br($this->review)?>
 
Index: Z:/home/jshop/INSTALL/pack/site/templates/default/product/review.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/templates/default/product/review.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/templates/default/product/review.php	(revision 20)
@@ -3,7 +3,7 @@
     <?php foreach($this->reviews as $curr){?>
         <div class="review_item">
         <div><span class="review_user"><?php print $curr->user_name?></span>, <span class='review_time'><?php print formatdate($curr->time);?></span></div>
-        <div class="review_text"><?php print $curr->review?></div>
+        <div class="review_text"><?php print nl2br($curr->review)?></div>
         <?php if ($curr->mark) {?>
             <div class="review_mark"><?php print showMarkStar($curr->mark);?></div>
         <?php } ?> 
Index: Z:/home/jshop/INSTALL/pack/site/templates/default/product/product_default.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/templates/default/product/product_default.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/templates/default/product/product_default.php	(revision 20)
@@ -40,7 +40,7 @@
             <a class="lightbox" id="main_image_full_<?php print $image->image_id?>" href="<?php print $this->image_product_path?>/<?php print $image->image_full;?>" <?php if ($k!=0){?>style="display:none"<?php }?>>
                 <img id = "main_image_<?php print $image->image_id?>" src = "<?php print $this->image_product_path?>/<?php print $image->image_name;?>" alt="<?php print htmlspecialchars($image->_title)?>" title="<?php print htmlspecialchars($image->_title)?>" />
                 <div class="text_zoom">
-                    <img src="<?php print $this->path_to_image?>/search.png" alt="zoom" /> <?php print _JSHOP_ZOOM_IMAGE?>
+                    <img src="<?php print $this->path_to_image?>search.png" alt="zoom" /> <?php print _JSHOP_ZOOM_IMAGE?>
                 </div>
             </a>
             <?php }?>
Index: Z:/home/jshop/INSTALL/pack/site/templates/default/checkout/adress.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/templates/default/checkout/adress.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/templates/default/checkout/adress.php	(revision 20)
@@ -424,6 +424,24 @@
         <?php echo $this->_tmpl_address_html_7?>
     </table>
     </div>
+    <?php if ($config_fields['privacy_statement']['display']){?>
+    <div class="jshop_register">
+    <div class="jshop_block_privacy_statement">    
+    <table>
+        <tr>
+          <td class="name">
+            <a class="privacy_statement" href="#" onclick="window.open('<?php print SEFLink('index.php?option=com_jshopping&controller=content&task=view&page=privacy_statement&tmpl=component', 1);?>','window','width=800, height=600, scrollbars=yes, status=no, toolbar=no, menubar=no, resizable=yes, location=no');return false;">
+            <?php print _JSHOP_PRIVACY_STATEMENT?> <?php if ($config_fields['privacy_statement']['require']){?><span>*</span><?php } ?>
+            </a>            
+          </td>
+          <td>
+            <input type="checkbox" name="privacy_statement" id="privacy_statement" value="1" />
+          </td>
+        </tr>
+        </table>
+    </div>
+    </div>
+    <?php } ?>    
     <?php print $this->_tmp_ext_html_address_end?>
     
     <div style="padding-top:10px;">
Index: Z:/home/jshop/INSTALL/pack/site/templates/default/checkout/previewfinish.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/templates/default/checkout/previewfinish.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/templates/default/checkout/previewfinish.php	(revision 20)
@@ -38,6 +38,9 @@
        <?php if ($this->delivery_time){?>
        <div class="delivery_time"><strong><?php print _JSHOP_DELIVERY_TIME?></strong>: <?php print $this->delivery_time?></div>
        <?php }?>
+       <?php if ($this->delivery_date){?>
+       <div class="delivery_date"><strong><?php print _JSHOP_DELIVERY_DATE?></strong>: <?php print $this->delivery_date?></div>
+       <?php }?>
     </td>
   </tr>
 <?php } ?>
Index: Z:/home/jshop/INSTALL/pack/site/templates/default/checkout/orderemail.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/templates/default/checkout/orderemail.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/templates/default/checkout/orderemail.php	(revision 20)
@@ -438,6 +438,12 @@
            <td class="price"><?php print formatprice($this->order->order_shipping, $order->currency_code); ?><?php print $this->_tmp_ext_shipping?></td>
          </tr>
          <?php } ?>
+         <?php if (!$this->config->without_shipping && ($order->order_package>0 || $this->config->display_null_package_price)){?>
+         <tr>
+           <td colspan="4" align="right" style="padding-right:15px;"><?php print _JSHOP_PACKAGE_PRICE?>:</td>
+           <td class="price"><?php print formatprice($this->order->order_package, $order->currency_code); ?><?php print $this->_tmp_ext_shipping_package?></td>
+         </tr>
+         <?php } ?>
          <?php if ($this->order->order_payment != 0){?>
          <tr>
            <td colspan="4" align="right" style="padding-right:15px;"><?php print $this->order->payment_name;?>:</td>
@@ -503,8 +509,11 @@
         <?php 
         if (!$this->config->without_shipping){
             print nl2br($this->order->shipping_information);
-            if ($this->config->show_delivery_time && $this->order->order_delivery_time){
+            if ($this->config->show_delivery_time_checkout && $this->order->order_delivery_time){
                 print "<div>"._JSHOP_ORDER_DELIVERY_TIME.": ".$this->order->order_delivery_time."</div>";
+            }            
+            if ($this->config->show_delivery_date && $order->delivery_date_f){
+                print "<div>"._JSHOP_DELIVERY_DATE.": ".$order->delivery_date_f."</div>";
             }
         }
         ?>
@@ -517,6 +526,13 @@
     <td colspan="2"><br/><br/><a class = "policy" target="_blank" href="<?php print $this->liveurlhost.SEFLink('index.php?option=com_jshopping&controller=content&task=view&page=return_policy&tmpl=component', 1);?>"><?php print _JSHOP_RETURN_POLICY?></a></td>
   </tr>
   <?php }?>
+  <?php if ($this->client){?>
+  <tr>
+     <td colspan = "2" style="padding-bottom:10px;">
+       <?php print $this->order_email_descr_end;?>
+     </td>
+  </tr>
+  <?php }?>
 </table>
 <?php print $this->_tmp_ext_html_ordermail_end?> 
 <br>    
Index: Z:/home/jshop/INSTALL/pack/site/templates/default/checkout/shippings.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/templates/default/checkout/shippings.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/templates/default/checkout/shippings.php	(revision 20)
@@ -37,6 +37,9 @@
       <?php if ($shipping->delivery){?>
       <div class="shipping_delivery"><?php print _JSHOP_DELIVERY_TIME.": ".$shipping->delivery?></div>
       <?php }?>
+      <?php if ($shipping->delivery_date_f){?>
+      <div class="shipping_delivery_date"><?php print _JSHOP_DELIVERY_DATE.": ".$shipping->delivery_date_f?></div>
+      <?php }?>      
       </td>
   </tr>
 <?php } ?>
Index: Z:/home/jshop/INSTALL/pack/site/templates/default/search/characteristics.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/templates/default/search/characteristics.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/templates/default/search/characteristics.php	(revision 20)
@@ -4,6 +4,7 @@
 $characteristic_fieldvalues = $this->characteristic_fieldvalues;
 $groupname = "";
 ?>
+<?php print $this->tmp_ext_search_html_characteristic_start;?>
 <?php if (is_array($characteristic_displayfields) && count($characteristic_displayfields)){?>
     <div class="filter_characteristic">
     <?php foreach($characteristic_displayfields as $ch_id){?>
@@ -23,4 +24,5 @@
         <?php }?>
     <?php }?>
     </div>
-<?php } ?>
\ No newline at end of file
+<?php } ?>
+<?php print $this->tmp_ext_search_html_characteristic_end;?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/site/templates/default/search/form.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/templates/default/search/form.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/templates/default/search/form.php	(revision 20)
@@ -5,7 +5,7 @@
     <form action="<?php print $this->action?>" name="form_ad_search" method="post" onsubmit="return validateFormAdvancedSearch('form_ad_search')">
     <input type="hidden" name="setsearchdata" value="1">
     <table class = "jshop" cellpadding = "6" cellspacing="0">
-      <?php print $this->_tmp_ext_search_html_start;?>  
+      <?php print $this->_tmp_ext_search_html_start;?>
       <tr>
   	    <td width="120">
   		    <?php print _JSHOP_SEARCH_TEXT?>
Index: Z:/home/jshop/INSTALL/pack/site/templates/default/cart/checkout.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/templates/default/cart/checkout.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/templates/default/cart/checkout.php	(revision 20)
@@ -93,7 +93,7 @@
     </td>
   </tr>
   <?php } ?>
-  <?php if (isset($this->summ_delivery)){ ?>
+  <?php if (isset($this->summ_delivery)){?>
   <tr>
     <td class = "name">
          <?php print _JSHOP_SHIPPING_PRICE;?>
@@ -103,6 +103,16 @@
     </td>
   </tr>
   <?php } ?>
+  <?php if (isset($this->summ_package)){?>
+  <tr>
+    <td class = "name">
+         <?php print _JSHOP_PACKAGE_PRICE;?>
+    </td>
+    <td class = "value">
+      <?php print formatprice($this->summ_package);?><?php print $this->_tmp_ext_shipping_package?>
+    </td>
+  </tr>
+  <?php } ?>
   <?php if ($this->summ_payment != 0){ ?>
   <tr>
     <td class = "name">
Index: Z:/home/jshop/INSTALL/pack/site/templates/default/order/order.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/templates/default/order/order.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/templates/default/order/order.php	(revision 20)
@@ -369,6 +369,12 @@
     </td>
   </tr>
   <?php } ?>
+  <?php if (!$this->config->without_shipping && ($order->order_package>0 || $this->config->display_null_package_price)){?>
+  <tr>
+    <td class="name"><?php print _JSHOP_PACKAGE_PRICE?></td>
+    <td class="value"><?php print formatprice($order->order_package, $order->currency_code); ?><?php print $this->_tmp_ext_shipping_package?></td>
+  </tr>
+ <?php } ?>
   <?php if ($this->order->order_payment > 0){?>
   <tr>
     <td class = "name">
@@ -407,8 +413,11 @@
     <div><b><?php print _JSHOP_SHIPPING_INFORMATION ?></b></div>
     <div><?php print nl2br($order->shipping_info);?></div>
     <?php if ($order->delivery_time_name){?>
-        <div><?php echo _JSHOP_DELIVERY_TIME.": ".$order->delivery_time_name?></div>
+        <div class="delivery_time"><?php echo _JSHOP_DELIVERY_TIME.": ".$order->delivery_time_name?></div>
     <?php }?>
+    <?php if ($order->delivery_date_f){?>
+        <div class="delivery_date"><?php echo _JSHOP_DELIVERY_DATE.": ".$order->delivery_date_f?></div>
+    <?php }?>
     <br/>
 <?php }?>
 <?php if (!$this->config->without_payment){?>
Index: Z:/home/jshop/INSTALL/pack/site/templates/default/user/editaccount.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/templates/default/user/editaccount.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/templates/default/user/editaccount.php	(revision 20)
@@ -443,6 +443,25 @@
     </table>
     </div>
     
+    <?php if ($config_fields['privacy_statement']['display']){?>
+    <div class="jshop_register">
+    <div class="jshop_block_privacy_statement">    
+    <table>
+        <tr>
+          <td class="name">
+            <a class="privacy_statement" href="#" onclick="window.open('<?php print SEFLink('index.php?option=com_jshopping&controller=content&task=view&page=privacy_statement&tmpl=component', 1);?>','window','width=800, height=600, scrollbars=yes, status=no, toolbar=no, menubar=no, resizable=yes, location=no');return false;">
+            <?php print _JSHOP_PRIVACY_STATEMENT?> <?php if ($config_fields['privacy_statement']['require']){?><span>*</span><?php } ?>
+            </a>            
+          </td>
+          <td>
+            <input type="checkbox" name="privacy_statement" id="privacy_statement" value="1" />
+          </td>
+        </tr>
+    </table>
+    </div>
+    </div>
+    <?php } ?>
+    
     <div style="padding-top:10px;">
         <?php echo $this->_tmpl_editaccount_html_7?>
         <div class="requiredtext">* <?php print _JSHOP_REQUIRED?></div>
Index: Z:/home/jshop/INSTALL/pack/site/templates/default/user/myaccount.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/templates/default/user/myaccount.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/templates/default/user/myaccount.php	(revision 20)
@@ -1,7 +1,7 @@
 <?php $config_fields = $this->config_fields;?>
 <div class="jshop">
     <h1><?php print _JSHOP_MY_ACCOUNT?></h1>
-    
+    <?php echo $this->tmpl_my_account_html_start?>
     <div class="jshop_profile_data">        
         <?php if ($config_fields['f_name']['display'] || $config_fields['l_name']['display']){?>
         <div class="name"><?php print $this->user->f_name." ".$this->user->l_name;?></div>
@@ -41,10 +41,12 @@
             <a href =  "<?php print $this->href_show_orders?>"><?php print _JSHOP_SHOW_ORDERS ?></a>
         </td> 
     </tr>
+	<?php echo $this->tmpl_my_account_html_content?>
     <tr>
         <td>
             <a href =  "<?php print $this->href_logout?>"><?php print _JSHOP_LOGOUT ?></a>
         </td> 
     </tr>
     </table>
+	<?php echo $this->tmpl_my_account_html_end?>
 </div>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/site/templates/default/user/register.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/templates/default/user/register.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/templates/default/user/register.php	(revision 20)
@@ -278,6 +278,18 @@
           </td>
         </tr>
         <?php } ?>
+        <?php if ($config_fields['privacy_statement']['display']){?>
+        <tr>
+          <td class="name">
+            <a class="privacy_statement" href="#" onclick="window.open('<?php print SEFLink('index.php?option=com_jshopping&controller=content&task=view&page=privacy_statement&tmpl=component', 1);?>','window','width=800, height=600, scrollbars=yes, status=no, toolbar=no, menubar=no, resizable=yes, location=no');return false;">
+            <?php print _JSHOP_PRIVACY_STATEMENT?> <?php if ($config_fields['privacy_statement']['require']){?><span>*</span><?php } ?>
+            </a>            
+          </td>
+          <td>
+            <input type="checkbox" name="privacy_statement" id="privacy_statement" value="1" />
+          </td>
+        </tr>
+        <?php } ?>        
       </table>
     </div>
     <?php echo $this->_tmpl_register_html_5?>
Index: Z:/home/jshop/INSTALL/pack/site/payments/pm_paypal/pm_paypal.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/payments/pm_paypal/pm_paypal.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/payments/pm_paypal/pm_paypal.php	(revision 20)
@@ -42,17 +42,17 @@
         }
         
         $req = 'cmd=_notify-validate';
-        foreach ($_POST as $key => $value){
+        foreach($_POST as $key => $value){
             $value = urlencode(stripslashes($value));
             $req .= "&$key=$value";
         }
         $payment_status = trim(stripslashes($_POST['payment_status']));
         
         $header = '';
-        // post back to PayPal system to validate
-        $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
+        $header .= "POST /cgi-bin/webscr HTTP/1.1\r\n";
         $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
         $header .= "Host: ".$hostname."\r\n";
+		$header .= "Connection: close\r\n";
         $header .= "Content-Length: ".strlen($req)."\r\n\r\n";
         $debug = "";
 
@@ -64,7 +64,8 @@
         } else {
             @fputs ($fp, $header . $req);
             while (!@feof($fp)) {
-                $res = @fgets ($fp, 1024);
+                $res = @fgets($fp, 1024);
+				$res = trim($res);
                 $debug .= $res."\n";
                 if (strcmp ($res, "VERIFIED") == 0) {
                     if ($payment_status == 'Completed'){
Index: Z:/home/jshop/INSTALL/pack/site/shippings/sm_standart_weight/sm_standart_weight.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/shippings/sm_standart_weight/sm_standart_weight.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/shippings/sm_standart_weight/sm_standart_weight.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.3.0 20.12.2011
+* @version      3.12.0 20.12.2011
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -9,6 +9,8 @@
 
 class sm_standart_weight extends shippingextRoot{
     
+    var $version = 2;
+    
     function showShippingPriceForm($params, &$shipping_ext_row, &$template){        
         include(dirname(__FILE__)."/shippingpriceform.php");
     }
@@ -17,16 +19,17 @@
         include(dirname(__FILE__)."/configform.php");
     }
     
-    function getPrice($cart, $params, $price, &$shipping_ext_row, &$shipping_method_price){
+    function getPrices($cart, $params, $prices, &$shipping_ext_row, &$shipping_method_price){
         $weight_sum = $cart->getWeightProducts();
         $sh_price = $shipping_method_price->getPrices("desc");
-        foreach ($sh_price as $sh_pr){
+        foreach($sh_price as $sh_pr){
             if ($weight_sum >= $sh_pr->shipping_weight_from && ($weight_sum <= $sh_pr->shipping_weight_to || $sh_pr->shipping_weight_to==0)) {
-                $price = ($sh_pr->shipping_price + $sh_pr->shipping_package_price);
+                $prices['shipping'] = $sh_pr->shipping_price;
+                $prices['package'] = $sh_pr->shipping_package_price;
                 break;
             }
         }
-    return $price;
+    return $prices;
     }
 }
 
Index: Z:/home/jshop/INSTALL/pack/site/shippings/shippingext.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/shippings/shippingext.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/shippings/shippingext.php	(revision 20)
@@ -28,14 +28,17 @@
     abstract function showConfigForm($config, &$shipping_ext, &$template);
     
     /**
-    * calculate price for shipping
+    * calculate price for shipping and package
     * 
     * @param mixed $cart - cart object
     * @param mixed $params - shipping price params
-    * @param mixed $price - price before
+    * @param mixed $prices - prices before
     * @param mixed $shipping_ext_row - exstension row
     * @param mixed $shipping_method_price - object jshopShippingMethodPrice
     */
-    abstract function getPrice($cart, $params, $price, &$shipping_ext_row, &$shipping_method_price);
+    /*
+    abstract function getPrice($cart, $params, $price, &$shipping_ext_row, &$shipping_method_price);//deprecated
+    abstract function getPrices($cart, $params, $prices, &$shipping_ext_row, &$shipping_method_price);
+    */
 }
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/site/controllers/cart.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/controllers/cart.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/controllers/cart.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.10.0 15.06.2012
+* @version      3.12.0 15.06.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -12,7 +12,7 @@
 
 class JshoppingControllerCart extends JController{
     
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $this->view();
     }
 
Index: Z:/home/jshop/INSTALL/pack/site/controllers/content.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/controllers/content.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/controllers/content.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.10.0 18.09.2010
+* @version      3.12.0 18.09.2010
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -17,7 +17,7 @@
         $db = JFactory::getDBO(); 
         
         $page = JRequest::getVar('page');
-        switch ($page) {
+        switch($page){
             case 'agb':
                 $pathway = _JSHOP_AGB;
             break;
@@ -27,6 +27,9 @@
             case 'shipping':
                 $pathway = _JSHOP_SHIPPING;
             break;
+            case 'privacy_statement':
+                $pathway = _JSHOP_PRIVACY_STATEMENT;
+            break;
         }
         appendPathWay($pathway);
 
@@ -43,8 +46,8 @@
         
         JPluginHelper::importPlugin('jshopping');
         $dispatcher = JDispatcher::getInstance();
-        $dispatcher->trigger( 'onBeforeDisplayContent', array($page, &$text) );
-        
+        $dispatcher->trigger('onBeforeDisplayContent', array($page, &$text));
+
         echo $text;
     }
 
Index: Z:/home/jshop/INSTALL/pack/site/controllers/manufacturer.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/controllers/manufacturer.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/controllers/manufacturer.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.10.0 20.11.2011
+* @version      3.12.0 20.11.2011
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -12,7 +12,7 @@
 
 class JshoppingControllerManufacturer extends JController{
 	
-	function display(){
+	function display($cachable = false, $urlparams = false){
         $mainframe = JFactory::getApplication();
         $params = $mainframe->getParams();
         $document = JFactory::getDocument();
@@ -70,7 +70,7 @@
         $dispatcher->trigger( 'onBeforeDisplayManufacturer', array(&$manufacturer) );
         
         if ($manufacturer->manufacturer_publish==0){
-            JError::raiseError( 404, _JSHOP_PAGE_NOT_FOUND);
+            JError::raiseError(404, _JSHOP_PAGE_NOT_FOUND);
             return;
         }
 
@@ -110,7 +110,10 @@
         $pagination = new JPagination($total, $limitstart, $limit);
         $pagenav = $pagination->getPagesLinks();
         
-        if ($limitstart>=$total) $limitstart = 0;
+        if ($limitstart>=$total && $limitstart>0){
+            JError::raiseError(404, _JSHOP_PAGE_NOT_FOUND);
+            return;
+        }
 
 		$rows = $manufacturer->getProducts($filters, $field_order, $orderbyq, $limitstart, $limit);
 		addLinkToProducts($rows, 0, 1);		
Index: Z:/home/jshop/INSTALL/pack/site/controllers/category.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/controllers/category.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/controllers/category.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.9.1 20.05.2012
+* @version      3.12.0 20.05.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -12,7 +12,7 @@
 
 class JshoppingControllerCategory extends JController{
 
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $mainframe = JFactory::getApplication();
         $db = JFactory::getDBO();
         $jshopConfig = JSFactory::getConfig();
@@ -70,7 +70,7 @@
         $dispatcher->trigger('onAfterLoadCategory', array(&$category, &$user));
 
         if ($category->category_publish==0 || !in_array($category->access, $user->getAuthorisedViewLevels())){
-            JError::raiseError( 404, _JSHOP_PAGE_NOT_FOUND);
+            JError::raiseError(404, _JSHOP_PAGE_NOT_FOUND);
             return;
         }
         
@@ -113,7 +113,10 @@
         $total = $category->getCountProducts($filters);
         $action = xhtmlUrl($_SERVER['REQUEST_URI']);
                 
-        if ($limitstart>=$total) $limitstart = 0;
+        if ($limitstart>=$total && $limitstart>0){
+            JError::raiseError(404, _JSHOP_PAGE_NOT_FOUND);
+            return;
+        }
 
         $products = $category->getProducts($filters, $field_order, $orderbyq, $limitstart, $limit);
 		addLinkToProducts($products, $category_id);
Index: Z:/home/jshop/INSTALL/pack/site/controllers/vendor.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/controllers/vendor.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/controllers/vendor.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.10.0 16.12.2010
+* @version      3.12.0 16.12.2010
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -12,7 +12,7 @@
 
 class JshoppingControllerVendor extends JController{
 
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $mainframe = JFactory::getApplication();
         $params = $mainframe->getParams();
         $document = JFactory::getDocument();
@@ -124,6 +124,9 @@
         appendPathWay($vendor->shop_name);
         $seo = JTable::getInstance("seo", "jshop");
         $seodata = $seo->loadData("vendor-product-".$vendor_id);
+        if (!isset($seodata)){
+            $seodata = new stdClass();
+        }
         if ($seodata->title==""){
             $seodata->title = $vendor->shop_name;
         }
@@ -153,7 +156,10 @@
         $pagination = new JPagination($total, $limitstart, $limit);
         $pagenav = $pagination->getPagesLinks();
         
-        if ($limitstart>=$total) $limitstart = 0;
+        if ($limitstart>=$total && $limitstart>0){
+            JError::raiseError(404, _JSHOP_PAGE_NOT_FOUND);
+            return;
+        }
 
         $rows = $vendor->getProducts($filters, $field_order, $orderbyq, $limitstart, $limit);
         addLinkToProducts($rows, 0, 1);
@@ -162,7 +168,7 @@
             $sorts[] = JHTML::_('select.option', $key, $value, 'sort_id', 'sort_value' );
         }
 
-        insertValueInArray($products_page, $jshopConfig->count_product_select); //insert products_page count
+        insertValueInArray($products_page, $jshopConfig->count_product_select);
         foreach ($jshopConfig->count_product_select as $key => $value) {
             $product_count[] = JHTML::_('select.option',$key, $value, 'count_id', 'count_value' );
         }
@@ -175,7 +181,7 @@
         if ($jshopConfig->show_product_list_filters){
             $first_el = JHTML::_('select.option', 0, _JSHOP_ALL, 'manufacturer_id', 'name' );
             $_manufacturers = JTable::getInstance('manufacturer', 'jshop');
-            $listmanufacturers = jshopManufacturer::getAllManufacturers(1);
+            $listmanufacturers = $_manufacturers->getList();
             array_unshift($listmanufacturers, $first_el);
             $manufacuturers_sel = JHTML::_('select.genericlist', $listmanufacturers, 'manufacturers[]', 'class = "inputbox" onchange = "submitListProductFilters()"','manufacturer_id','name', $filters['manufacturers'][0]);
 
Index: Z:/home/jshop/INSTALL/pack/site/controllers/user.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/controllers/user.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/controllers/user.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.1 18.08.2012
+* @version      3.12.0 18.08.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -12,7 +12,7 @@
 
 class JshoppingControllerUser extends JController{
     
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $this->myaccount();
     }
     
@@ -54,7 +54,7 @@
 
         $country = JTable::getInstance('country', 'jshop');        
         $option_country[] = JHTML::_('select.option',  '0', _JSHOP_REG_SELECT, 'country_id', 'name' );    
-        $select_countries = JHTML::_('select.genericlist', array_merge($option_country, jshopCountry::getAllCountries()),'country','id = "country" class = "inputbox" size = "1"','country_id','name' );
+        $select_countries = JHTML::_('select.genericlist', array_merge($option_country, $country->getAllCountries()),'country','id = "country" class = "inputbox" size = "1"','country_id','name' );
         foreach ($jshopConfig->arr['title'] as $key => $value) {        
             $option_title[] = JHTML::_('select.option', $key, $value, 'title_id', 'title_name' );    
         }
@@ -184,10 +184,10 @@
             return;
         }        
         
-        $country = JTable::getInstance('country', 'jshop');        
-        $option_country[] = JHTML::_('select.option',  '0', _JSHOP_REG_SELECT, 'country_id', 'name' );    
-        $select_countries = JHTML::_('select.genericlist', array_merge($option_country, jshopCountry::getAllCountries()),'country','id = "country" class = "inputbox" size = "1"','country_id','name', $jshopConfig->default_country );
-        foreach ($jshopConfig->arr['title'] as $key => $value) {        
+        $country = JTable::getInstance('country', 'jshop');
+        $option_country[] = JHTML::_('select.option', '0', _JSHOP_REG_SELECT, 'country_id', 'name');
+        $select_countries = JHTML::_('select.genericlist', array_merge($option_country, $country->getAllCountries()),'country','id = "country" class = "inputbox" size = "1"','country_id','name', $jshopConfig->default_country);
+        foreach ($jshopConfig->arr['title'] as $key=>$value){
             $option_title[] = JHTML::_('select.option', $key, $value, 'title_id', 'title_name' );    
         }
         $select_titles = JHTML::_('select.genericlist', $option_title,'title','class = "inputbox"','title_id','title_name' );
@@ -229,6 +229,7 @@
         $params = JComponentHelper::getParams('com_users');
         $lang =  JFactory::getLanguage();
         $lang->load('com_users');
+        $post = JRequest::get('post');
         
         JPluginHelper::importPlugin('jshoppingcheckout');
         $dispatcher = JDispatcher::getInstance();
@@ -239,20 +240,20 @@
         }
         
         $usergroup = JTable::getInstance('usergroup', 'jshop');
-        $default_usergroup = jshopUsergroup::getDefaultUsergroup();
-        $_POST['username'] = JRequest::getVar('u_name');
-        $_POST['password2'] = JRequest::getVar('password_2');
-        $_POST['name'] = JRequest::getVar('f_name');
+        $default_usergroup = $usergroup->getDefaultUsergroup();
+        $post['username'] = JRequest::getVar('u_name');
+        $post['password2'] = JRequest::getVar('password_2');
+        $post['name'] = JRequest::getVar('f_name');
         
-        $dispatcher->trigger( 'onBeforeRegister', array(&$_POST) );
+        $dispatcher->trigger('onBeforeRegister', array(&$post, &$default_usergroup) );
         
         $row = JTable::getInstance('userShop', 'jshop');
-        $row->bind(JRequest::get('post'));
+        $row->bind($post);
         $row->usergroup_id = $default_usergroup;
-        $row->password = JRequest::getVar('password');
-        $row->password2 = JRequest::getVar('password_2');
+        $row->password = $post['password'];
+        $row->password2 = $post['password2'];
         
-        if (!$row->check("register")) {
+        if (!$row->check("register")){
             JError::raiseWarning('', $row->getError());
             $this->setRedirect(SEFLink("index.php?option=com_jshopping&controller=user&task=register",1,1, $jshopConfig->use_ssl));
             return 0;
@@ -267,6 +268,7 @@
         $data['name'] = JRequest::getVar("f_name");
         $data['username'] = JRequest::getVar("u_name");
         $useractivation = $params->get('useractivation');
+        $sendpassword = $params->get('sendpassword', 1);
 
         if (($useractivation == 1) || ($useractivation == 2)) {
             jimport('joomla.user.helper');
@@ -302,15 +304,26 @@
                 $data['sitename']
             );
 
-            $emailBody = JText::sprintf(
-                'COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY',
-                $data['name'],
-                $data['sitename'],
-                $data['siteurl'].'index.php?option=com_jshopping&controller=user&task=activate&token='.$data['activation'],
-                $data['siteurl'],
-                $data['username'],
-                $data['password_clear']
-            );
+            if ($sendpassword){
+                $emailBody = JText::sprintf(
+                    'COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY',
+                    $data['name'],
+                    $data['sitename'],
+                    $data['siteurl'].'index.php?option=com_jshopping&controller=user&task=activate&token='.$data['activation'],
+                    $data['siteurl'],
+                    $data['username'],
+                    $data['password_clear']
+                );
+            } else {
+				$emailBody = JText::sprintf(
+					'COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY_NOPW',
+					$data['name'],
+					$data['sitename'],
+					$data['siteurl'].'index.php?option=com_jshopping&controller=user&task=activate&token='.$data['activation'],
+					$data['siteurl'],
+					$data['username']
+				);
+			}
         }else if ($useractivation == 1){
             $uri = JURI::getInstance();
             $base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));
@@ -321,16 +334,26 @@
                 $data['name'],
                 $data['sitename']
             );
-
-            $emailBody = JText::sprintf(
-                'COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY',
-                $data['name'],
-                $data['sitename'],
-                $data['siteurl'].'index.php?option=com_jshopping&controller=user&task=activate&token='.$data['activation'],
-                $data['siteurl'],
-                $data['username'],
-                $data['password_clear']
-            );
+            if ($sendpassword){
+                $emailBody = JText::sprintf(
+                    'COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY',
+                    $data['name'],
+                    $data['sitename'],
+                    $data['siteurl'].'index.php?option=com_jshopping&controller=user&task=activate&token='.$data['activation'],
+                    $data['siteurl'],
+                    $data['username'],
+                    $data['password_clear']
+                );
+            } else {
+				$emailBody = JText::sprintf(
+					'COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY_NOPW',
+					$data['name'],
+					$data['sitename'],
+					$data['siteurl'].'index.php?option=com_jshopping&controller=user&task=activate&token='.$data['activation'],
+					$data['siteurl'],
+					$data['username']
+				);
+			}
         } else {
 
             $emailSubject    = JText::sprintf(
@@ -371,7 +394,7 @@
             }
         }
         
-        $dispatcher->trigger('onAfterRegister', array(&$user, &$row, &$_POST, &$useractivation));
+        $dispatcher->trigger('onAfterRegister', array(&$user, &$row, &$post, &$useractivation));
                 
         if ( $useractivation == 2 ){
             $message  = JText::_('COM_USERS_REGISTRATION_COMPLETE_VERIFY');
@@ -460,7 +483,7 @@
         
         $country = JTable::getInstance('country', 'jshop');
         $option_country[] = JHTML::_('select.option', 0, _JSHOP_REG_SELECT, 'country_id', 'name' );
-        $option_countryes = array_merge($option_country,jshopCountry::getAllCountries());    
+        $option_countryes = array_merge($option_country,$country->getAllCountries());
         $select_countries = JHTML::_('select.genericlist', $option_countryes,'country','class = "inputbox" size = "1"','country_id', 'name',$adv_user->country );
         $select_d_countries = JHTML::_('select.genericlist', $option_countryes,'d_country','class = "inputbox" size = "1"','country_id', 'name',$adv_user->d_country );
 
@@ -627,7 +650,7 @@
         $order->weight = $order->getWeightItems();
         $order->status_name = $order->getStatus();
         $order->history = $order->getHistory();
-        if ($jshopConfig->client_allow_cancel_order && $order->order_status!=$jshopConfig->payment_status_for_cancel_client){
+        if ($jshopConfig->client_allow_cancel_order && $order->order_status!=$jshopConfig->payment_status_for_cancel_client && !in_array($order->order_status, $jshopConfig->payment_status_disable_cancel_client) ){
             $allow_cancel = 1;
         }else{
             $allow_cancel = 0;
@@ -658,11 +681,18 @@
         $jshopConfig->user_field_client_type[0]="";
         $order->client_type_name = $jshopConfig->user_field_client_type[$order->client_type];
         
-        $deliverytimes = JSFactory::getAllDeliveryTime();
-        $order->delivery_time_name = $deliverytimes[$order->delivery_times_id];
-        if ($order->delivery_time_name==""){
-            $order->delivery_time_name = $order->delivery_time;
+        $order->delivery_time_name = '';
+        $order->delivery_date_f = '';
+        if ($jshopConfig->show_delivery_time_checkout){
+            $deliverytimes = JSFactory::getAllDeliveryTime();
+            $order->delivery_time_name = $deliverytimes[$order->delivery_times_id];
+            if ($order->delivery_time_name==""){
+                $order->delivery_time_name = $order->delivery_time;
+            }
         }
+        if ($jshopConfig->show_delivery_date && !datenull($order->delivery_date)){
+            $order->delivery_date_f = formatdate($order->delivery_date);
+        }
         
         $order->order_tax_list = $order->getTaxExt();
         $show_percent_tax = 0;
Index: Z:/home/jshop/INSTALL/pack/site/controllers/product.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/controllers/product.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/controllers/product.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.10.0 25.08.2012
+* @version      3.12.0 25.08.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -12,7 +12,7 @@
 
 class JshoppingControllerProduct extends JController{
 
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $mainframe =JFactory::getApplication();
         $db =JFactory::getDBO();
         $ajax = JRequest::getInt('ajax');
@@ -197,7 +197,7 @@
 
         $dispatcher->trigger('onBeforeDisplayProductList', array(&$product->product_related));
         $dispatcher->trigger('onBeforeDisplayProduct', array(&$product, &$view, &$product_images, &$product_videos, &$product_demofiles) );
-
+        
         $view->assign('config', $jshopConfig);
         $view->assign('image_path', $jshopConfig->live_path.'/images');
         $view->assign('noimage', 'noimage.gif');
Index: Z:/home/jshop/INSTALL/pack/site/controllers/products.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/controllers/products.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/controllers/products.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.10.0 25.08.2012
+* @version      3.12.0 25.08.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -12,7 +12,7 @@
 
 class JshoppingControllerProducts extends JController{
 	
-	function display(){
+	function display($cachable = false, $urlparams = false){
 	    $mainframe = JFactory::getApplication();
 		$jshopConfig = JSFactory::getConfig();
         $session = JFactory::getSession();
@@ -60,7 +60,10 @@
         $pagination = new JPagination($total, $limitstart, $limit);
         $pagenav = $pagination->getPagesLinks();
         
-        if ($limitstart>=$total) $limitstart = 0;
+        if ($limitstart>=$total && $limitstart>0){
+            JError::raiseError(404, _JSHOP_PAGE_NOT_FOUND);
+            return;
+        }
 
 		$rows = $product->getAllProducts($filters, $field_order, $orderbyq, $limitstart, $limit);
 		addLinkToProducts($rows, 0, 1);		
@@ -82,7 +85,12 @@
         if ($jshopConfig->show_product_list_filters){
             $first_el = JHTML::_('select.option', 0, _JSHOP_ALL, 'manufacturer_id', 'name' );
             $_manufacturers = JTable::getInstance('manufacturer', 'jshop');
-            $listmanufacturers = jshopManufacturer::getAllManufacturers(1);
+            if ($jshopConfig->manufacturer_sorting==2){
+                $morder = 'name';
+            }else{
+                $morder = 'ordering';
+            }
+            $listmanufacturers = $_manufacturers->getList();
             array_unshift($listmanufacturers, $first_el);
             $manufacuturers_sel = JHTML::_('select.genericlist', $listmanufacturers, 'manufacturers[]', 'class = "inputbox" onchange = "submitListProductFilters()"','manufacturer_id','name', $filters['manufacturers'][0]);
             
Index: Z:/home/jshop/INSTALL/pack/site/controllers/checkout.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/controllers/checkout.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/controllers/checkout.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.4 29.09.2012
+* @version      3.12.0 10.11.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -13,7 +13,7 @@
 
 class JshoppingControllerCheckout extends JController{
     
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $this->step2();
     }
     
@@ -51,7 +51,7 @@
         if ($user->id){
             $adv_user = JSFactory::getUserShop();
         }else{
-            $adv_user = JSFactory::getUserShopGuest();    
+            $adv_user = JSFactory::getUserShopGuest();
         }
         
         $tmp_fields = $jshopConfig->getListFieldsRegister();
@@ -236,7 +236,8 @@
         $all_payment_methods = jshopPaymentMethod::getAllPaymentMethods();
         $i = 0;
         $paym = array();
-        foreach ($all_payment_methods as $pm) {
+        foreach($all_payment_methods as $pm){
+            $paym[$i] = new stdClass();
             if (file_exists($jshopConfig->path.'payments/'.$pm->payment_class."/".$pm->payment_class.'.php')){
                 require_once($jshopConfig->path.'payments/'.$pm->payment_class."/".$pm->payment_class.'.php');
                 $paym[$i]->existentcheckform = 1;
@@ -261,7 +262,7 @@
                     }
                 }
             }else{
-                $paym[$i]->calculeprice = getPriceCalcParamsTax($pm->price * $jshopConfig->currency_value, $pm->tax_id);
+                $paym[$i]->calculeprice = getPriceCalcParamsTax($pm->price * $jshopConfig->currency_value, $pm->tax_id, $cart->products);
                 if ($paym[$i]->calculeprice!=0){
                     if ($paym[$i]->calculeprice>0){
                         $paym[$i]->price_add_text = '+'.formatprice($paym[$i]->calculeprice);
@@ -331,7 +332,7 @@
         $view->assign('small_cart', $small_cart);
         $view->assign('action', SEFLink('index.php?option=com_jshopping&controller=checkout&task=step3save', 0, 0, $jshopConfig->use_ssl));
         $dispatcher->trigger('onBeforeDisplayCheckoutStep3View', array(&$view));
-        $view->display();    
+        $view->display();
     }
     
     function step3save(){
@@ -392,10 +393,9 @@
         
         $paym_method->setCart($cart);
         $cart->setPaymentId($payment_method_id);
-        $cart->setPaymentPrice($paym_method->getPrice());
-        $cart->setPaymentTax($paym_method->calculateTax());
-        $cart->setPaymentTaxPercent($paym_method->getTax());
-        
+        $price = $paym_method->getPrice();
+        $cart->setPaymentDatas($price, $paym_method);
+
         if (isset($params[$payment_method])) {
             $cart->setPaymentParams($params_pm);
         } else {
@@ -410,6 +410,7 @@
             $checkout->setMaxStep(5);
             $cart->setShippingId(0);
             $cart->setShippingPrice(0);
+            $cart->setPackagePrice(0);
             $this->setRedirect(SEFLink('index.php?option=com_jshopping&controller=checkout&task=step5',0,1,$jshopConfig->use_ssl));
             return 0; 
         }
@@ -456,6 +457,7 @@
         	$checkout->setMaxStep(5);
             $cart->setShippingId(0);
             $cart->setShippingPrice(0);
+            $cart->setPackagePrice(0);
             $this->setRedirect(SEFLink('index.php?option=com_jshopping&controller=checkout&task=step5',0,1,$jshopConfig->use_ssl));
             return 0; 
         }
@@ -474,7 +476,12 @@
             JError::raiseWarning("", _JSHOP_REGWARN_COUNTRY);
         }
         
-        $deliverytimes = JSFactory::getAllDeliveryTime();
+        if ($jshopConfig->show_delivery_time_checkout){
+            $deliverytimes = JSFactory::getAllDeliveryTime();
+        }
+        if ($jshopConfig->show_delivery_date){
+            $deliverytimedays = JSFactory::getAllDeliveryTimeDays();
+        }
         $payment_id = $cart->getPaymentId();
         $shippings = $shippingmethod->getAllShippingMethodsCountry($id_country, $payment_id);
         foreach($shippings as $key=>$value){
@@ -482,8 +489,20 @@
             if ($jshopConfig->show_list_price_shipping_weight){
                 $shippings[$key]->shipping_price = $shippingmethodprice->getPricesWeight($value->sh_pr_method_id, $id_country);
             }
-            $shippings[$key]->calculeprice = $shippingmethodprice->calculateSum($cart);
-            $shippings[$key]->delivery = $deliverytimes[$value->delivery_times_id];
+            $prices = $shippingmethodprice->calculateSum($cart);
+            $shippings[$key]->calculeprice = $prices['shipping']+$prices['package'];
+            $shippings[$key]->delivery = '';
+            $shippings[$key]->delivery_date_f = '';
+            if ($jshopConfig->show_delivery_time_checkout){
+                $shippings[$key]->delivery = $deliverytimes[$value->delivery_times_id];
+            }
+            if ($jshopConfig->show_delivery_date){
+                $day = $deliverytimedays[$value->delivery_times_id];
+                if ($day){
+                    $shippings[$key]->delivery_date = getCalculateDeliveryDay($day);
+                    $shippings[$key]->delivery_date_f = formatdate($shippings[$key]->delivery_date);
+                }
+            }
         }
 
         $sh_pr_method_id = $cart->getShippingPrId();
@@ -556,13 +575,13 @@
         if (!$id_country) $id_country = $jshopConfig->default_country;
         
         $sh_pr_method_id = JRequest::getInt('sh_pr_method_id');
-                
+
         $shipping_method_price = JTable::getInstance('shippingMethodPrice', 'jshop');
         $shipping_method_price->load($sh_pr_method_id);
-        
+
         $sh_method = JTable::getInstance('shippingMethod', 'jshop');
         $sh_method->load($shipping_method_price->shipping_method_id);
-        
+
         if (!$shipping_method_price->sh_pr_method_id){
             JError::raiseWarning("", _JSHOP_ERROR_SHIPPING);
             $this->setRedirect(SEFLink('index.php?option=com_jshopping&controller=checkout&task=step4',0,1,$jshopConfig->use_ssl));
@@ -581,14 +600,28 @@
             return 0;
         }
         
-        $price_shipping = $shipping_method_price->calculateSum($cart);
-        
+        $prices = $shipping_method_price->calculateSum($cart);
         $cart->setShippingId($sh_method->shipping_id);
         $cart->setShippingPrId($sh_pr_method_id);
-        $cart->setShippingPrice($price_shipping);
-        $cart->setShippingPriceTax($shipping_method_price->calculateTax($price_shipping));
-        $cart->setShippingPriceTaxPercent($shipping_method_price->getTax());
+        $cart->setShippingsDatas($prices, $shipping_method_price);
         
+        if ($jshopConfig->show_delivery_date){
+            $delivery_date = '';
+            $deliverytimedays = JSFactory::getAllDeliveryTimeDays();
+            $day = $deliverytimedays[$shipping_method_price->delivery_times_id];
+            if ($day){
+                $delivery_date = getCalculateDeliveryDay($day);
+            }else{
+                if ($jshopConfig->delivery_order_depends_delivery_product){
+                    $day = $cart->getDeliveryDaysProducts();
+                    if ($day){
+                        $delivery_date = getCalculateDeliveryDay($day);                    
+                    }
+                }
+            }
+            $cart->setDeliveryDate($delivery_date);
+        }
+
         //update payment price
         $payment_method_id = $cart->getPaymentId();
         if ($payment_method_id){
@@ -596,14 +629,13 @@
             $paym_method->load($payment_method_id);
             $cart->setDisplayItem(1, 1);
             $paym_method->setCart($cart);
-            $cart->setPaymentPrice($paym_method->getPrice());
-            $cart->setPaymentTax($paym_method->calculateTax());
-            $cart->setPaymentTaxPercent($paym_method->getTax());
+            $price = $paym_method->getPrice();
+            $cart->setPaymentDatas($price, $paym_method);            
         }
 
         $adv_user->saveTypeShipping($sh_method->shipping_id);
         
-        $dispatcher->trigger( 'onAfterSaveCheckoutStep4', array(&$adv_user, &$sh_method, &$shipping_method_price, &$cart) );        
+        $dispatcher->trigger('onAfterSaveCheckoutStep4', array(&$adv_user, &$sh_method, &$shipping_method_price, &$cart) );
         $checkout->setMaxStep(5);
         $this->setRedirect(SEFLink('index.php?option=com_jshopping&controller=checkout&task=step5',0,1,$jshopConfig->use_ssl));
     }
@@ -641,11 +673,23 @@
         
         $sh_mt_pr = JTable::getInstance('shippingMethodPrice', 'jshop');
         $sh_mt_pr->load($cart->getShippingPrId());
-        $deliverytimes = JSFactory::getAllDeliveryTime();
-        $delivery_time = $deliverytimes[$sh_mt_pr->delivery_times_id];
-        if (!$delivery_time && $jshopConfig->delivery_order_depends_delivery_product){
-            $delivery_time = $cart->getDelivery();
+        if ($jshopConfig->show_delivery_time_checkout){
+            $deliverytimes = JSFactory::getAllDeliveryTime();
+            $delivery_time = $deliverytimes[$sh_mt_pr->delivery_times_id];
+            if (!$delivery_time && $jshopConfig->delivery_order_depends_delivery_product){
+                $delivery_time = $cart->getDelivery();
+            }
+        }else{
+            $delivery_time = '';
         }
+        if ($jshopConfig->show_delivery_date){
+            $delivery_date = $cart->getDeliveryDate();
+            if ($delivery_date){
+                $delivery_date = formatdate($cart->getDeliveryDate());
+            }
+        }else{
+            $delivery_date = '';
+        }
         
         $pm_method = JTable::getInstance('paymentMethod', 'jshop');
         $payment_method_id = $cart->getPaymentId();
@@ -707,6 +751,7 @@
         $view->assign('action', SEFLink('index.php?option=com_jshopping&controller=checkout&task=step5save',0,0, $jshopConfig->use_ssl));       
         $view->assign('config', $jshopConfig);
         $view->assign('delivery_time', $delivery_time);
+        $view->assign('delivery_date', $delivery_date);
         $view->assign('checkout_navigator', $checkout_navigator);
         $view->assign('small_cart', $small_cart);
 		$view->assign('count_filed_delivery', $count_filed_delivery);
@@ -788,7 +833,11 @@
         $order->order_payment = $cart->getPaymentPrice();
         $order->order_discount = $cart->getDiscountShow();
         $order->shipping_tax = $cart->getShippingPriceTaxPercent();
+        $order->setShippingTaxExt($cart->getShippingTaxList());
         $order->payment_tax = $cart->getPaymentTaxPercent();
+        $order->setPaymentTaxExt($cart->getPaymentTaxList());
+        $order->order_package = $cart->getPackagePrice();
+        $order->setPackageTaxExt($cart->getPackageTaxList());
         $order->order_total = $cart->getSum(1, 1, 1);
         $order->currency_exchange = $jshopConfig->currency_value;
         $order->vendor_type = $cart->getVendorType();
@@ -800,6 +849,9 @@
         if ($jshopConfig->delivery_order_depends_delivery_product){
             $order->delivery_time = $cart->getDelivery();
         }
+        if ($jshopConfig->show_delivery_date){
+            $order->delivery_date = $cart->getDeliveryDate();
+        }
         $order->coupon_id = $cart->getCouponId();
 
         $pm_params = $cart->getPaymentParams();
@@ -886,7 +938,7 @@
         $pmconfigs = $pm_method->getConfigs();
         
         $task = "step6";
-        if ($pmconfigs['windowtype']==2){
+        if (isset($pmconfigs['windowtype']) && $pmconfigs['windowtype']==2){
             $task = "step6iframe";
             $session->set("jsps_iframe_width", $pmconfigs['iframe_width']);
             $session->set("jsps_iframe_height", $pmconfigs['iframe_height']);
@@ -1192,7 +1244,7 @@
         
         JPluginHelper::importPlugin('jshoppingcheckout');
         $dispatcher = JDispatcher::getInstance();
-        $dispatcher->trigger( 'onBeforeDisplaySmallCart', array(&$cart) );
+        $dispatcher->trigger('onBeforeDisplaySmallCart', array(&$cart) );
                 
         $view_name = "cart";
         $view_config = array("template_path"=>JPATH_COMPONENT."/templates/".$jshopConfig->template."/".$view_name);
@@ -1213,6 +1265,9 @@
         if ($step == 5) {
             if (!$jshopConfig->without_shipping){
                 $view->assign('summ_delivery', $cart->getShippingPrice());
+                if ($cart->getPackagePrice()>0 || $jshopConfig->display_null_package_price){
+                    $view->assign('summ_package', $cart->getPackagePrice());
+                }
                 $view->assign('summ_payment', $cart->getPaymentPrice());
                 $fullsumm = $cart->getSum(1,1,1);
                 $tax_list = $cart->getTaxExt(1,1,1);
Index: Z:/home/jshop/INSTALL/pack/site/controllers/search.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/controllers/search.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/controllers/search.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.10.0 17.02.2012
+* @version      3.12.0 17.02.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -12,7 +12,7 @@
 
 class JshoppingControllerSearch extends JController{
     
-    function display(){
+    function display($cachable = false, $urlparams = false){
     	$jshopConfig = JSFactory::getConfig();
     	JHTML::_('behavior.calendar');
         $mainframe = JFactory::getApplication();
@@ -48,7 +48,7 @@
 		
         $first = JHTML::_('select.option', 0, _JSHOP_SEARCH_ALL_MANUFACTURERS, 'manufacturer_id', 'name');
         $_manufacturers = JTable::getInstance('manufacturer', 'jshop');
-		$manufacturers = jshopManufacturer::getAllManufacturers(1);
+		$manufacturers = $_manufacturers->getList();
 		array_unshift($manufacturers, $first);
         $list_manufacturers = JHTML::_('select.genericlist', $manufacturers, 'manufacturer_id', 'class = "inputbox" size = "1"','manufacturer_id','name' );
         
@@ -129,7 +129,7 @@
         $price_to = saveAsPrice($post['price_to']);
         $price_from = saveAsPrice($post['price_from']);
         $include_subcat = intval($post['include_subcat']);
-        $search = $post['search'];
+        $search = trim($post['search']);
         $search_type = $post['search_type'];
         if (!$search_type) $search_type = "any";
 
@@ -148,10 +148,11 @@
         if ($category_id) {
             if ($include_subcat){
                 $_category = JTable::getInstance('category', 'jshop');
-                $all_categories = jshopCategory::getAllCategories();
+                $all_categories = $_category->getAllCategories();
+                $cat_search = array();
                 $cat_search[] = $category_id;
                 searchChildCategories($category_id, $all_categories, $cat_search);
-                foreach ($cat_search as $key=>$value) {
+                foreach($cat_search as $key=>$value){
                     $categorys[] = $value;
                 }
             }else{
@@ -218,7 +219,7 @@
         $db->setQuery($query);
         $total = $db->loadResult();
         
-        if (!$total) {
+        if (!$total){
             $view_name = "search";
             $view_config = array("template_path"=>JPATH_COMPONENT."/templates/".$jshopConfig->template."/".$view_name);
             $view = $this->getView($view_name, getDocumentType(), '', $view_config);
@@ -227,6 +228,11 @@
             $view->display();
             return 0;
         }
+        
+        if ($limitstart>=$total && $limitstart>0){
+            JError::raiseError(404, _JSHOP_PAGE_NOT_FOUND);
+            return;
+        }
 
         $query = "SELECT $adv_result FROM `#__jshopping_products` AS prod
                   LEFT JOIN `#__jshopping_products_to_categories` AS pr_cat ON pr_cat.product_id = prod.product_id
@@ -244,12 +250,12 @@
         $pagination = new JPagination($total, $limitstart, $limit);
         $pagenav = $pagination->getPagesLinks();
         
-        foreach ($jshopConfig->sorting_products_name_s_select as $key => $value) {
+        foreach($jshopConfig->sorting_products_name_s_select as $key=>$value) {
             $sorts[] = JHTML::_('select.option', $key, $value, 'sort_id', 'sort_value' );
         }
 
-        insertValueInArray($jshopConfig->count_products_to_page, $jshopConfig->count_product_select); //insert category count
-        foreach ($jshopConfig->count_product_select as $key => $value) {
+        insertValueInArray($jshopConfig->count_products_to_page, $jshopConfig->count_product_select);
+        foreach($jshopConfig->count_product_select as $key=>$value){
             $product_count[] = JHTML::_('select.option',$key, $value, 'count_id', 'count_value' );
         }
         $sorting_sel = JHTML::_('select.genericlist', $sorts, 'order', 'class = "inputbox" size = "1" onchange = "submitListProductFilters()"','sort_id', 'sort_value', $order );
@@ -260,7 +266,7 @@
         
         $action = xhtmlUrl($_SERVER['REQUEST_URI']);
         
-        $dispatcher->trigger( 'onBeforeDisplayProductList', array(&$rows) );
+        $dispatcher->trigger('onBeforeDisplayProductList', array(&$rows) );
 
         $view_name = "search";
         $view_config = array("template_path"=>JPATH_COMPONENT."/templates/".$jshopConfig->template."/".$view_name);
@@ -295,6 +301,8 @@
         $jshopConfig = JSFactory::getConfig();
         $category_id = JRequest::getInt("category_id");
         if ($jshopConfig->admin_show_product_extra_field){
+            JPluginHelper::importPlugin('jshoppingproducts');
+            $dispatcher = JDispatcher::getInstance();
             $characteristic_fields = JSFactory::getAllProductExtraField();
             $characteristic_fieldvalues = JSFactory::getAllProductExtraFieldValueDetail();
             $characteristic_displayfields = JSFactory::getDisplayFilterExtraFieldForCategory($category_id);
@@ -306,6 +314,7 @@
             $view->assign('characteristic_fields', $characteristic_fields);
             $view->assign('characteristic_fieldvalues', $characteristic_fieldvalues);
             $view->assign('characteristic_displayfields', $characteristic_displayfields);
+            $dispatcher->trigger('onBeforeDisplaySearchHtmlCharacteristics', array(&$view));
             $view->display();
         }
     die();
Index: Z:/home/jshop/INSTALL/pack/site/controllers/wishlist.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/controllers/wishlist.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/controllers/wishlist.php	(revision 20)
@@ -12,7 +12,7 @@
 
 class JshoppingControllerWishlist extends JController{
 
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $this->view();
     }
 
Index: Z:/home/jshop/INSTALL/pack/site/lib/default_config.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/lib/default_config.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/lib/default_config.php	(revision 20)
@@ -48,12 +48,12 @@
 
 $config->user_field_client_type = array(0=>_JSHOP_REG_SELECT, 1=>_JSHOP_PRIVAT_CLIENT, 2=>_JSHOP_FIRMA_CLIENT);
 $config->arr['title'] = array(0=>_JSHOP_REG_SELECT, 1=>_JSHOP_MR, 2=>_JSHOP_MS);
-$config->sorting_products_field_select =   array(1 => 'name',           2=>'prod.product_price',        3=>'prod.product_date_added', 5=>'prod.average_rating', 6=>'prod.hits',         4=>'pr_cat.product_ordering');
-$config->sorting_products_name_select =    array(1=>_JSHOP_SORT_ALPH,   2=>_JSHOP_SORT_PRICE,           3=>_JSHOP_SORT_DATE,          5=>_JSHOP_SORT_RATING,    6=>_JSHOP_SORT_POPULAR, 4=>_JSHOP_SORT_MANUAL);
+$config->sorting_products_field_select =   array(1 => 'name',         2=>'prod.product_price',        3=>'prod.product_date_added', 5=>'prod.average_rating', 6=>'prod.hits',         4=>'pr_cat.product_ordering');
+$config->sorting_products_name_select =    array(1=>_JSHOP_SORT_ALPH, 2=>_JSHOP_SORT_PRICE,           3=>_JSHOP_SORT_DATE,          5=>_JSHOP_SORT_RATING,    6=>_JSHOP_SORT_POPULAR, 4=>_JSHOP_SORT_MANUAL);
 $config->sorting_products_field_s_select = array(1 => 'name',         2=>'prod.product_price',        3=>'prod.product_date_added', 5=>'prod.average_rating', 6=>'prod.hits');
 $config->sorting_products_name_s_select =  array(1=>_JSHOP_SORT_ALPH, 2=>_JSHOP_SORT_PRICE,           3=>_JSHOP_SORT_DATE,          5=>_JSHOP_SORT_RATING,    6=>_JSHOP_SORT_POPULAR);
 $config->format_currency = array('1' => '00Symb', '00 Symb', 'Symb00', 'Symb 00');
-$config->count_product_select = array('5'=>5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '50' => 50, '99999'=>'all');                                    
+$config->count_product_select = array('5'=>5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '50' => 50, '99999'=>_JSHOP_ALL);                                    
 $config->payment_status_enable_download_sale_file = array(5, 6, 7);
 $config->payment_status_return_product_in_stock = array(3, 4);
 $config->payment_status_for_cancel_client = 3;
@@ -81,6 +81,8 @@
 $config->display_user_groups_info = 1;
 $config->display_user_group = 1;
 $config->display_delivery_time_for_product_in_order_mail = 1;
+$config->show_delivery_time_checkout = 1;
+$config->show_delivery_date = 0;
 $config->load_jquery = 1;
 $config->load_jquery_version = '1.6.2';
 $config->load_jquery_lightbox = 1;
@@ -100,11 +102,14 @@
 $config->count_products_to_row_bestseller = 3;
 $config->count_products_to_row_random = 3;
 $config->count_products_to_row_last = 3;
+$config->display_null_package_price = 0;
+$config->tax_on_delivery_address = 0;
+$config->stock = 1;
 
-$other_config = array("cart_back_to_shop", "product_button_back_use_end_list", "display_tax_id_in_pdf", "image_quality", "image_fill_color", "product_price_qty_discount", "rating_starparts","show_list_price_shipping_weight", "product_price_precision", "cart_decimal_qty_precision", "default_frontend_currency", "product_file_upload_via_ftp", "product_file_upload_count", "product_image_upload_count", "product_video_upload_count", "show_insert_code_in_product_video", "max_number_download_sale_file", "max_day_download_sale_file", "order_display_new_digital_products", "display_user_groups_info", "display_user_group", "display_delivery_time_for_product_in_order_mail", "load_jquery", "load_jquery_version", "load_jquery_lightbox", "load_javascript", "load_css");$config->securcode = '3c7370616e2069643d226d78637072223e3c61207461726765743d225f626c616e6b2220687265663d22687474703a2f2f7777772e77656264657369676e65722d70726f66692e64652f223e436f70797269676874204d4158586d61726b6574696e672057656264657369676e657220476d62483c2f613e3c2f7370616e3e';
-$other_config_checkbox = array("show_list_price_shipping_weight", "display_tax_id_in_pdf", "show_insert_code_in_product_video", "order_display_new_digital_products", "display_user_groups_info", "display_user_group", "display_delivery_time_for_product_in_order_mail", "load_jquery", "load_jquery_lightbox", "load_css", "load_javascript");
-$adminfunction_other_config = array('tax');
-$checkout_other_config = array('show_manufacturer_in_cart','weight_in_invoice','shipping_in_invoice','payment_in_invoice','date_invoice_in_invoice');
+$other_config = array('tax_on_delivery_address',"cart_back_to_shop", "product_button_back_use_end_list", "display_tax_id_in_pdf", "image_quality", "image_fill_color", "product_price_qty_discount", "rating_starparts","show_list_price_shipping_weight", "product_price_precision", "cart_decimal_qty_precision", "default_frontend_currency", "product_file_upload_via_ftp", "product_file_upload_count", "product_image_upload_count", "product_video_upload_count", "show_insert_code_in_product_video", "max_number_download_sale_file", "max_day_download_sale_file", "order_display_new_digital_products", "display_user_groups_info", "display_user_group", "load_jquery", "load_jquery_version", "load_jquery_lightbox", "load_javascript", "load_css");$config->securcode = '3c7370616e2069643d226d78637072223e3c61207461726765743d225f626c616e6b2220687265663d22687474703a2f2f7777772e77656264657369676e65722d70726f66692e64652f223e436f70797269676874204d4158586d61726b6574696e672057656264657369676e657220476d62483c2f613e3c2f7370616e3e';
+$other_config_checkbox = array('tax_on_delivery_address',"show_list_price_shipping_weight", "display_tax_id_in_pdf", "show_insert_code_in_product_video", "order_display_new_digital_products", "display_user_groups_info", "display_user_group", "load_jquery", "load_jquery_lightbox", "load_css", "load_javascript",'set_old_price_after_group_set_price');
+$adminfunction_other_config = array('tax','stock');
+$checkout_other_config = array('display_delivery_time_for_product_in_order_mail','show_delivery_date','show_delivery_time_checkout','show_manufacturer_in_cart','weight_in_invoice','shipping_in_invoice','payment_in_invoice','date_invoice_in_invoice');
 $catprod_other_config = array('count_products_to_page_tophits','count_products_to_page_toprating','count_products_to_page_label','count_products_to_page_bestseller','count_products_to_page_random','count_products_to_page_last','count_products_to_row_tophits','count_products_to_row_toprating','count_products_to_row_label','count_products_to_row_bestseller','count_products_to_row_random','count_products_to_row_last');
 
 $fields_client_sys = array();
@@ -137,6 +142,7 @@
 $fields_client['register'][] = "ext_field_1";
 $fields_client['register'][] = "ext_field_2";
 $fields_client['register'][] = "ext_field_3";
+$fields_client['register'][] = "privacy_statement";
 $fields_client['register'][] = "u_name";
 $fields_client['register'][] = "password";
 $fields_client['register'][] = "password_2";
@@ -165,6 +171,7 @@
 $fields_client['address'][] = "ext_field_1";
 $fields_client['address'][] = "ext_field_2";
 $fields_client['address'][] = "ext_field_3";
+$fields_client['address'][] = "privacy_statement";
 
 $fields_client['address'][] = "d_title";
 $fields_client['address'][] = "d_f_name";
@@ -209,6 +216,7 @@
 $fields_client['editaccount'][] = "ext_field_1";
 $fields_client['editaccount'][] = "ext_field_2";
 $fields_client['editaccount'][] = "ext_field_3";
+$fields_client['editaccount'][] = "privacy_statement";
 $fields_client['editaccount'][] = "password";
 $fields_client['editaccount'][] = "password_2";
 
Index: Z:/home/jshop/INSTALL/pack/site/lib/generete_pdf_order.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/lib/generete_pdf_order.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/lib/generete_pdf_order.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.1 19.09.2012
+* @version      3.12.0 19.09.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -10,10 +10,14 @@
 include(JPATH_SITE."/components/com_jshopping/lib/tcpdf/tcpdf.php");
 
 class JorderPDF extends TCPDF{
-	function addNewPage(){
-		$this->addPage();
-		$this->addTitleHead();
-	}
+    
+    var $pdfcolors = array(array(0,0,0), array(200,200,200), array(155,155,155));
+    
+    function addNewPage(){
+        $this->addPage();
+        $this->addTitleHead();
+    }
+    
 	function addTitleHead(){
 		$jshopConfig = JSFactory::getConfig();
         $vendorinfo = $this->_vendorinfo;
@@ -21,7 +25,7 @@
 		$this->Image($jshopConfig->path.'images/footer.jpg',1,265,$jshopConfig->pdf_footer_width,$jshopConfig->pdf_footer_height);
         $this->SetFont('freesans','',8);
         $this->SetXY(155,12);
-        $this->SetTextColor(155,155,155);
+        $this->SetTextColor($this->pdfcolors[2][0], $this->pdfcolors[2][1], $this->pdfcolors[2][2]);
         $_vendor_info = array();
         $_vendor_info[] = $vendorinfo->adress;
         $_vendor_info[] = $vendorinfo->zip." ".$vendorinfo->city;
@@ -30,34 +34,36 @@
         if ($vendorinfo->email) $_vendor_info[] = _JSHOP_EMAIL.": ".$vendorinfo->email;
         $str_vendor_info = implode("\n",$_vendor_info);
         $this->MultiCell(40, 3, $str_vendor_info, 0, 'R');
-        $this->SetTextColor(0,0,0);
+        $this->SetTextColor($this->pdfcolors[0][0], $this->pdfcolors[0][1], $this->pdfcolors[0][2]);
 	}
 }
 
 function generatePDF($order){
+    
     $jshopConfig = JSFactory::getConfig();
     $vendorinfo = $order->getVendorInfo();
     
+    $pdf = new JorderPDF();
+
     JPluginHelper::importPlugin('jshoppingorder');
     $dispatcher = JDispatcher::getInstance();
-    $dispatcher->trigger('onBeforeCreatePdfOrder', array(&$order, &$vendorinfo));
+    $dispatcher->trigger('onBeforeCreatePdfOrder', array(&$order, &$vendorinfo, &$pdf));
     
-	$pdf = new JorderPDF();
     $pdf->_vendorinfo = $vendorinfo;
     $pdf->SetFont('freesans','',8);
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
-    $pdf->SetMargins(0, 0, 0);
+    $pdf->SetMargins(0,0,0);
 	$pdf->addNewPage();
     
 	$pdf->SetXY(20,55);
 	$pdf->setfontsize(6);
-	$pdf->SetTextColor(0,0,0);
+	$pdf->SetTextColor($pdf->pdfcolors[0][0], $pdf->pdfcolors[0][1], $pdf->pdfcolors[0][2]);
 	$pdf->MultiCell(80,3, $vendorinfo->company_name.", ".$vendorinfo->adress.", ".$vendorinfo->zip." ".$vendorinfo->city,0,'L');
 	
 	$pdf->SetXY(110,55);
 	$pdf->SetFont('freesansb','',11);
-	$pdf->SetTextColor(0,0,0);
+	$pdf->SetTextColor($pdf->pdfcolors[0][0], $pdf->pdfcolors[0][1], $pdf->pdfcolors[0][2]);
 	$pdf->MultiCell(80,3,_JSHOP_EMAIL_BILL,0,'R');
 	
 	$pdf->SetFont('freesans','',11);
@@ -74,7 +80,7 @@
     
     
     
-	$pdf->SetDrawColor(0,0,0);
+	$pdf->SetDrawColor($pdf->pdfcolors[0][0], $pdf->pdfcolors[0][1], $pdf->pdfcolors[0][2]);
 	$pdf->SetFont('freesans','',7);
     
     if ( $vendorinfo->identification_number){
@@ -92,7 +98,7 @@
     
     $width_filename	= 65;
     if (!$jshopConfig->show_product_code_in_order) $width_filename = 87;
-	$pdf->setfillcolor(200,200,200);
+	$pdf->setfillcolor($pdf->pdfcolors[1][0], $pdf->pdfcolors[1][1], $pdf->pdfcolors[1][2]);
 	$pdf->Rect(20,116,170,4,'F');
 	$pdf->SetFont('freesansb','',7.5);
 	$pdf->SetXY(20,116);
@@ -227,6 +233,14 @@
 	    $pdf->MultiCell(130,5,_JSHOP_SHIPPING_PRICE,'1','R');
 	    $pdf->SetXY(150,$y + 5);
 	    $pdf->MultiCell(40,5,formatprice($order->order_shipping, $order->currency_code),'1','R');
+        if ($order->order_package>0 || $jshopConfig->display_null_package_price){
+            $y=$y+5;
+            $pdf->SetXY(20,$y + 5);
+            $pdf->Rect(20,$y + 5,170,5,'F');
+            $pdf->MultiCell(130,5,_JSHOP_PACKAGE_PRICE,'1','R');
+            $pdf->SetXY(150,$y + 5);
+            $pdf->MultiCell(40,5,formatprice($order->order_package, $order->currency_code),'1','R');
+        }
     }else{
         $y = $y - 5;
     }
@@ -244,6 +258,8 @@
     if (count($order->order_tax_list)>1 || $jshopConfig->show_tax_in_product) $show_percent_tax = 1;
     if ($jshopConfig->hide_tax) $show_percent_tax = 0;
 	
+	$dispatcher->trigger('onBeforeCreatePdfOrderBeforeEndTotal', array(&$order, &$pdf, &$y));
+	
     if (!$jshopConfig->hide_tax){
         foreach($order->order_tax_list as $percent=>$value){
 	        $pdf->SetXY(20,$y + 10);
@@ -278,7 +294,7 @@
     
     $y = $y + 10; 
     
-    if ($jshopConfig->show_delivery_time && ($order->delivery_times_id || $order->delivery_time)){
+    if ($jshopConfig->show_delivery_time_checkout && ($order->delivery_times_id || $order->delivery_time)){
         if ($y > 250){ $pdf->addNewPage(); $y = 60; }
         $deliverytimes = JSFactory::getAllDeliveryTime();
         $delivery = $deliverytimes[$order->delivery_times_id];
@@ -288,9 +304,18 @@
         $y = $y+8;
         $pdf->SetFont('freesans','',7);
         $pdf->SetXY(20, $y);
-        $pdf->MultiCell(170, 4 , _JSHOP_ORDER_DELIVERY_TIME.": ".$delivery, '0','L');
+        $pdf->MultiCell(170, 4, _JSHOP_ORDER_DELIVERY_TIME.": ".$delivery, '0','L');
     }
     
+    if ($jshopConfig->show_delivery_date && !datenull($order->delivery_date)){
+        if ($y > 250){ $pdf->addNewPage(); $y = 60; }
+        $delivery_date_f = formatdate($order->delivery_date); 
+        $y = $y+6;
+        $pdf->SetFont('freesans','',7);
+        $pdf->SetXY(20, $y);
+        $pdf->MultiCell(170, 4, _JSHOP_DELIVERY_DATE.": ".$delivery_date_f, '0','L');
+    }
+    
     if ($jshopConfig->weight_in_invoice){
         if ($y > 250){ $pdf->addNewPage(); $y = 60; }
         $y = $y+6;
Index: Z:/home/jshop/INSTALL/pack/site/lib/factory.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/lib/factory.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/lib/factory.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.4 24.08.2012
+* @version      3.12.0 27.10.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -11,6 +11,7 @@
 include_once(JPATH_ROOT."/components/com_jshopping/lib/jtableauto.php");
 include_once(JPATH_ROOT."/components/com_jshopping/lib/multilangfield.php");
 include_once(JPATH_ROOT."/components/com_jshopping/tables/config.php");
+require_once(JPATH_ROOT."/components/com_jshopping/lib/functions.php");
 
 class JSFactory{
 
@@ -47,6 +48,13 @@
             if ($config->user_as_catalog){
                 $config->show_buy_in_category = 0;
             }
+            if (!$config->stock){
+                $config->hide_product_not_avaible_stock = 0;
+                $config->hide_buy_not_avaible_stock = 0;
+                $config->hide_text_product_not_available = 1;
+                $config->product_list_show_qty_stock = 0;
+                $config->product_show_qty_stock = 0;
+            }
 
             if ($config->hide_product_not_avaible_stock || $config->hide_buy_not_avaible_stock){
                 $config->controler_buy_qty = 1;
@@ -88,6 +96,13 @@
                 $config->show_tax_product_in_cart = 0;
                 $config->hide_tax = 1;
             }
+            if (!$config->admin_show_delivery_time){
+                $config->show_delivery_time = 0;
+                $config->show_delivery_time_checkout = 0;
+                $config->show_delivery_time_step5 = 0;
+                $config->display_delivery_time_for_product_in_order_mail = 0;
+                $config->show_delivery_date = 0;
+            }
 
             JPluginHelper::importPlugin('jshopping');
             $dispatcher = JDispatcher::getInstance();
@@ -134,7 +149,10 @@
         if (!$load){
             $document = JFactory::getDocument();
             $jshopConfig = JSFactory::getConfig();
-            $document->addStyleSheet(JURI::root().'components/com_jshopping/css/'.$jshopConfig->template.'.css');
+            $document->addStyleSheet(JURI::root().'components/com_jshopping/css/'.$jshopConfig->template.'.css');            
+            if (file_exists(JPATH_ROOT.'/components/com_jshopping/css/'.$jshopConfig->template.'.custom.css')){
+                $document->addStyleSheet(JURI::root().'components/com_jshopping/css/'.$jshopConfig->template.'.custom.css');
+            }
             $load = 1;
         }
     }
@@ -200,10 +218,10 @@
         if ($langtag==""){
             $langtag = $lang->getTag();
         }
-        if(file_exists(JPATH_ROOT . '/components/com_jshopping/lang/'.$langtag.'.php'))
-            require_once (JPATH_ROOT . '/components/com_jshopping/lang/'.$langtag.'.php');
+        if(file_exists(JPATH_ROOT.'/components/com_jshopping/lang/'.$langtag.'.php'))
+            require_once (JPATH_ROOT.'/components/com_jshopping/lang/'.$langtag.'.php');
         else 
-            require_once (JPATH_ROOT . '/components/com_jshopping/lang/en-GB.php');
+            require_once (JPATH_ROOT.'/components/com_jshopping/lang/en-GB.php');
     }
 
     public static function loadExtLanguageFile($extname, $langtag = ""){
@@ -211,10 +229,10 @@
         if ($langtag==""){
             $langtag = $lang->getTag();
         }
-        if(file_exists(JPATH_ROOT . '/components/com_jshopping/lang/'.$extname.'/'.$langtag.'.php'))
-            require_once (JPATH_ROOT . '/components/com_jshopping/lang/'.$extname.'/'.$langtag.'.php');
+        if(file_exists(JPATH_ROOT.'/components/com_jshopping/lang/'.$extname.'/'.$langtag.'.php'))
+            require_once (JPATH_ROOT.'/components/com_jshopping/lang/'.$extname.'/'.$langtag.'.php');
         else 
-            require_once (JPATH_ROOT . '/components/com_jshopping/lang/'.$extname.'/en-GB.php');
+            require_once (JPATH_ROOT.'/components/com_jshopping/lang/'.$extname.'/en-GB.php');
     }
 
     public static function loadAdminLanguageFile($langtag = ""){
@@ -222,10 +240,10 @@
         if ($langtag==""){
             $langtag = $lang->getTag();
         }
-        if(file_exists(JPATH_ROOT . '/administrator/components/com_jshopping/lang/'.$langtag.'.php'))
-            require_once (JPATH_ROOT . '/administrator/components/com_jshopping/lang/'.$langtag.'.php');
+        if(file_exists(JPATH_ROOT.'/administrator/components/com_jshopping/lang/'.$langtag.'.php'))
+            require_once (JPATH_ROOT.'/administrator/components/com_jshopping/lang/'.$langtag.'.php');
         else 
-            require_once (JPATH_ROOT . '/administrator/components/com_jshopping/lang/en-GB.php');            
+            require_once (JPATH_ROOT.'/administrator/components/com_jshopping/lang/en-GB.php');            
     }
 
     public static function loadExtAdminLanguageFile($extname, $langtag = ""){
@@ -233,10 +251,10 @@
         if ($langtag==""){
             $langtag = $lang->getTag();
         }
-        if(file_exists(JPATH_ROOT . '/administrator/components/com_jshopping/lang/'.$extname.'/'.$langtag.'.php'))
-            require_once (JPATH_ROOT . '/administrator/components/com_jshopping/lang/'.$extname.'/'.$langtag.'.php');
+        if(file_exists(JPATH_ROOT.'/administrator/components/com_jshopping/lang/'.$extname.'/'.$langtag.'.php'))
+            require_once (JPATH_ROOT.'/administrator/components/com_jshopping/lang/'.$extname.'/'.$langtag.'.php');
         else 
-            require_once (JPATH_ROOT . '/administrator/components/com_jshopping/lang/'.$extname.'/en-GB.php');
+            require_once (JPATH_ROOT.'/administrator/components/com_jshopping/lang/'.$extname.'/en-GB.php');
     }
 
     public static function getLang($langtag = ""){
@@ -371,11 +389,17 @@
                 $country_id = 0;
                 $adv_user = JSFactory::getUserShop();
                 $country_id = $adv_user->country;
+                if ($jshopConfig->tax_on_delivery_address && $adv_user->delivery_adress && $adv_user->d_country){
+                    $country_id = $adv_user->d_country;
+                }
                 $client_type = $adv_user->client_type;
                 $enter_tax_id = $adv_user->tax_number!="";
                 if (!$country_id){
                     $adv_user = JSFactory::getUserShopGuest();
                     $country_id = $adv_user->country;
+                    if ($jshopConfig->tax_on_delivery_address && $adv_user->delivery_adress && $adv_user->d_country){
+                        $country_id = $adv_user->d_country;
+                    }
                     $client_type = $adv_user->client_type;
                     $enter_tax_id = $adv_user->tax_number!="";
                 }
Index: Z:/home/jshop/INSTALL/pack/site/lib/functions.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/lib/functions.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/lib/functions.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.0 15.09.2012
+* @version      3.12.0 01.11.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -12,6 +12,7 @@
 include_once(dirname(__FILE__)."/shop_item_menu.php");
 
 function setMetaData($title, $keyword, $description, $params=null){
+    $config = JFactory::getConfig();
     $document =JFactory::getDocument();
     if ($title=='' && $params && $params->get('page_title')!=''){
         $title = $params->get('page_title');
@@ -22,6 +23,12 @@
     if ($description=='' && $params && $params->get('menu-meta_description')!=''){
         $description = $params->get('menu-meta_description');
     }
+    if ($config->get('sitename_pagetitles')==1){
+        $title = $config->get('sitename')." - ".$title;
+    }
+    if ($config->get('sitename_pagetitles')==2){
+        $title = $title." - ".$config->get('sitename');
+    }
     $document->setTitle($title);
     $document->setMetadata('keywords',$keyword);  
     $document->setMetadata('description',$description);
@@ -754,23 +761,57 @@
 return $rows;
 }
 
-function getPriceCalcParamsTax($price, $tax_id){
+function getPriceCalcParamsTax($price, $tax_id, $products=array()){
     $jshopConfig = JSFactory::getConfig();
-    
+    if ($jshopConfig->display_price_admin==$jshopConfig->display_price_front_current){
+        return $price;    
+    }    
     $taxes = JSFactory::getAllTaxes();
-    if ($tax_id){
+    if ($tax_id>0){
         $tax = $taxes[$tax_id];
+    }elseif ($tax_id==-1){
+        $prodtaxes = array();
+        foreach($products as $k=>$v){
+            if (!isset($prodtaxes[$v['tax']])) $prodtaxes[$v['tax']] = 0;
+            if ($jshopConfig->display_price_front_current==0){
+                $v['price'] = $v['price'] / (1+$v['tax']/100);
+            }
+            $prodtaxes[$v['tax']]+= $v['price']*$v['quantity'];
+        }        
+        
+        $sumproducts = array_sum($prodtaxes);        
+        foreach($prodtaxes as $k=>$v){
+            $prodtaxes[$k] = $v/$sumproducts;
+        }
+        $prices = array();
+        foreach($prodtaxes as $k=>$v){
+            $prices[] = array('tax'=>$k, 'price'=>$price*$v);
+        }
     }else{
         $taxlist = array_values($taxes);
         $tax = $taxlist[0];
-    }    
-    
+    }
+        
     if ($jshopConfig->display_price_admin == 1 && $jshopConfig->display_price_front_current == 0){
-        $price = $price * (1 + $tax / 100);
+        if ($tax_id==-1){
+            $price = 0;
+            foreach($prices as $v){
+                $price+= $v['price'] * (1 + $v['tax'] / 100);
+            }
+        }else{
+            $price = $price * (1 + $tax / 100);
+        }
     }
     if ($jshopConfig->display_price_admin == 0 && $jshopConfig->display_price_front_current == 1){
-        $price = $price / (1 + $tax / 100);
-    }   
+        if ($tax_id==-1){
+            $price = 0;
+            foreach($prices as $v){
+                $price+= $v['price'] / (1 + $v['tax'] / 100);
+            }
+        }else{
+            $price = $price / (1 + $tax / 100);
+        }
+    }
 return $price;
 }
 
@@ -850,7 +891,6 @@
 }
 
 function updateAllprices( $ignore = array() ){
-    
     $cart = JModel::getInstance('cart', 'jshop');
     $cart->load();
     $cart->updateCartProductPrice();
@@ -859,19 +899,16 @@
     if ($sh_pr_method_id){
         $shipping_method_price = JTable::getInstance('shippingMethodPrice', 'jshop');
         $shipping_method_price->load($sh_pr_method_id);
-        $price_shipping = $shipping_method_price->calculateSum($cart);
-        $cart->setShippingPrice($price_shipping);
-        $cart->setShippingPriceTax($shipping_method_price->calculateTax($price_shipping));
-        $cart->setShippingPriceTaxPercent($shipping_method_price->getTax());
+        $prices = $shipping_method_price->calculateSum($cart);
+        $cart->setShippingsDatas($prices, $shipping_method_price);
     }
     $payment_method_id = $cart->getPaymentId();
     if ($payment_method_id){
         $paym_method = JTable::getInstance('paymentmethod', 'jshop');
         $paym_method->load($payment_method_id);
         $paym_method->setCart($cart);
-        $cart->setPaymentPrice($paym_method->getPrice());
-        $cart->setPaymentTax($paym_method->calculateTax());
-        $cart->setPaymentTaxPercent($paym_method->getTax());
+        $price = $paym_method->getPrice();
+        $cart->setPaymentDatas($price, $paym_method);
     }
     
     $cart = JModel::getInstance('cart', 'jshop');
@@ -936,6 +973,14 @@
     return $data;
 }
 
+function getListFromStr($stelist){
+    if (preg_match('/\,/', $stelist)){
+        return filterAllowValue(explode(',',$stelist), 'int+');
+    }else{
+        return null;
+    }
+}
+
 function willBeUseFilter($filters){
     $res = 0;    
     if ($filters['price_from']>0) $res = 1;
@@ -1191,15 +1236,23 @@
     
     $categorys = $mainframe->getUserStateFromRequest( $contextfilter.'categorys', 'categorys', array());
     $categorys = filterAllowValue($categorys, "int+");
+    $tmpcd = getListFromStr(JRequest::getVar('category_id'));    
+    if (is_array($tmpcd) && !$categorys) $categorys = $tmpcd;
     
     $manufacturers = $mainframe->getUserStateFromRequest( $contextfilter.'manufacturers', 'manufacturers', array());
     $manufacturers = filterAllowValue($manufacturers, "int+");
+    $tmp = getListFromStr(JRequest::getVar('manufacturer_id'));    
+    if (is_array($tmp) && !$manufacturers) $manufacturers = $tmp;
     
     $labels = $mainframe->getUserStateFromRequest( $contextfilter.'labels', 'labels', array());
     $labels = filterAllowValue($labels, "int+");
+    $tmplb = getListFromStr(JRequest::getVar('label_id'));    
+    if (is_array($tmplb) && !$labels) $labels = $tmplb;
     
     $vendors = $mainframe->getUserStateFromRequest( $contextfilter.'vendors', 'vendors', array());
     $vendors = filterAllowValue($vendors, "int+");
+    $tmp = getListFromStr(JRequest::getVar('vendor_id'));    
+    if (is_array($tmp) && !$vendors) $vendors = $tmp;
     
     if ($jshopConfig->admin_show_product_extra_field){
         $extra_fields = $mainframe->getUserStateFromRequest( $contextfilter.'extra_fields', 'extra_fields', array());
@@ -1262,4 +1315,16 @@
 function xhtmlUrl($url){
 return str_replace("&","&amp;",$url);
 }
+
+function getCalculateDeliveryDay($day, $date=null){
+    if (!$date){
+        $date = date("Y-m-d H:i:s");
+    }
+    $time = intval(strtotime($date) + $day*86400);
+return date('Y-m-d H:i:s', $time);
+}
+
+function datenull($date){
+return (substr($date,0,1)=="0");
+} 
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/site/router.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/router.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/router.php	(revision 20)
@@ -8,7 +8,6 @@
 */
 defined('_JEXEC') or die('Restricted access');
 include_once(dirname(__FILE__)."/lib/factory.php");
-include_once(dirname(__FILE__)."/lib/functions.php");
 include_once(dirname(__FILE__)."/lib/shop_item_menu.php");
 
 function jshoppingBuildRoute(&$query){
Index: Z:/home/jshop/INSTALL/pack/site/loadparams.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/loadparams.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/loadparams.php	(revision 20)
@@ -1,19 +1,15 @@
 <?php
 /**
-* @version      3.10.0 24.08.2012
+* @version      3.12.0 24.08.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
 * @license      GNU/GPL
 */
 
-$session =JFactory::getSession();
+$session = JFactory::getSession();
 $ajax = JRequest::getInt('ajax');
 
-if ($GLOBALS["joomshoppinglangredirect"]){
-    redirectToThisPageThisLang(); //redirect after change language
-}
-
 if (!JRequest::getInt('no_lang')){
     JSFactory::loadLanguageFile();
 }
@@ -52,4 +48,7 @@
     //header for ajax
     header('Content-Type: text/html;charset=UTF-8');
 }
+JPluginHelper::importPlugin('jshopping');
+$dispatcher = JDispatcher::getInstance();
+$dispatcher->trigger('onAfterLoadShopParams', array());
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/site/tables/manufacturer.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/tables/manufacturer.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/tables/manufacturer.php	(revision 20)
@@ -31,6 +31,16 @@
         }		
 		return $list;
 	}
+    
+    function getList(){
+        $jshopConfig = JSFactory::getConfig();
+        if ($jshopConfig->manufacturer_sorting==2){
+            $morder = 'name';
+        }else{
+            $morder = 'ordering';
+        }
+    return $this->getAllManufacturers(1, $morder, 'asc');
+    }
 	
 	function getName() {
         $lang = JSFactory::getLang();
Index: Z:/home/jshop/INSTALL/pack/site/tables/category.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/tables/category.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/tables/category.php	(revision 20)
@@ -70,12 +70,14 @@
         $category_parent_id = $this->category_parent_id;
         $i = 0;
         $list_category = array();
+        $list_category[$i] = new stdClass();
         $list_category[$i]->category_id = $this->category_id;
         $list_category[$i]->name = $this->name;
         $i++;
         while($category_parent_id) {
             $category = JTable::getInstance('category', 'jshop');
             $category->load($category_parent_id);
+            $list_category[$i] = new stdClass();
             $list_category[$i]->category_id = $category->category_id;
             $list_category[$i]->name = $category->getName();
             $category_parent_id = $category->category_parent_id;
@@ -206,10 +208,16 @@
         if ($jshopConfig->hide_product_not_avaible_stock){
             $adv_query .= " AND prod.product_quantity > 0";
         }
+        if ($jshopConfig->manufacturer_sorting==2){
+            $order = 'name';
+        }else{
+            $order = 'man.ordering';
+        }
+        
         $query = "SELECT distinct man.manufacturer_id as id, man.`".$lang->get('name')."` as name FROM `#__jshopping_products` AS prod
                   LEFT JOIN `#__jshopping_products_to_categories` AS categ USING (product_id)
                   LEFT JOIN `#__jshopping_manufacturers` as man on prod.product_manufacturer_id=man.manufacturer_id 
-                  WHERE categ.category_id = '".$this->_db->escape($this->category_id)."' AND prod.product_publish = '1' AND prod.product_manufacturer_id!=0 ".$adv_query." order by name";
+                  WHERE categ.category_id = '".$this->_db->escape($this->category_id)."' AND prod.product_publish = '1' AND prod.product_manufacturer_id!=0 ".$adv_query." order by ".$order;
         $this->_db->setQuery($query);
         $list = $this->_db->loadObjectList();
         return $list;
Index: Z:/home/jshop/INSTALL/pack/site/tables/product.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/tables/product.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/tables/product.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.9.1 20.07.2012
+* @version      3.12.0 07.11.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -17,7 +17,7 @@
         $jshopConfig = JSFactory::getConfig();
         $this->attribute_active = $attribs;
         if (is_array($this->attribute_active) && count($this->attribute_active)){
-            
+            $this->attribute_active_data = new stdClass();
             $allattribs = JSFactory::getAllAttributes(1);
             $dependent_attr = array();
             $independent_attr = array();
@@ -400,7 +400,68 @@
         $this->category_id = $this->_db->loadResult();
         return $this->category_id;
     }
+
+    function getFullQty(){
+        if ($this->unlimited) return 1;
+        $db = JFactory::getDBO();
+        $query = "select count(*) as countattr, SUM(count) AS qty from `#__jshopping_products_attr` where product_id='".$db->escape($this->product_id)."'";
+        $db->setQuery($query);
+        $tmp = $db->loadObject();
+        if ($tmp->countattr>0){
+            return $tmp->qty;
+        }else{
+            return $this->product_quantity;
+        }
+    }
     
+    function getMinimumPrice(){
+        $jshopConfig = JSFactory::getConfig();
+        $db = JFactory::getDBO();
+        $min_price = $this->product_price;
+
+        $query = "select count(*) as countattr, MIN(price) AS min_price from `#__jshopping_products_attr` where product_id='".$db->escape($this->product_id)."'";
+        $db->setQuery($query);
+        $tmp = $db->loadObject();
+        if ($tmp->countattr>0){
+            $min_price = $tmp->min_price;
+        }
+        
+        $query = "select * from `#__jshopping_products_attr2` where product_id='".$db->escape($this->product_id)."'";
+        $db->setQuery($query);
+        $product_attr_ind = $db->loadObjectList();
+        if ($product_attr_ind){
+            $tmpprice = array();
+            foreach($product_attr_ind as $key=>$val){
+                if ($val->price_mod=="+"){
+                    $tmpprice[] = $min_price + $val->addprice;
+                }elseif ($val->price_mod=="-"){
+                    $tmpprice[] = $min_price - $val->addprice;
+                }elseif ($val->price_mod=="*"){
+                    $tmpprice[] = $min_price * $val->addprice;
+                }elseif ($val->price_mod=="/"){
+                    $tmpprice[] = $min_price / $val->addprice;
+                }elseif ($val->price_mod=="%"){
+                    $tmpprice[] = $min_price * $val->addprice / 100;
+                }elseif ($val->price_mod=="="){
+                    $tmpprice[] = $val->addprice;
+                }
+            }
+            $min_price = min($tmpprice);
+        }
+
+        $query = "select MAX(discount) as max_discount from `#__jshopping_products_prices` where product_id='".$db->escape($this->product_id)."'";
+        $db->setQuery($query);
+        $max_discount = $db->loadResult();
+        if ($max_discount){
+            if ($jshopConfig->product_price_qty_discount == 1){
+                $min_price = $min_price - $max_discount;
+            }else{
+                $min_price = $min_price - ($min_price * $max_discount / 100);
+            }
+        }
+        return $min_price;
+    }
+    
     function getExtendsData() {
         $this->getRelatedProducts();
         $this->getDescription();
@@ -890,6 +951,7 @@
         foreach($attrib as $k=>$v){
             $attr_id = $v->attr_id;
             if ($attributeValues[$attr_id]){
+                $selects[$attr_id] = new stdClass();
                 $selects[$attr_id]->attr_id = $attr_id;
                 $selects[$attr_id]->attr_name = $v->name;
                 $selects[$attr_id]->attr_description = $v->description;
@@ -919,6 +981,7 @@
                     }
 
                     $selects[$attr_id]->selects = JHTML::_('select.genericlist', $options, 'jshop_attr_id['.$attr_id.']','class = "inputbox" size = "1" onchange="setAttrValue(\''.$attr_id.'\', this.value);"','val_id','value_name', $attributeActive[$attr_id])."<span class='prod_attr_img'>".$this->getHtmlDisplayProdAttrImg($attr_id, $attrimage[$attributeActive[$attr_id]])."</span>";
+                    $selects[$attr_id]->selects = str_replace(array("\n","\r","\t"), "", $selects[$attr_id]->selects);
                 }else{
                 // attribut type radio
                 
@@ -942,6 +1005,7 @@
                     }
 
                     $selects[$attr_id]->selects = sprintRadioList($options, 'jshop_attr_id['.$attr_id.']','onclick="setAttrValue(\''.$attr_id.'\', this.value);"','val_id','value_name', $attributeActive[$attr_id]);
+                    $selects[$attr_id]->selects = str_replace(array("\n","\r","\t"), "", $selects[$attr_id]->selects);
                 }
                 $dispatcher->trigger('onBuildSelectAttribute', array(&$attributeValues, &$attributeActive, &$selects, &$options, &$attr_id, &$v));
             }
Index: Z:/home/jshop/INSTALL/pack/site/tables/shippingmethodprice.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/tables/shippingmethodprice.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/tables/shippingmethodprice.php	(revision 20)
@@ -1,19 +1,13 @@
 <?php
 /**
-* @version      3.3.0 20.12.2011
+* @version      3.12.0 20.12.2011
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
 * @license      GNU/GPL
 */
 
-class jshopShippingMethodPrice extends JTable {
-    
-    var $sh_pr_method_id = null;
-    var $shipping_method_id = null;
-    var $shipping_stand_price = null;
-    var $shipping_tax_id = null;
-    var $params = null;
+class jshopShippingMethodPrice extends JTable{
 
     function __construct( &$_db ){
         parent::__construct( '#__jshopping_shipping_method_price', 'sh_pr_method_id', $_db );
@@ -22,7 +16,6 @@
     function getPricesWeight($sh_pr_method_id, $id_country) {
         $db = JFactory::getDBO();
         $jshopConfig = JSFactory::getConfig();
-
         $query = "SELECT (sh_pr_weight.shipping_price + sh_pr_weight.shipping_package_price) AS shipping_price, sh_pr_weight.shipping_weight_from, sh_pr_weight.shipping_weight_to, sh_price.shipping_tax_id
                   FROM `#__jshopping_shipping_method_price` AS sh_price
                   INNER JOIN `#__jshopping_shipping_method_price_weight` AS sh_pr_weight ON sh_pr_weight.sh_pr_method_id = sh_price.sh_pr_method_id
@@ -51,52 +44,157 @@
         $query = "SELECT sh_country.country_id, countries.`".$lang->get('name')."` as name
                   FROM `#__jshopping_shipping_method_price_countries` AS sh_country
                   INNER JOIN `#__jshopping_countries` AS countries ON countries.country_id = sh_country.country_id
-                  WHERE sh_country.sh_pr_method_id = '" . $this->_db->escape($this->sh_pr_method_id) . "'";
-        $this->_db->setQuery($query);        
+                  WHERE sh_country.sh_pr_method_id = '".$this->_db->escape($this->sh_pr_method_id)."'";
+        $this->_db->setQuery($query);
         return $this->_db->loadObjectList();
     }
 
-    function getTax(){        
-        $taxes = JSFactory::getAllTaxes();        
+    function getTax(){
+        $taxes = JSFactory::getAllTaxes();
         return $taxes[$this->shipping_tax_id];
     }
     
+    function getTaxPackage(){
+        $taxes = JSFactory::getAllTaxes();
+        return $taxes[$this->package_tax_id];
+    }
+    
     function getGlobalConfigPriceNull($cart){
         $jshopConfig = JSFactory::getConfig();
         return ($cart->getSum() >= ($jshopConfig->summ_null_shipping * $jshopConfig->currency_value) && $jshopConfig->summ_null_shipping > 0);
     }
 
-    function calculateSum(&$cart){        
+    function calculateSum(&$cart){
         $jshopConfig = JSFactory::getConfig();
         if ($this->getGlobalConfigPriceNull($cart)){
             return 0;
         }
-        
+
         $price = $this->shipping_stand_price;
-    
-        $extensions = JSFactory::getShippingExtList($this->shipping_method_id);        
+        $package = $this->package_stand_price;
+        $prices = array('shipping'=>$price,'package'=>$package);
+
+        $extensions = JSFactory::getShippingExtList($this->shipping_method_id);
         foreach($extensions as $extension){
-            $price = $extension->exec->getPrice($cart, $this->getParams(), $price, $extension, $this);
+            if (isset($extension->exec->version) && $extension->exec->version==2){
+                $prices = $extension->exec->getPrices($cart, $this->getParams(), $prices, $extension, $this);
+            }else{
+                $price = $extension->exec->getPrice($cart, $this->getParams(), $price, $extension, $this);
+                $prices = array('shipping'=>$price,'package'=>$package);
+            }
         }
 
-        $price = $price * $jshopConfig->currency_value;
-        $price = getPriceCalcParamsTax($price, $this->shipping_tax_id); 
-        return $price;
+        $prices['shipping'] = $prices['shipping'] * $jshopConfig->currency_value;
+        $prices['shipping'] = getPriceCalcParamsTax($prices['shipping'], $this->shipping_tax_id, $cart->products);
+        $prices['package'] = $prices['package'] * $jshopConfig->currency_value;
+        $prices['package'] = getPriceCalcParamsTax($prices['package'], $this->package_tax_id, $cart->products);
+    return $prices;
     }
 
-    function calculateTax($sum) {
+    function calculateTax($sum){
         $jshopConfig = JSFactory::getConfig();
         $pricetax = getPriceTaxValue($sum, $this->getTax(), $jshopConfig->display_price_front_current);
         return $pricetax;
     }
+    function calculateTaxPackage($sum){
+        $jshopConfig = JSFactory::getConfig();
+        $pricetax = getPriceTaxValue($sum, $this->getTaxPackage(), $jshopConfig->display_price_front_current);
+        return $pricetax;
+    }
+    
+    function getPriceTaxRatioForProducts($products){
+        $prodtaxes = array();
+        foreach($products as $k=>$v){
+            if (!isset($prodtaxes[$v['tax']])) $prodtaxes[$v['tax']] = 0;
+            $prodtaxes[$v['tax']]+= $v['price']*$v['quantity'];
+        }
+        $sumproducts = array_sum($prodtaxes);
+        foreach($prodtaxes as $k=>$v){
+            $prodtaxes[$k] = $v/$sumproducts;
+        }
+    return $prodtaxes;
+    }
+    
+    function getShipingPriceForTaxes($price, $cart){
+        if ($this->shipping_tax_id==-1){
+            $prodtaxes = $this->getPriceTaxRatioForProducts($cart->products);
+            $prices = array();
+            foreach($prodtaxes as $k=>$v){
+                $prices[$k] = $price*$v;
+            }
+        }else{
+            $prices = array();
+            $prices[$this->getTax()] = $price;
+        }
+    return $prices;
+    }
+    
+    function getPackegePriceForTaxes($price, $cart){
+        if ($this->package_tax_id==-1){
+            $prodtaxes = $this->getPriceTaxRatioForProducts($cart->products);
+            $prices = array();
+            foreach($prodtaxes as $k=>$v){
+                $prices[$k] = $price*$v;
+            }
+        }else{
+            $prices = array();
+            $prices[$this->getTaxPackage()] = $price;
+        }
+    return $prices;
+    }
 
-    /**
-    * check correct this shipping to country     
-    * @param int $id_country
-    */
+    function calculateShippingTaxList($price, $cart){
+        $jshopConfig = JSFactory::getConfig();
+        if ($this->shipping_tax_id==-1){
+            $prodtaxes = $this->getPriceTaxRatioForProducts($cart->products);
+            $prices = array();
+            foreach($prodtaxes as $k=>$v){
+                $prices[] = array('tax'=>$k, 'price'=>$price*$v);
+            }
+            $taxes = array();
+            if ($jshopConfig->display_price_front_current==0){
+                foreach($prices as $v){
+                    $taxes[$v['tax']] = $v['price']*$v['tax']/(100+$v['tax']);
+                }
+            }else{
+                foreach($prices as $v){
+                    $taxes[$v['tax']] = $v['price']*$v['tax']/100;
+                }
+            }    
+        }else{
+            $taxes = array();
+            $taxes[$this->getTax()] = $this->calculateTax($price);
+        }
+    return $taxes;
+    }
+    
+    function calculatePackageTaxList($price, $cart){
+        $jshopConfig = JSFactory::getConfig();
+        if ($this->package_tax_id==-1){
+            $prodtaxes = $this->getPriceTaxRatioForProducts($cart->products);
+            $prices = array();
+            foreach($prodtaxes as $k=>$v){
+                $prices[] = array('tax'=>$k, 'price'=>$price*$v);
+            }
+            $taxes = array();
+            if ($jshopConfig->display_price_front_current==0){
+                foreach($prices as $v){
+                    $taxes[$v['tax']] = $v['price']*$v['tax']/(100+$v['tax']);
+                }
+            }else{
+                foreach($prices as $v){
+                    $taxes[$v['tax']] = $v['price']*$v['tax']/100;
+                }
+            }    
+        }else{
+            $taxes = array();
+            $taxes[$this->getTaxPackage()] = $this->calculateTaxPackage($price);
+        }
+    return $taxes;
+    }
+
     function isCorrectMethodForCountry($id_country) {
-        $query = "SELECT `sh_method_country_id` FROM `#__jshopping_shipping_method_price_countries`
-                  WHERE `country_id` = '" . $this->_db->escape($id_country) . "' AND `sh_pr_method_id` = '" . $this->_db->escape($this->sh_pr_method_id) . "'";
+        $query = "SELECT `sh_method_country_id` FROM `#__jshopping_shipping_method_price_countries` WHERE `country_id` = '".$this->_db->escape($id_country)."' AND `sh_pr_method_id` = '".$this->_db->escape($this->sh_pr_method_id)."'";
         $this->_db->setQuery($query);
         $this->_db->query();
         return ($this->_db->getNumRows())?(1):(0);
@@ -113,6 +211,5 @@
             return unserialize($this->params);
         }
     }
-
 }
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/site/tables/config.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/tables/config.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/tables/config.php	(revision 20)
@@ -179,5 +179,10 @@
             }
         }
     }
+	
+	function getVersion(){       
+        $data = JApplicationHelper::parseXMLInstallFile($this->admin_path."jshopping.xml");
+        return $data['version'];
+    }
 }
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/site/tables/usershop.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/tables/usershop.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/tables/usershop.php	(revision 20)
@@ -455,7 +455,7 @@
         return 1;
     }
     
-    function getError(){
+    function getError($i = null, $toString = true){
         return $this->_error;
     }
     
Index: Z:/home/jshop/INSTALL/pack/site/tables/order.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/tables/order.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/tables/order.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.9.1 20.08.2012
+* @version      3.12.0 20.08.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -10,7 +10,7 @@
 class jshopOrder extends JTable {
 
     function __construct( &$_db ){
-        parent::__construct( '#__jshopping_orders', 'order_id', $_db );
+        parent::__construct('#__jshopping_orders', 'order_id', $_db);
     }
 
     function getAllItems(){
@@ -139,6 +139,33 @@
         $this->order_tax_ext = serialize($array);
     }
     
+    function setShippingTaxExt($array){
+        $this->shipping_tax_ext = serialize($array);
+    }
+    
+    function getShippingTaxExt(){
+        if ($this->shipping_tax_ext == "") return array();
+        return unserialize($this->shipping_tax_ext);
+    }
+    
+    function setPackageTaxExt($array){
+        $this->package_tax_ext = serialize($array);
+    }
+    
+    function getPackageTaxExt(){
+        if ($this->shipping_tax_ext == "") return array();
+        return unserialize($this->package_tax_ext);
+    }
+
+    function setPaymentTaxExt($array){
+        $this->payment_tax_ext = serialize($array);
+    }
+    
+    function getPaymentTaxExt(){
+        if ($this->payment_tax_ext == "") return array();
+        return unserialize($this->payment_tax_ext);
+    }
+    
     function getPaymentParamsData(){
         if ($this->payment_params_data == "") return array();
         return unserialize($this->payment_params_data);
Index: Z:/home/jshop/INSTALL/pack/site/tables/paymentmethod.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/tables/paymentmethod.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/tables/paymentmethod.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.3.0 18.04.2011
+* @version      3.12.0 18.04.2011
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -38,27 +38,28 @@
         $this->_cart = $cart;
     }
     
-    function &getCart(){
+    function getCart(){
         return $this->_cart;
     }
     
     function getPrice(){
         $jshopConfig = JSFactory::getConfig();
         if ($this->price_type==2){
-            $cart = &$this->getCart();
-            $price = $cart->getSummForCalculePlusPayment() * $this->price / 100;            
+            $cart = $this->getCart();
+            $price = $cart->getSummForCalculePlusPayment() * $this->price / 100;
             if ($jshopConfig->display_price_front_current){
-                $price = $price / (1 + $this->getTax() / 100);
+                $price = getPriceCalcParamsTax($price, $this->tax_id, $cart->products);
             }
         }else{
+            $cart = $this->getCart();
             $price = $this->price * $jshopConfig->currency_value; 
-            $price = getPriceCalcParamsTax($price, $this->tax_id);
+            $price = getPriceCalcParamsTax($price, $this->tax_id, $cart->products);
         }
         return $price;
     }
     
-    function getTax(){        
-        $taxes = JSFactory::getAllTaxes();        
+    function getTax(){
+        $taxes = JSFactory::getAllTaxes();
         return $taxes[$this->tax_id];
     }
     
@@ -69,6 +70,60 @@
         return $pricetax;
     }
     
+    function getPriceTaxRatioForProducts($products){
+        $prodtaxes = array();
+        foreach($products as $k=>$v){
+            if (!isset($prodtaxes[$v['tax']])) $prodtaxes[$v['tax']] = 0;
+            $prodtaxes[$v['tax']]+= $v['price']*$v['quantity'];
+        }
+        $sumproducts = array_sum($prodtaxes);
+        foreach($prodtaxes as $k=>$v){
+            $prodtaxes[$k] = $v/$sumproducts;
+        }
+    return $prodtaxes;
+    }
+    
+    function getPriceForTaxes($price){
+        if ($this->tax_id==-1){
+            $cart = $this->getCart();
+            $prodtaxes = $this->getPriceTaxRatioForProducts($cart->products);
+            $prices = array();
+            foreach($prodtaxes as $k=>$v){
+                $prices[$k] = $price*$v;
+            }
+        }else{
+            $prices = array();
+            $prices[$this->getTax()] = $price;
+        }
+    return $prices;
+    }
+    
+    function calculateTaxList($price){
+        $cart = $this->getCart();
+        $jshopConfig = JSFactory::getConfig();
+        if ($this->tax_id==-1){
+            $prodtaxes = $this->getPriceTaxRatioForProducts($cart->products);
+            $prices = array();
+            foreach($prodtaxes as $k=>$v){
+                $prices[] = array('tax'=>$k, 'price'=>$price*$v);
+            }
+            $taxes = array();
+            if ($jshopConfig->display_price_front_current==0){
+                foreach($prices as $v){
+                    $taxes[$v['tax']] = $v['price']*$v['tax']/(100+$v['tax']);
+                }
+            }else{
+                foreach($prices as $v){
+                    $taxes[$v['tax']] = $v['price']*$v['tax']/100;
+                }
+            }    
+        }else{
+            $taxes = array();
+            $taxes[$this->getTax()] = $this->calculateTax();
+        }        
+    return $taxes;
+    }
+    
     /**
     * static
     * get config payment for classname
Index: Z:/home/jshop/INSTALL/pack/site/js/functions.js
===================================================================
--- Z:/home/jshop/INSTALL/pack/site/js/functions.js	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/site/js/functions.js	(revision 20)
@@ -277,6 +277,14 @@
         i++;
     }
     
+    if (register_field_require.privacy_statement){
+        arrayId[i] = 'privacy_statement';
+        arrayType[i] = 'chk';
+        arrayParams[i] = '';
+        arrayErrorMessages[i] = '';
+        i++;
+    }
+    
 	var myForm = new validateForm(formName, arrayId, arrayType, arrayParams, arrayErrorMessages, 2);
 	var error = (myForm.validate()) ? (1) : (0);
 	if (!error){
@@ -475,6 +483,14 @@
         arrayErrorMessages[i] = '';
         i++;
     }
+    
+    if (register_field_require.privacy_statement){
+        arrayId[i] = 'privacy_statement';
+        arrayType[i] = 'chk';
+        arrayParams[i] = '';
+        arrayErrorMessages[i] = '';
+        i++;
+    }
         
     if ($_('delivery_adress_2')){
         if ($F_('delivery_adress_2')){
@@ -822,6 +838,14 @@
         arrayErrorMessages[i] = '';
         i++;
     }
+    
+    if (register_field_require.privacy_statement){
+        arrayId[i] = 'privacy_statement';
+        arrayType[i] = 'chk';
+        arrayParams[i] = '';
+        arrayErrorMessages[i] = '';
+        i++;
+    }
         
     if ($_('delivery_adress_2')){
         if ($F_('delivery_adress_2')){
Index: Z:/home/jshop/INSTALL/pack/admin/lang/ru-RU.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/lang/ru-RU.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/lang/ru-RU.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.4 28.04.2012
+* @version      3.12.0 28.04.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -288,6 +288,7 @@
 define('_JSHOP_VIDEO_PRODUCT_HEIGHT','Высота видео товара');
 define('_JSHOP_SHOW_BAY_BUT_IN_CAT','Показать кнопку купить для списка товаров');
 define('_JSHOP_ORDER_EMAIL_DESCR','Описание заказа для клиента (в E-mail)');
+define('_JSHOP_ORDER_EMAIL_DESCR_END','Описание заказа для клиента (в E-mail, конец)');
 define('_JSHOP_USER_AS_CATALOG','Использовать как каталог');
 define('_JSHOP_SHOW_TAX','Показать НДС');
 define('_JSHOP_SHOW_TAX_IN_CART','Показать НДС для товаров в корзине');
@@ -865,6 +866,7 @@
 define('_JSHP_SEOPAGE_topratingproducts',"Топ рейтинг продукты");
 define('_JSHP_SEOPAGE_tophitsproducts',"Наиболее просматриваемые продукты");
 define('_JSHP_SEOPAGE_all-products',"Все продукты");
+define('_JSHP_SEOPAGE_content-privacy_statement',"Заявление о конфиденциальности");
 
 //static text
 define('_JSHP_STPAGE_home', "Главная страница (Главная категория)");
@@ -872,10 +874,13 @@
 define('_JSHP_STPAGE_agb', "Условия предоставления услуг");
 define('_JSHP_STPAGE_return_policy', "Условия возврата");
 define('_JSHP_STPAGE_order_email_descr', "Описание заказа для клиента (в E-mail)");
+define('_JSHP_STPAGE_order_email_descr_end', "Описание заказа для клиента (в E-mail, конец)");
 define('_JSHP_STPAGE_INFO_order_email_descr', "Допускается использовать переменные {name}, {family}, {email}");
+define('_JSHP_STPAGE_INFO_order_email_descr_end', "Допускается использовать переменные {name}, {family}, {email}");
 define('_JSHP_STPAGE_order_finish_descr', 'Страница "Заказ завершен"');
 define('_JSHP_STPAGE_shipping', "Описание доставки");
 define('_JSHP_STPAGE_INFO_shipping', 'Для опции товара: Показать "плюс доставка"');
+define('_JSHP_STPAGE_privacy_statement',"Заявление о конфиденциальности");
 
 define('_JSHOP_ATTRIBUTE_EXTEND_PARAMS','Дополнительные значения');
 define('_JSHOP_SHOW_DEFAULT_PRICE','Показывать цену без скидки');
@@ -946,6 +951,7 @@
 define('_JSHOP_OC_load_jquery_lightbox','Использовать Lightbox');
 define('_JSHOP_OC_load_css','Использовать CSS');
 define('_JSHOP_OC_load_javascript','Загружать javascript');
+define('_JSHOP_OC_tax_on_delivery_address','Налог на адрес доставки');
 
 define('_JSHOP_SHOW_EXTRA_FIELDS_CART','Показать характеристики в Корзине');
 define('_JSHOP_OVERRIDING_ADDRESSES','Переопределение адресов');
@@ -960,5 +966,14 @@
 define('_JSHOP_SHOW_SHIPPING_IN_INVOICE','Доставка в счет-фактуре');
 define('_JSHOP_SHOW_PAYMENT_IN_INVOICE','Оплата в счет-фактуре');
 define('_JSHOP_INVOICE_DATE','Дата счета-фактуры');
+define('_JSHOP_FIELD_PRIVACY_STATEMENT','Заявление о конфиденциальности');
+define('_JSHOP_DELETE_ALL_DATA','Все данные будут удалены. Удалить?');
+define('_JSHOP_NUMERIC','Числовой');
+define('_JSHOP_PRODUCT_TAX_RATE','Налоговая ставка продукта');
+define('_JSHOP_PACKAGE_TAX', 'Налог на упаковку');
+define('_JSHOP_USE_OLD_VALUE_PRICE', 'Use old value of price');
+define('_JSHOP_SHOW_DELIVERY_DATE', 'Показать "Дата поставки"');
+define('_JSHOP_DELIVERY_DATE','Дата поставки');
+define('_JSHOP_STOCK','Склад');
 
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/admin/lang/de-DE.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/lang/de-DE.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/lang/de-DE.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.4 14.02.2012
+* @version      3.12.0 14.02.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -296,6 +296,7 @@
 define('_JSHOP_VIDEO_PRODUCT_HEIGHT','Höhe für Video-Größe');
 define('_JSHOP_SHOW_BAY_BUT_IN_CAT','Anzeigen des Link "Kaufen"');
 define('_JSHOP_ORDER_EMAIL_DESCR','Beschreibung des Auftrags für den Kunden (in E-Mail)');
+define('_JSHOP_ORDER_EMAIL_DESCR_END','Beschreibung des Auftrags für den Kunden (in E-Mail, Ende)');
 define('_JSHOP_USER_AS_CATALOG','Verwendung des Shop als Katalog');
 define('_JSHOP_SHOW_TAX','"Steuersätze" anzeigen');
 define('_JSHOP_SHOW_TAX_IN_CART','Die Steuersätze der Produkte im Warenkorb anzeigen');
@@ -870,6 +871,7 @@
 define('_JSHP_SEOPAGE_topratingproducts',"Top-Bewertung Produkte");
 define('_JSHP_SEOPAGE_tophitsproducts',"Top-Hits Produkte");
 define('_JSHP_SEOPAGE_all-products',"Alle Produkte");
+define('_JSHP_SEOPAGE_content-privacy_statement',"Datenschutzerklärung");
 
 //static text
 define('_JSHP_STPAGE_home', "Main page (main category)");
@@ -877,10 +879,13 @@
 define('_JSHP_STPAGE_agb', "AGB");
 define('_JSHP_STPAGE_return_policy', "Rückgaberecht");
 define('_JSHP_STPAGE_order_email_descr', "Beschreibung des Auftrags für den Kunden (in E-Mail)");
+define('_JSHP_STPAGE_order_email_descr_end', "Beschreibung des Auftrags für den Kunden (in E-Mail, Ende)");
 define('_JSHP_STPAGE_INFO_order_email_descr', "erlaubt use vars {name}, {family}, {email}");
+define('_JSHP_STPAGE_INFO_order_email_descr_end', "erlaubt use vars {name}, {family}, {email}");
 define('_JSHP_STPAGE_order_finish_descr', 'Seite "Auftrag beenden"');
 define('_JSHP_STPAGE_shipping', "Versandkosten Hinweistext");
 define('_JSHP_STPAGE_INFO_shipping', 'Text wird angezeigt, wenn die Option: "Versandkosten" anzeigen, im Bereich Kategorien/Produkte, aktiv ist.');
+define('_JSHP_STPAGE_privacy_statement',"Datenschutzerklärung");
 
 define('_JSHOP_ATTRIBUTE_EXTEND_PARAMS','Weitere Werte');
 define('_JSHOP_SHOW_DEFAULT_PRICE','Anzeigen Preis für Basic-Mitglieder');
@@ -951,6 +956,7 @@
 define('_JSHOP_OC_load_jquery_lightbox', 'Load Lightbox');
 define('_JSHOP_OC_load_css', 'Load css');
 define('_JSHOP_OC_load_javascript','Load javascript');
+define('_JSHOP_OC_tax_on_delivery_address','Steuer auf Zustelladresse');
 
 define('_JSHOP_SHOW_EXTRA_FIELDS_CART','Produktcharakteristik anzeigen (Warenkorb)');
 define('_JSHOP_OVERRIDING_ADDRESSES','Overriding Addresses');
@@ -965,5 +971,14 @@
 define('_JSHOP_SHOW_SHIPPING_IN_INVOICE','Versand in Rechnung');
 define('_JSHOP_SHOW_PAYMENT_IN_INVOICE','Zahlung in Rechnung');
 define('_JSHOP_INVOICE_DATE','Rechnungs-Datum');
+define('_JSHOP_FIELD_PRIVACY_STATEMENT','Datenschutzerklärung');
+define('_JSHOP_DELETE_ALL_DATA','Alle Daten werden gelöscht. Löschen?');
+define('_JSHOP_NUMERIC','numerisch');
+define('_JSHOP_PRODUCT_TAX_RATE','Steuersatz Produkt');
+define('_JSHOP_PACKAGE_TAX', 'Paket Mwst');
+define('_JSHOP_USE_OLD_VALUE_PRICE', 'Use old value of price');
+define('_JSHOP_SHOW_DELIVERY_DATE', '"Lieferdatum" anzeigen');
+define('_JSHOP_DELIVERY_DATE','Lieferdatum');
+define('_JSHOP_STOCK','Lager');
 
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/admin/lang/en-GB.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/lang/en-GB.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/lang/en-GB.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.4 31.10.2011
+* @version      3.12.0 31.10.2011
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -162,7 +162,6 @@
 define('_JSHOP_EDIT_TAX_EXT', 'Edit rule Tax');
 define('_JSHOP_NEW_TAX_EXT', 'New rule Tax');
 
-
 // Messages
 define('_JSHOP_WRITE_PRODUCTS_ROW','Enter amount of products in row');
 define('_JSHOP_WRITE_PRODUCTS_PAGE','Enter amount of products on page');
@@ -295,6 +294,7 @@
 define('_JSHOP_VIDEO_PRODUCT_HEIGHT','Product video height');
 define('_JSHOP_SHOW_BAY_BUT_IN_CAT','Show buy button in a product list');
 define('_JSHOP_ORDER_EMAIL_DESCR','Description of the order for the customer (in email)');
+define('_JSHOP_ORDER_EMAIL_DESCR_END','Description of the order for the customer (in email, end)');
 define('_JSHOP_USER_AS_CATALOG','Use as catalog');
 define('_JSHOP_SHOW_TAX','Show tax');
 define('_JSHOP_SHOW_TAX_IN_CART','Show product tax in cart');
@@ -859,6 +859,7 @@
 define('_JSHP_SEOPAGE_topratingproducts',"Top rating products");
 define('_JSHP_SEOPAGE_tophitsproducts',"Top hits products");
 define('_JSHP_SEOPAGE_all-products',"All products");
+define('_JSHP_SEOPAGE_content-privacy_statement',"Privacy statement");
 
 //static text
 define('_JSHP_STPAGE_home', "Main page (main category)");
@@ -866,15 +867,18 @@
 define('_JSHP_STPAGE_agb', "Terms of Service");
 define('_JSHP_STPAGE_return_policy', "Return policy");
 define('_JSHP_STPAGE_order_email_descr', "Description of the order for the customer (in email)");
+define('_JSHP_STPAGE_order_email_descr_end', "Description of the order for the customer (in email end)");
 define('_JSHP_STPAGE_INFO_order_email_descr', "allowed use vars {name}, {family}, {email}");
+define('_JSHP_STPAGE_INFO_order_email_descr_end', "allowed use vars {name}, {family}, {email}");
 define('_JSHP_STPAGE_order_finish_descr', 'Page "Order finish"');
 define('_JSHP_STPAGE_shipping', "Shipping description");
 define('_JSHP_STPAGE_INFO_shipping', 'For the product option: Show "plus shipping"');
+define('_JSHP_STPAGE_privacy_statement',"Privacy statement");
 
 define('_JSHOP_ATTRIBUTE_EXTEND_PARAMS','Additional values');
 define('_JSHOP_SHOW_DEFAULT_PRICE','Show Price for Basic members');
 define('_JSHOP_QTY_IN_STOCK','Quantity in stock');
-define('_JSHOP_TYPE','Typ');
+define('_JSHOP_TYPE','Type');
 define('_JSHOP_LIST','List');
 define('_JSHOP_TEXT','Text');
 define('_JSHOP_ACCESS','Access');
@@ -940,6 +944,7 @@
 define('_JSHOP_OC_load_jquery_lightbox', 'Load Lightbox');
 define('_JSHOP_OC_load_css', 'Load css');
 define('_JSHOP_OC_load_javascript','Load javascript');
+define('_JSHOP_OC_tax_on_delivery_address','Tax on delivery address');
 
 define('_JSHOP_SHOW_EXTRA_FIELDS_CART','Show Characteristics in cart');
 define('_JSHOP_OVERRIDING_ADDRESSES','Overriding Addresses');
@@ -954,5 +959,14 @@
 define('_JSHOP_SHOW_SHIPPING_IN_INVOICE','Shipping in invoice');
 define('_JSHOP_SHOW_PAYMENT_IN_INVOICE','Payment in invoice');
 define('_JSHOP_INVOICE_DATE','Invoice Date');
+define('_JSHOP_FIELD_PRIVACY_STATEMENT','Privacy Statement');
+define('_JSHOP_DELETE_ALL_DATA','All data will be deleted. Delete?');
+define('_JSHOP_NUMERIC','Numeric');
+define('_JSHOP_PRODUCT_TAX_RATE','Tax rate product');
+define('_JSHOP_PACKAGE_TAX', 'Package Tax');
+define('_JSHOP_USE_OLD_VALUE_PRICE', 'Use old value of price');
+define('_JSHOP_SHOW_DELIVERY_DATE', 'Show "Delivery date"');
+define('_JSHOP_DELIVERY_DATE','Delivery date');
+define('_JSHOP_STOCK','Stock');
 
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/admin/models/attributvalue.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/attributvalue.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/attributvalue.php	(revision 20)
@@ -20,10 +20,14 @@
         return $db->loadResult();
     }
 
-    function getAllValues($attr_id) {
+    function getAllValues($attr_id, $order = null, $orderDir = null) {
         $db = JFactory::getDBO(); 
         $lang = JSFactory::getLang();
-        $query = "SELECT value_id, image, `".$lang->get("name")."` as name, attr_id, value_ordering FROM `#__jshopping_attr_values` where attr_id='".$attr_id."' ORDER BY value_ordering, value_id";
+        $ordering = 'value_ordering, value_id';
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
+        $query = "SELECT value_id, image, `".$lang->get("name")."` as name, attr_id, value_ordering FROM `#__jshopping_attr_values` where attr_id='".$attr_id."' ORDER BY ".$ordering;
         $db->setQuery($query);
         return $db->loadObjectList();
     }
@@ -58,7 +62,6 @@
             return $attribs;
         }        
     }
-    
 }
 
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/admin/models/attribut.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/attribut.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/attribut.php	(revision 20)
@@ -20,10 +20,14 @@
         return $db->loadResult();
     }
     
-    function getAllAttributes($result = 0, $categorys = null){
+    function getAllAttributes($result = 0, $categorys = null, $order = null, $orderDir = null){
         $lang = JSFactory::getLang();
         $db = JFactory::getDBO(); 
-        $query = "SELECT attr_id, `".$lang->get("name")."` as name, attr_type, attr_ordering, independent, allcats, cats FROM `#__jshopping_attr` ORDER BY attr_ordering";
+        $ordering = "attr_ordering asc";
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
+        $query = "SELECT attr_id, `".$lang->get("name")."` as name, attr_type, attr_ordering, independent, allcats, cats FROM `#__jshopping_attr` ORDER BY ".$ordering;
         $db->setQuery($query);
         $list = $db->loadObjectList();
                 
Index: Z:/home/jshop/INSTALL/pack/admin/models/freeattribut.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/freeattribut.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/freeattribut.php	(revision 20)
@@ -20,10 +20,14 @@
         return $db->loadResult();
     }
     
-    function getAll() {
+    function getAll($order = null, $orderDir = null) {
         $lang = JSFactory::getLang();
         $db = JFactory::getDBO(); 
-        $query = "SELECT id, `".$lang->get("name")."` as name, ordering, required FROM `#__jshopping_free_attr` ORDER BY ordering";
+        $ordering = 'ordering';
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
+        $query = "SELECT id, `".$lang->get("name")."` as name, ordering, required FROM `#__jshopping_free_attr` ORDER BY ".$ordering;
         $db->setQuery($query);        
         return $db->loadObjectList();
     }
Index: Z:/home/jshop/INSTALL/pack/admin/models/users.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/users.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/users.php	(revision 20)
@@ -43,5 +43,14 @@
         $db->setQuery($query);
         return $db->loadResult();
     }
+	
+	function getUsers() {
+		$db = JFactory::getDBO();
+		$query = "SELECT `user_id`, concat(`f_name`,' ',`l_name`) as `name`
+				  FROM `#__jshopping_users`
+				  ORDER BY `f_name`, `l_name`";
+		$db->setQuery($query);
+		return $db->loadObjectList();
+	}
 }
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/admin/models/productlabels.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/productlabels.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/productlabels.php	(revision 20)
@@ -12,9 +12,14 @@
 
 class JshoppingModelProductLabels extends JModel{    
 
-    function getList(){
-        $db = JFactory::getDBO();            
-        $query = "SELECT * FROM `#__jshopping_product_labels` ORDER BY name";
+    function getList($order = null, $orderDir = null){
+        $db = JFactory::getDBO();
+        $ordering = "name";
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
+        
+        $query = "SELECT * FROM `#__jshopping_product_labels` ORDER BY ".$ordering;
         $db->setQuery($query);
         return $db->loadObjectList();
     }
Index: Z:/home/jshop/INSTALL/pack/admin/models/shippings.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/shippings.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/shippings.php	(revision 20)
@@ -19,30 +19,39 @@
         return JTable::getInstance('shippingMethod', 'jshop');
     }
 
-    function getAllShippings($publish = 1) {
+    function getAllShippings($publish = 1, $order = null, $orderDir = null) {
         $db = JFactory::getDBO(); 
         $query_where = ($publish)?("WHERE published = '1'"):("");
         $lang = JSFactory::getLang();
+        $ordering = 'ordering';
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
         $query = "SELECT shipping_id, `".$lang->get('name')."` as name, `".$lang->get("description")."` as description, published, ordering  
                   FROM `#__jshopping_shipping_method` 
                   $query_where 
-                  ORDER BY ordering";
+                  ORDER BY ".$ordering;
         $db->setQuery($query);
         return $db->loadObjectList();
     }
     
-    function getAllShippingPrices($publish = 1, $shipping_method_id = 0) {
+    function getAllShippingPrices($publish = 1, $shipping_method_id = 0, $order = null, $orderDir = null) {
         $db = JFactory::getDBO(); 
         $query_where = "";
         $query_where .= ($publish)?(" and shipping.published = '1'"):("");
         $query_where .= ($shipping_method_id)?(" and shipping_price.shipping_method_id= '".$shipping_method_id."'"):("");
         
+        $ordering = "shipping_price.sh_pr_method_id";
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
+        
         $lang = JSFactory::getLang();
         $query = "SELECT shipping_price.*, shipping.`".$lang->get('name')."` as name
                   FROM `#__jshopping_shipping_method_price` AS shipping_price
                   INNER JOIN `#__jshopping_shipping_method` AS shipping ON shipping.shipping_id = shipping_price.shipping_method_id
                   where (1=1) $query_where
-                  ORDER BY shipping_price.sh_pr_method_id";
+                  ORDER BY ".$ordering;
         $db->setQuery($query);
         return $db->loadObjectList();
     }
Index: Z:/home/jshop/INSTALL/pack/admin/models/productfieldvalues.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/productfieldvalues.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/productfieldvalues.php	(revision 20)
@@ -12,10 +12,14 @@
 
 class JshoppingModelProductFieldValues extends JModel{ 
 
-    function getList($field_id){
+    function getList($field_id, $order = null, $orderDir = null){
         $db = JFactory::getDBO();
         $lang = JSFactory::getLang(); 
-        $query = "SELECT id, `".$lang->get("name")."` as name, ordering FROM `#__jshopping_products_extra_field_values` where field_id='$field_id' order by ordering";
+        $ordering = 'ordering';
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
+        $query = "SELECT id, `".$lang->get("name")."` as name, ordering FROM `#__jshopping_products_extra_field_values` where field_id='$field_id' order by ".$ordering;
         $db->setQuery($query);
         return $db->loadObjectList();
     }
Index: Z:/home/jshop/INSTALL/pack/admin/models/statistic.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/statistic.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/statistic.php	(revision 20)
@@ -100,13 +100,13 @@
         $where="";
         if ($param=='1') $where = " WHERE us.`block`='0' ";
         if ($param=='2') $where = " WHERE s.`userid`!='' ";  
-        $query = "SELECT count(u.`user_id`) AS amount FROM  `#__jshopping_users` AS u 
+        $query = "SELECT u.`user_id` FROM  `#__jshopping_users` AS u 
         JOIN `#__users` AS us  ON us.`id` = u.`user_id` 
         LEFT JOIN `#__session` AS s ON s.`userid` = us.`id` 
-        ".$where; 
-
+        ".$where." GROUP BY u.`user_id`";
         $db->setQuery($query);
-        return $db->loadResult();                    
+		$db->query();
+        return $db->getNumRows();
     } 
     function getUsersStaffStatistics($param='') 
     {
Index: Z:/home/jshop/INSTALL/pack/admin/models/countries.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/countries.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/countries.php	(revision 20)
@@ -21,7 +21,7 @@
     * @param int $orderConfig use order config
     * @return array
     */
-    function getAllCountries($publish = 1, $limitstart = null, $limit = null, $orderConfig = 1){
+    function getAllCountries($publish = 1, $limitstart = null, $limit = null, $orderConfig = 1, $order = null, $orderDir = null){
         $db = JFactory::getDBO();
         $jshopConfig = JSFactory::getConfig();
                 
@@ -38,6 +38,9 @@
         }
         $ordering = "ordering";
         if ($orderConfig && $jshopConfig->sorting_country_in_alphabet) $ordering = "name";
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
         $lang = JSFactory::getLang();
         $query = "SELECT country_id, country_publish, ordering, country_code, country_code_2, `".$lang->get("name")."` as name FROM `#__jshopping_countries` ".$where." ORDER BY ".$ordering;
         $db->setQuery($query, $limitstart, $limit);
Index: Z:/home/jshop/INSTALL/pack/admin/models/usergroups.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/usergroups.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/usergroups.php	(revision 20)
@@ -12,9 +12,14 @@
 
 class JshoppingModelUsergroups extends JModel{ 
 
-    function getAllUsergroups(){
+    function getAllUsergroups($order = null, $orderDir = null){
+        $ordering = "usergroup_id";
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
+        
         $db = JFactory::getDBO(); 
-        $query = "SELECT * FROM `#__jshopping_usergroups`";
+        $query = "SELECT * FROM `#__jshopping_usergroups` ORDER BY ".$ordering;;
         $db->setQuery($query);
         return $db->loadObjectList();
     }
Index: Z:/home/jshop/INSTALL/pack/admin/models/manufacturers.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/manufacturers.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/manufacturers.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      2.0.0 31.07.2010
+* @version      3.12.0 10.11.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -10,15 +10,29 @@
 defined('_JEXEC') or die('Restricted access');
 jimport( 'joomla.application.component.model');
 
-class JshoppingModelManufacturers extends JModel{ 
-   
-    function getAllManufacturers($publish = 0) {
+class JshoppingModelManufacturers extends JModel{
+
+    function getAllManufacturers($publish=0, $order=null, $orderDir=null){
         $db = JFactory::getDBO();
         $lang = JSFactory::getLang(); 
-        $query_where = ($publish)?(" WHERE manufacturer_publish = '1'"):("");
-        $query = "SELECT *, `".$lang->get('name')."` as name FROM `#__jshopping_manufacturers` $query_where ORDER BY ordering";
+        $query_where = ($publish)?(" WHERE manufacturer_publish = '1'"):("");  
+		$queryorder = '';		
+        if ($order && $orderDir){
+            $queryorder = "order by ".$order." ".$orderDir;
+        }
+        $query = "SELECT manufacturer_id, manufacturer_url, manufacturer_logo, manufacturer_publish, ordering, `".$lang->get('name')."` as name FROM `#__jshopping_manufacturers` $query_where ".$queryorder;
         $db->setQuery($query);
         return $db->loadObjectList();
+    }
+    
+    function getList(){
+        $jshopConfig = JSFactory::getConfig();
+        if ($jshopConfig->manufacturer_sorting==2){
+            $morder = 'name';
+        }else{
+            $morder = 'ordering';
+        }
+    return $this->getAllManufacturers(0, $morder, 'asc');
     } 
       
 }
Index: Z:/home/jshop/INSTALL/pack/admin/models/reviews.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/reviews.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/reviews.php	(revision 20)
@@ -12,8 +12,7 @@
 
 class JshoppingModelReviews extends JModel{
     
-     function getAllReviews($category_id = null, $product_id = null, $limitstart = null, $limit = null, $text_search = null, $result = "list", $vendor_id = 0) {
-            
+     function getAllReviews($category_id = null, $product_id = null, $limitstart = null, $limit = null, $text_search = null, $result = "list", $vendor_id = 0, $order = null, $orderDir = null) {
         $lang = JSFactory::getLang();
         $db = JFactory::getDBO(); 
         $where = "";
@@ -24,19 +23,24 @@
             $limit = " LIMIT " . $limitstart . " , " . $limit;
         }
         $where .= ($text_search) ? ( " AND CONCAT_WS('|',pr.`".$lang->get('name')."`,pr.`".$lang->get('short_description')."`,pr.`".$lang->get('description')."`,pr_rew.review, pr_rew.user_name, pr_rew.user_email ) LIKE '%".$db->escape($text_search)."%' " ) : ('');
+        $ordering = 'pr_rew.review_id desc';
         
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
+
         if($category_id) {   
             $query = "select pr.`".$lang->get('name')."` as name,pr_rew.* , DATE_FORMAT(pr_rew.`time`,'%d.%m.%Y') as dateadd 
             from  #__jshopping_products_reviews as pr_rew
             LEFT JOIN #__jshopping_products  as pr USING (product_id)
             LEFT JOIN `#__jshopping_products_to_categories` AS pr_cat USING (product_id)
-            WHERE pr_cat.category_id = '" . $db->escape($category_id) . "' ".$where." ORDER BY pr_rew.review_id desc ". $limit;
+            WHERE pr_cat.category_id = '" . $db->escape($category_id) . "' ".$where." ORDER BY ". $ordering ." ". $limit;
         }
         else {
             $query = "select pr.`".$lang->get('name')."` as name,pr_rew.*, DATE_FORMAT(pr_rew.`time`,'%d.%m.%Y') as dateadd 
             from  #__jshopping_products_reviews as pr_rew
             LEFT JOIN #__jshopping_products  as pr USING (product_id)
-            WHERE 1 ".$where." ORDER BY pr_rew.review_id desc ". $limit;
+            WHERE 1 ".$where." ORDER BY ". $ordering ." ". $limit;
         }
         $db->setQuery($query);
         if ($result=="list"){
Index: Z:/home/jshop/INSTALL/pack/admin/models/taxes.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/taxes.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/taxes.php	(revision 20)
@@ -12,18 +12,26 @@
 
 class JshoppingModelTaxes extends JModel{ 
 
-    function getAllTaxes() {
+    function getAllTaxes($order = null, $orderDir = null) {
         $db = JFactory::getDBO(); 
-        $query = "SELECT * FROM `#__jshopping_taxes`";
+        $ordering = 'tax_name';
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
+        $query = "SELECT * FROM `#__jshopping_taxes` ORDER BY ".$ordering;
         $db->setQuery($query);
         return $db->loadObjectList();
     }
     
-    function getExtTaxes($tax_id = 0) {
+    function getExtTaxes($tax_id = 0, $order = null, $orderDir = null) {
         $db = JFactory::getDBO();
         $where = "";
         if ($tax_id) $where = " where ET.tax_id='".$tax_id."'";
-        $query = "SELECT ET.*, T.tax_name FROM `#__jshopping_taxes_ext` as ET left join #__jshopping_taxes as T on T.tax_id=ET.tax_id ".$where;
+        $ordering = 'ET.id';
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
+        $query = "SELECT ET.*, T.tax_name FROM `#__jshopping_taxes_ext` as ET left join #__jshopping_taxes as T on T.tax_id=ET.tax_id ".$where." ORDER BY ".$ordering;
         $db->setQuery($query);
         return $db->loadObjectList();
     }
Index: Z:/home/jshop/INSTALL/pack/admin/models/coupons.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/coupons.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/coupons.php	(revision 20)
@@ -12,9 +12,13 @@
 
 class JshoppingModelCoupons extends JModel{    
 
-    function getAllCoupons($limitstart, $limit) {
+    function getAllCoupons($limitstart, $limit, $order = null, $orderDir = null) {
         $db = JFactory::getDBO(); 
-        $query = "SELECT C.*, U.f_name, U.l_name  FROM `#__jshopping_coupons` as C left join #__jshopping_users as U on C.for_user_id=U.user_id ORDER BY C.used, C.coupon_id desc";
+        $queryorder = 'ORDER BY C.used, C.coupon_id desc';
+        if ($order && $orderDir){
+            $queryorder = "ORDER BY ".$order." ".$orderDir;
+        }
+        $query = "SELECT C.*, U.f_name, U.l_name  FROM `#__jshopping_coupons` as C left join #__jshopping_users as U on C.for_user_id=U.user_id ".$queryorder;
         $db->setQuery($query, $limitstart, $limit);
         return $db->loadObjectList();
     }
Index: Z:/home/jshop/INSTALL/pack/admin/models/orders.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/orders.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/orders.php	(revision 20)
@@ -48,8 +48,9 @@
         }
         if ($filters['text_search']){
             $search = $db->escape($filters['text_search']);
-            $where .= " and (O.`f_name` like '%".$search."%' or O.`l_name` like '%".$search."%' or O.`email` like '%".$search."%' or O.`firma_name` like '%".$search."%' or O.`d_f_name` like '%".$search."%' or O.`d_l_name` like '%".$search."%' or O.`d_firma_name` like '%".$search."%') ";
+            $where .= " and (O.`order_number` like '%".$search."%' or O.`f_name` like '%".$search."%' or O.`l_name` like '%".$search."%' or O.`email` like '%".$search."%' or O.`firma_name` like '%".$search."%' or O.`d_f_name` like '%".$search."%' or O.`d_l_name` like '%".$search."%' or O.`d_firma_name` like '%".$search."%') ";
         }
+
         if (!$filters['notfinished']) $where .= "and O.order_created='1' ";
         if ($filters['year']!=0) $year = $filters['year']; else $year="%";
         if ($filters['month']!=0) $month = $filters['month']; else $month="%";
@@ -72,10 +73,15 @@
         return $db->loadObjectList();
     }
     
-    function getAllOrderStatus() {
+    function getAllOrderStatus($order = null, $orderDir = null) {
         $db = JFactory::getDBO(); 
         $lang = JSFactory::getLang();
-        $query = "SELECT status_id, status_code, `".$lang->get('name')."` as name FROM `#__jshopping_order_status` ORDER BY status_id";
+        $ordering = "status_id";
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
+        
+        $query = "SELECT status_id, status_code, `".$lang->get('name')."` as name FROM `#__jshopping_order_status` ORDER BY ".$ordering;
         $db->setQuery($query);
         return $db->loadObjectList();
     }
Index: Z:/home/jshop/INSTALL/pack/admin/models/payments.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/payments.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/payments.php	(revision 20)
@@ -12,13 +12,17 @@
 
 class JshoppingModelPayments extends JModel{
     
-    function getAllPaymentMethods($publish = 1) {
+    function getAllPaymentMethods($publish = 1, $order = null, $orderDir = null) {
         $database = JFactory::getDBO(); 
         $query_where = ($publish)?("WHERE payment_publish = '1'"):("");
         $lang = JSFactory::getLang();
+        $ordering = 'payment_ordering';
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
         $query = "SELECT payment_id, `".$lang->get("name")."` as name, `".$lang->get("description")."` as description , payment_code, payment_class, payment_publish, payment_ordering, payment_params, payment_type FROM `#__jshopping_payment_method`
                   $query_where
-                  ORDER BY payment_ordering";
+                  ORDER BY ".$ordering;
         $database->setQuery($query);
         return $database->loadObjectList();
     }
Index: Z:/home/jshop/INSTALL/pack/admin/models/currencies.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/currencies.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/currencies.php	(revision 20)
@@ -12,10 +12,14 @@
 
 class JshoppingModelCurrencies extends JModel{ 
 
-    function getAllCurrencies($publish = 1) {
+    function getAllCurrencies($publish = 1, $order = null, $orderDir = null) {
         $db = JFactory::getDBO(); 
         $query_where = ($publish)?("WHERE currency_publish = '1'"):("");
-        $query = "SELECT * FROM `#__jshopping_currencies` $query_where ORDER BY currency_ordering";
+        $ordering = 'currency_ordering';
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
+        $query = "SELECT * FROM `#__jshopping_currencies` $query_where ORDER BY ".$ordering;
         $db->setQuery($query);
         return $db->loadObjectList();
     }      
Index: Z:/home/jshop/INSTALL/pack/admin/models/products.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/products.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/products.php	(revision 20)
@@ -46,7 +46,7 @@
     
     function _allProductsOrder($order = null, $orderDir = null, $category_id = 0){
         if ($order && $orderDir){
-            $fields = array("product_id"=>"pr.product_id", "name"=>"name",'category'=>"namescats","manufacturer"=>"man_name","vendor"=>"v_f_name","ean"=>"ean","qty"=>"qty","price"=>"pr.product_price","hits"=>"pr.hits","date"=>"pr.product_date_added");
+            $fields = array("product_id"=>"pr.product_id", "name"=>"name",'category'=>"namescats","manufacturer"=>"man_name","vendor"=>"v_f_name","ean"=>"ean","qty"=>"qty","price"=>"pr.product_price","hits"=>"pr.hits","date"=>"pr.product_date_added", "product_name_image"=>"pr.product_name_image");
             if ($category_id) $fields['ordering'] = "pr_cat.product_ordering";
             if (strtolower($orderDir)!="asc") $orderDir = "desc";
             if (!$fields[$order]) return "";
@@ -652,5 +652,39 @@
     return $result;
     }
     
+    function updatePriceAndQtyDependAttr($product_id, $post){
+        $db = JFactory::getDBO();
+        $_adv_query = array();
+        if ($post['product_price']!=""){
+            $price = saveAsPrice($post['product_price']);
+            if ($post['mod_price']=='%') 
+                $_adv_query[] = " `price`=`price` * '".$price."' / 100 ";
+            elseif($post['mod_price']=='=') 
+                $_adv_query[] = " `price`= '".$price."' ";
+            else 
+                $_adv_query[] = " `price`=`price` ".$post['mod_price']." '".$price."' ";
+        }
+        
+        if ($post['product_old_price']!=""){
+            $price = saveAsPrice($post['product_old_price']);
+            if ($post['mod_old_price']=='%') 
+                $_adv_query[] = " `old_price`=`old_price` * '".$price."' / 100 ";
+            elseif($post['mod_old_price']=='=') 
+                $_adv_query[] = " `old_price`= '".$price."' ";
+            else 
+                $_adv_query[] = " `old_price`=`old_price` ".$post['mod_old_price']." '".$price."' ";
+        }
+
+        if ($post['product_quantity']!=""){
+            $_adv_query[] = " `count`= '".$db->escape($post['product_quantity'])."' ";
+        }
+        
+        if (count($_adv_query)>0){
+            $adv_query = implode(" , ", $_adv_query);
+            $query = "update `#__jshopping_products_attr` SET ".$adv_query." where product_id='".$db->escape($product_id)."'";
+            $db->setQuery($query);
+            $db->query();
+        }
+    }
 }
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/admin/models/productfields.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/productfields.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/productfields.php	(revision 20)
@@ -12,13 +12,16 @@
 
 class JshoppingModelProductFields extends JModel{ 
 
-    function getList($groupordering = 0){
+    function getList($groupordering = 0, $order = null, $orderDir = null){
         $db = JFactory::getDBO();
         $lang = JSFactory::getLang();
         $ordering = "F.ordering";
         if ($groupordering){
             $ordering = "G.ordering, F.ordering";
         } 
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
         $query = "SELECT F.id, F.`".$lang->get("name")."` as name, F.`".$lang->get("description")."` as description, F.allcats, F.type, F.cats, F.ordering, F.`group`, G.`".$lang->get("name")."` as groupname, multilist FROM `#__jshopping_products_extra_fields` as F left join `#__jshopping_products_extra_field_groups` as G on G.id=F.group order by ".$ordering;
         $db->setQuery($query);
         return $db->loadObjectList();
Index: Z:/home/jshop/INSTALL/pack/admin/models/categories.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/categories.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/categories.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      2.9.0 03.01.2011
+* @version      2.12.0 03.01.2011
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -80,6 +80,55 @@
         $db->query();
     }
     
+    function getTreeAllCategories($order = null, $orderDir = null) {
+        $db = JFactory::getDBO();
+        $user = JFactory::getUser();
+        $lang = JSFactory::getLang();
+
+        $query = "SELECT ordering, category_id, category_parent_id, `".$lang->get('name')."` as name, `".$lang->get('short_description')."` as short_description, category_publish, category_image FROM `#__jshopping_categories`
+                  ORDER BY category_parent_id, ". $this->_allCategoriesOrder($order, $orderDir);
+        $db->setQuery($query);
+        $all_cats = $db->loadObjectList();
+
+        $categories = array();
+        if (count($all_cats)){
+            foreach($all_cats as $key=>$category){
+                $category->isPrev = 0; $category->isNext = 0;
+                if (isset($all_cats[$key-1]) && $category->category_parent_id == $all_cats[$key-1]->category_parent_id){
+                    $category->isPrev = 1;
+                }
+                if (isset($all_cats[$key+1]) && $category->category_parent_id == $all_cats[$key+1]->category_parent_id){
+                    $category->isNext = 1;
+                }
+                
+                if (!$category->category_parent_id){
+                    recurseTree($category, 0, $all_cats, $categories, 0);
+                }
+            }
+        }
+
+        if (count($categories)){
+            foreach($categories as $key=>$category){
+                $category->space = ''; 
+                for ($i = 0; $i < $category->level; $i++){
+                    $category->space .= '<span class = "gi">|—</span>';
+                }
+            }
+        }
+        return $categories;
+    }
+   
+    function _allCategoriesOrder($order = null, $orderDir = null){
+        $lang = JSFactory::getLang();
+        if ($order && $orderDir){
+            $fields = array("name" => "`".$lang->get('name')."`", "id" => "`category_id`", "description" => "`".$lang->get('description')."`", "ordering" => "`ordering`");
+            if (strtolower($orderDir) != "asc") $orderDir = "desc";
+            if (!$fields[$order]) return "`ordering` ".$orderDir;
+            return $fields[$order]." ".$orderDir;
+        }else{
+            return "`ordering` asc";
+        }
+    }
 }
 
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/admin/models/deliverytimes.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/models/deliverytimes.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/models/deliverytimes.php	(revision 20)
@@ -12,10 +12,15 @@
 
 class JshoppingModelDeliveryTimes extends JModel{    
 
-    function getDeliveryTimes(){
+    function getDeliveryTimes($order = null, $orderDir = null){
         $db = JFactory::getDBO();    
-        $lang = JSFactory::getLang();     
-        $query = "SELECT id, `".$lang->get('name')."` as name FROM `#__jshopping_delivery_times` ORDER BY name";
+        $lang = JSFactory::getLang();    
+        
+        $ordering = "name";
+        if ($order && $orderDir){
+            $ordering = $order." ".$orderDir;
+        }
+        $query = "SELECT id, `".$lang->get('name')."` as name FROM `#__jshopping_delivery_times` ORDER BY ".$ordering;
         $db->setQuery($query);
         return $db->loadObjectList();
     }
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/info.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/info.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/info.php	(revision 20)
@@ -12,7 +12,7 @@
 
 class JshoppingControllerInfo extends JController{
 
-    function display(){
+    function display($cachable = false, $urlparams = false){
         checkAccessController("info");        
         addSubmenu("info");
         
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/product_list_selectable.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/product_list_selectable.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/product_list_selectable.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.7.0 02.03.2012
+* @version      3.12.0 02.03.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -12,7 +12,7 @@
 jimport('joomla.application.component.controller');
 jimport('joomla.html.pagination');
 class JShoppingControllerProduct_List_Selectable extends JController {
-	function display(){
+	function display($cachable = false, $urlparams = false){
         checkAccessController("product_list_selectable");
 		$app = JFactory::getApplication();
 		$db = JFactory::getDBO();
@@ -47,16 +47,13 @@
 		$parentTop->category_id = 0;
 		$parentTop->name = " - - - ";
 		$categories_select = buildTreeCategory(0,1,0);
-		
-		array_unshift($categories_select, $parentTop);  
-		  
+		array_unshift($categories_select, $parentTop);
 		$lists['treecategories'] = JHTML::_('select.genericlist', $categories_select, 'category_id', 'onchange="document.adminForm.submit();"', 'category_id', 'name', $category_id);
 		
 		$manuf1 = array();
 		$manuf1[0]->manufacturer_id = '0';
 		$manuf1[0]->name = " - - - ";
-
-		$manufs = JModel::getInstance('Manufacturers', 'JShoppingModel')->getAllManufacturers(0);
+		$manufs = JModel::getInstance('Manufacturers', 'JShoppingModel')->getList();
 		$manufs = array_merge($manuf1, $manufs);
 		$lists['manufacturers'] = JHTML::_('select.genericlist', $manufs, 'manufacturer_id', 'onchange="document.adminForm.submit();"', 'manufacturer_id', 'name', $manufacturer_id);
 
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/panel.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/panel.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/panel.php	(revision 20)
@@ -11,7 +11,8 @@
 jimport('joomla.application.component.controller');
 
 class JshoppingControllerPanel extends JController{
-    function display(){
+    
+    function display($cachable = false, $urlparams = false){
         checkAccessController("panel");
         addSubmenu("");
 		$view=$this->getView("panel", 'html');
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/users.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/users.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/users.php	(revision 20)
@@ -21,7 +21,7 @@
         addSubmenu("users");
     }
 
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $mainframe = JFactory::getApplication();
         $context = "jshopping.list.admin.users";
         $limit = $mainframe->getUserStateFromRequest( $context.'limit', 'limit', $mainframe->getCfg('list_limit'), 'int' );
@@ -203,7 +203,21 @@
         }
                 
         $dispatcher->trigger( 'onAfterPublishUser', array(&$cid, &$flag) );
-    }    
-    
+    }
+	
+	function get_userinfo() {
+		$db = JFactory::getDBO();
+		$id = JRequest::getInt('user_id');
+		if(!$id){
+			print '{}';
+			die;
+		}
+		
+		$query = 'SELECT * FROM `#__jshopping_users` WHERE `user_id`='.$id;
+		$db->setQuery($query);
+		$user = $db->loadAssoc();
+		echo json_encode((array)$user);
+		die();
+	}
 }
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/productlabels.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/productlabels.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/productlabels.php	(revision 20)
@@ -21,15 +21,22 @@
         addSubmenu("other");
     }
 
-	function display(){
+	function display($cachable = false, $urlparams = false){
         $jshopConfig = JSFactory::getConfig();
+        $mainframe = JFactory::getApplication();
+		$context = "jshoping.list.admin.productlabels";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "name", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
+        
 		$_productLabels = $this->getModel("productLabels");
-		$rows = $_productLabels->getList();
+		$rows = $_productLabels->getList($filter_order, $filter_order_Dir);
         
 		$view=$this->getView("product_labels", 'html');
         $view->setLayout("list");		
         $view->assign('rows', $rows);
-        $view->assign('config', $jshopConfig);        
+        $view->assign('config', $jshopConfig); 
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
 		$view->displayList();
 	}
 	
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/shippings.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/shippings.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/shippings.php	(revision 20)
@@ -25,10 +25,16 @@
         addSubmenu("other");
     }
     
-    function display(){
+    function display($cachable = false, $urlparams = false){
 		$db = JFactory::getDBO();
+        
+        $mainframe = JFactory::getApplication();
+		$context = "jshoping.list.admin.shippings";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "ordering", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
+        
 		$shippings = $this->getModel("shippings");
-		$rows = $shippings->getAllShippings(0);
+		$rows = $shippings->getAllShippings(0, $filter_order, $filter_order_Dir);
         
         $not_set_price = 0;
         $rowsprices = $shippings->getAllShippingPrices(0);        
@@ -52,6 +58,8 @@
 		$view=$this->getView("shippings", 'html');
         $view->setLayout("list");
 		$view->assign('rows', $rows);
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
 		$view->displayList();
 	}
 	
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/productfieldvalues.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/productfieldvalues.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/productfieldvalues.php	(revision 20)
@@ -21,16 +21,24 @@
         addSubmenu("other");
     }
     
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $field_id = JRequest::getInt("field_id");
         $db = JFactory::getDBO();
         $_productfieldvalues = $this->getModel("productFieldValues");
-        $rows = $_productfieldvalues->getList($field_id);
         
+        $mainframe = JFactory::getApplication();
+		$context = "jshoping.list.admin.productfieldvalues";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "ordering", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
+        
+        $rows = $_productfieldvalues->getList($field_id, $filter_order, $filter_order_Dir);
+        
         $view = $this->getView("product_field_values", 'html');
         $view->setLayout("list");
         $view->assign('rows', $rows);
         $view->assign('field_id', $field_id);
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
         JPluginHelper::importPlugin('jshoppingadmin');
         $dispatcher = JDispatcher::getInstance();
         $dispatcher->trigger('onBeforeDisplayProductFieldValues', array(&$view));
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/exttaxes.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/exttaxes.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/exttaxes.php	(revision 20)
@@ -21,12 +21,18 @@
         addSubmenu("other");
     }
 
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $jshopConfig = JSFactory::getConfig();
         $back_tax_id = JRequest::getInt("back_tax_id");
         $db = JFactory::getDBO();
+        
+        $mainframe = JFactory::getApplication();
+		$context = "jshoping.list.admin.exttaxes";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "ET.id", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
+        
         $taxes = $this->getModel("taxes");
-        $rows = $taxes->getExtTaxes($back_tax_id);
+        $rows = $taxes->getExtTaxes($back_tax_id, $filter_order, $filter_order_Dir);
         
         $countries = $this->getModel("countries");
         $list = $countries->getAllCountries(0);
@@ -54,6 +60,8 @@
         $view->assign('rows', $rows); 
         $view->assign('back_tax_id', $back_tax_id);
         $view->assign('config', $jshopConfig);
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
         JPluginHelper::importPlugin('jshoppingadmin');
         $dispatcher = JDispatcher::getInstance();
         $dispatcher->trigger('onBeforedisplayExtTax', array(&$view)); 
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/statistic.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/statistic.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/statistic.php	(revision 20)
@@ -18,12 +18,10 @@
         addSubmenu("other");
         checkAccessController("statistic");
     }
-    function display(){
-        
+    
+    function display($cachable = false, $urlparams = false){        
         $jshopConfig = JSFactory::getConfig(); 
-
-        $_statisctic = $this->getModel("statistic");   
-        
+        $_statisctic = $this->getModel("statistic");        
         $rows = $_statisctic->getAllOrderStatus();
 
         $today = $_statisctic->getOrderStatistics('day');  
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/addons.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/addons.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/addons.php	(revision 20)
@@ -18,7 +18,7 @@
         addSubmenu("other");
     }
     
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $db = JFactory::getDBO();
         $addons = $this->getModel("addons");
         $rows = $addons->getList();
@@ -60,6 +60,14 @@
     }
     
     function save(){
+        $this->saveConfig('save');
+    }
+    
+    function apply(){
+        $this->saveConfig();
+    }
+
+    private function saveConfig($task = 'apply'){
         $post = JRequest::get('post');
         $row = JTable::getInstance('addon', 'jshop');
         $params = $post['params'];
@@ -67,9 +75,14 @@
         $row->bind($post);
         $row->setParams($params);
         $row->store();
-        $this->setRedirect("index.php?option=com_jshopping&controller=addons");
+
+        if ($task == 'save'){
+            $this->setRedirect("index.php?option=com_jshopping&controller=addons");
+        } else {
+            $this->setRedirect("index.php?option=com_jshopping&controller=addons&task=edit&id=".$post['id']);
+        }
     }
-
+	
     function remove(){
         $id = JRequest::getVar("id");
         $db = JFactory::getDBO();
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/shippingsprices.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/shippingsprices.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/shippingsprices.php	(revision 20)
@@ -1,14 +1,12 @@
 <?php
 /**
-* @version      3.9.1 20.08.2012
+* @version      3.12.0 10.11.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
 * @license      GNU/GPL
 */
-
-defined( '_JEXEC' ) or die( 'Restricted access' );
-
+defined('_JEXEC') or die('Restricted access');
 jimport('joomla.application.component.controller');
 
 class JshoppingControllerShippingsPrices extends JController{
@@ -21,21 +19,27 @@
         addSubmenu("other");
     }
     
-    function display(){
+    function display($cachable = false, $urlparams = false){
 		$db = JFactory::getDBO();
         $lang = JSFactory::getLang();
         $jshopConfig = JSFactory::getConfig();
+        
+        $mainframe = JFactory::getApplication();
+		$context = "jshoping.list.admin.shippingsprices";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "shipping_price.sh_pr_method_id", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
+        
         $shipping_id_back = JRequest::getInt("shipping_id_back");
 		$shippings = $this->getModel("shippings");
-		$rows = $shippings->getAllShippingPrices(0, $shipping_id_back);
+		$rows = $shippings->getAllShippingPrices(0, $shipping_id_back, $filter_order, $filter_order_Dir);
         $currency = JTable::getInstance('currency', 'jshop');
         $currency->load($jshopConfig->mainCurrency);
         
         $query = "select MPC.sh_pr_method_id, C.`".$lang->get("name")."` as name from #__jshopping_shipping_method_price_countries as MPC 
                   left join #__jshopping_countries as C on C.country_id=MPC.country_id order by MPC.sh_pr_method_id, C.ordering";
         $db->setQuery($query);
-        $list = $db->loadObjectList();        
-        $shipping_countries = array();        
+        $list = $db->loadObjectList();
+        $shipping_countries = array();
         foreach($list as $smp){
             $shipping_countries[$smp->sh_pr_method_id][] = $smp->name;
         }
@@ -48,15 +52,17 @@
                     $rows[$k]->countries = implode(", ",$tmp)."...";
                 }else{
                     $rows[$k]->countries = implode(", ",$shipping_countries[$row->sh_pr_method_id]);
-                }                
+                }
             }
         }
-                        
+
 		$view=$this->getView("shippingsprices", 'html');
         $view->setLayout("list");
 		$view->assign('rows', $rows);
         $view->assign('currency', $currency);
         $view->assign('shipping_id_back', $shipping_id_back);
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
 		$view->displayList(); 
 	}
     
@@ -68,14 +74,16 @@
 		$sh_method_price = JTable::getInstance('shippingMethodPrice', 'jshop');
 		$sh_method_price->load($sh_pr_method_id);
 		$sh_method_price->prices = $sh_method_price->getPrices();
-        if ($jshopConfig->tax){        
+        if ($jshopConfig->tax){
 		    $taxes = $this->getModel("taxes");
 		    $all_taxes = $taxes->getAllTaxes();
 		    $list_tax = array();		
-		    foreach ($all_taxes as $tax) {
-			    $list_tax[] = JHTML::_('select.option', $tax->tax_id,$tax->tax_name . ' (' . $tax->tax_value . '%)','tax_id','tax_name');
+		    foreach($all_taxes as $tax){
+			    $list_tax[] = JHTML::_('select.option', $tax->tax_id,$tax->tax_name.' ('.$tax->tax_value.'%)','tax_id','tax_name');
 		    }
-            $lists['taxes'] = JHTML::_('select.genericlist', $list_tax,'shipping_tax_id','class = "inputbox" size = "1" id = "shipping_tax_id"','tax_id','tax_name',$sh_method_price->shipping_tax_id);
+            $list_tax[] = JHTML::_('select.option', -1,_JSHOP_PRODUCT_TAX_RATE,'tax_id','tax_name');
+            $lists['taxes'] = JHTML::_('select.genericlist', $list_tax,'shipping_tax_id','class="inputbox"','tax_id','tax_name',$sh_method_price->shipping_tax_id);
+            $lists['package_taxes'] = JHTML::_('select.genericlist', $list_tax,'package_tax_id','class="inputbox"','tax_id','tax_name',$sh_method_price->package_tax_id);
         }
 		$shippings = $this->getModel("shippings");
 		$countries = $this->getModel("countries");		
@@ -86,15 +94,16 @@
         
         if ($jshopConfig->admin_show_delivery_time) {
             $_deliveryTimes = $this->getModel("deliveryTimes");
-            $all_delivery_times = $_deliveryTimes->getDeliveryTimes();                
+            $all_delivery_times = $_deliveryTimes->getDeliveryTimes();
             $all_delivery_times0 = array();
+            $all_delivery_times0[0] = new stdClass();
             $all_delivery_times0[0]->id = '0';
-            $all_delivery_times0[0]->name = _JSHOP_NONE;        
+            $all_delivery_times0[0]->name = _JSHOP_NONE;
             $lists['deliverytimes'] = JHTML::_('select.genericlist', array_merge($all_delivery_times0, $all_delivery_times),'delivery_times_id','class = "inputbox"','id','name', $sh_method_price->delivery_times_id);
         }
         
         $currency = JTable::getInstance('currency', 'jshop');
-        $currency->load($jshopConfig->mainCurrency);        
+        $currency->load($jshopConfig->mainCurrency);
         $extensions = JSFactory::getShippingExtList($actived);
 
 		$view=$this->getView("shippingsprices", 'html');
@@ -111,15 +120,15 @@
 		$view->displayEdit();
 	}
 	
-	function save(){        
+	function save(){
     	$sh_method_id = JRequest::getInt("sh_method_id");
         $shipping_id_back = JRequest::getInt("shipping_id_back");
         JPluginHelper::importPlugin('jshoppingadmin');
         $dispatcher = JDispatcher::getInstance();
-		
+
         $shippings = $this->getModel("shippings");
 		$shipping_pr = JTable::getInstance('shippingMethodPrice', 'jshop');
-        $post = JRequest::get("post");        
+        $post = JRequest::get("post");
         $post['shipping_stand_price'] = saveAsPrice($post['shipping_stand_price']);
         $dispatcher->trigger( 'onBeforeSaveShippingPrice', array(&$post) );
         
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/countries.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/countries.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/countries.php	(revision 20)
@@ -21,12 +21,14 @@
         addSubmenu("other");
     }
 
-    function display(){  	        		
+    function display($cachable = false, $urlparams = false){      
         $mainframe = JFactory::getApplication();
 		$context = "jshoping.list.admin.countries";
         $limit = $mainframe->getUserStateFromRequest( $context.'limit', 'limit', $mainframe->getCfg('list_limit'), 'int' );
         $limitstart = $mainframe->getUserStateFromRequest( $context.'limitstart', 'limitstart', 0, 'int' );
         $publish = $mainframe->getUserStateFromRequest( $context.'publish', 'publish', 0, 'int' );
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "ordering", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
 		
 		$countries = $this->getModel("countries");
 		$total = $countries->getCountAllCountries();
@@ -40,7 +42,7 @@
 		
 		jimport('joomla.html.pagination');
         $pageNav = new JPagination($total, $limitstart, $limit);
-		$rows = $countries->getAllCountries($publish, $pageNav->limitstart,$pageNav->limit, 0);
+		$rows = $countries->getAllCountries($publish, $pageNav->limitstart,$pageNav->limit, 0, $filter_order, $filter_order_Dir);
         
         $f_option = array();
         $f_option[] = JHTML::_('select.option', 0, _JSHOP_ALL, 'id', 'name');
@@ -54,6 +56,8 @@
         $view->assign('rows', $rows); 
         $view->assign('pageNav', $pageNav);       
         $view->assign('filter', $filter);
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
 		$view->displayList(); 
     }
     
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/configdisplayprice.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/configdisplayprice.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/configdisplayprice.php	(revision 20)
@@ -21,7 +21,7 @@
         addSubmenu("config");        
     }
     
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $db = JFactory::getDBO();
         $_configdisplayprice = $this->getModel("configDisplayPrice");
         $rows = $_configdisplayprice->getList();
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/usergroups.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/usergroups.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/usergroups.php	(revision 20)
@@ -21,14 +21,20 @@
         addSubmenu("other");
     }
 
-    function display(){
+    function display($cachable = false, $urlparams = false){
+        $mainframe = JFactory::getApplication();
+		$context = "jshoping.list.admin.usergroups";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "usergroup_id", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
         
 		$usergroups = $this->getModel("usergroups");
-		$rows = $usergroups->getAllUsergroups();
+		$rows = $usergroups->getAllUsergroups($filter_order, $filter_order_Dir);
 		        
         $view=$this->getView("usergroups", 'html');
         $view->setLayout("list");
         $view->assign("rows", $rows);
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
         $view->displayList();
     }
     
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/manufacturers.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/manufacturers.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/manufacturers.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.3.0 22.07.2011
+* @version      3.12.0 22.07.2011
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -13,25 +13,30 @@
 class JshoppingControllerManufacturers extends JController{
 
     function __construct( $config = array() ){
-        parent::__construct( $config );        
-
+        parent::__construct( $config );
         $this->registerTask( 'add',   'edit' );
         $this->registerTask( 'apply', 'save' );
         checkAccessController("manufacturers");
         addSubmenu("other");
     }
 
-    function display() {
+    function display($cachable = false, $urlparams = false){
         $db = JFactory::getDBO();
+        $mainframe = JFactory::getApplication();
+        $context = "jshopping.list.admin.manufacturers";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "ordering", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
         $manufacturer = $this->getModel("manufacturers");
-        $rows = $manufacturer->getAllManufacturers();
+        $rows = $manufacturer->getAllManufacturers(0, $filter_order, $filter_order_Dir);
         $view=$this->getView("manufacturer", 'html');
         $view->setLayout("list");
-        $view->assign('rows', $rows);        
+        $view->assign('rows', $rows);
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
         $view->displayList();
     }
 
-    function edit() {
+    function edit(){
         $db = JFactory::getDBO();
         $man_id = JRequest::getInt("man_id");
         $manufacturer = JTable::getInstance('manufacturer', 'jshop');
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/vendors.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/vendors.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/vendors.php	(revision 20)
@@ -21,7 +21,7 @@
         addSubmenu("other");
     }	
 
-    function display(){       
+    function display($cachable = false, $urlparams = false){       
         $mainframe = JFactory::getApplication();
                 
         $context = "jshopping.list.admin.vendors";
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/update.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/update.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/update.php	(revision 20)
@@ -25,7 +25,7 @@
         $language->load('com_installer');
     }
 
-    function display(){		                
+    function display($cachable = false, $urlparams = false){		                
 		$view=$this->getView("update", 'html');        
 		$view->display(); 
     }
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/taxes.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/taxes.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/taxes.php	(revision 20)
@@ -21,14 +21,22 @@
         addSubmenu("other");
     }
     
-    function display() {
+    function display($cachable = false, $urlparams = false){
         $db = JFactory::getDBO();
+        
+        $mainframe = JFactory::getApplication();
+		$context = "jshoping.list.admin.taxes";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "tax_name", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
+        
         $taxes = $this->getModel("taxes");
-        $rows = $taxes->getAllTaxes();
+        $rows = $taxes->getAllTaxes($filter_order, $filter_order_Dir);
         
         $view=$this->getView("taxes", 'html');
         $view->setLayout("list");
         $view->assign('rows', $rows); 
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
         $view->displayList();
     }
     
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/reviews.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/reviews.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/reviews.php	(revision 20)
@@ -21,15 +21,19 @@
         addSubmenu("other");
     }
     
-    function display() {
+    function display($cachable = false, $urlparams = false){
         $mainframe = JFactory::getApplication();
         $id_vendor_cuser = getIdVendorForCUser();
         $reviews_model = $this->getModel("reviews");
         $products_model = $this->getModel("products");
+        $context = "jshoping.list.admin.reviews";
         $limit = $mainframe->getUserStateFromRequest( $context.'limit', 'limit', $mainframe->getCfg('list_limit'), 'int' );
         $limitstart = $mainframe->getUserStateFromRequest( $context.'limitstart', 'limitstart', 0, 'int' );
         $category_id = $mainframe->getUserStateFromRequest( $context.'category_id', 'category_id', 0, 'int' );            
         $text_search = $mainframe->getUserStateFromRequest( $context.'text_search', 'text_search', '');
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "pr_rew.review_id", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "desc", 'cmd');
+        
         if ($category_id){
             $product_id = $mainframe->getUserStateFromRequest( $context.'product_id', 'product_id', 0, 'int' );
         }
@@ -46,14 +50,13 @@
                 $products_select = JHTML::_('select.genericlist', $products, 'product_id', 'class = "inputbox" onchange="document.adminForm.submit();" size = "1" ', 'product_id', 'name', $product_id);
             }
         }
+        $total = $reviews_model->getAllReviews($category_id, $product_id, NULL, NULL, $text_search, "count", $id_vendor_cuser, $filter_order, $filter_order_Dir);
         
-        $total = $reviews_model->getAllReviews($category_id, $product_id, NULL, NULL, $text_search, "count", $id_vendor_cuser);
-        
         jimport('joomla.html.pagination');
         $pagination = new JPagination($total, $limitstart, $limit);
     
-        $reviews = $reviews_model->getAllReviews($category_id, $product_id, $pagination->limitstart, $pagination->limit, $text_search, "list", $id_vendor_cuser);
-        
+        $reviews = $reviews_model->getAllReviews($category_id, $product_id, $pagination->limitstart, $pagination->limit, $text_search, "list", $id_vendor_cuser, $filter_order, $filter_order_Dir);
+
         $start_option = JHTML::_('select.option', '0', _JSHOP_SELECT_CATEGORY,'category_id','name'); 
         
         $categories_select = buildTreeCategory(0,1,0);
@@ -68,7 +71,9 @@
         $view->assign('limitstart', $limitstart);
         $view->assign('text_search', $text_search); 
         $view->assign('pagination', $pagination); 
-        $view->assign('products_select', $products_select);            
+        $view->assign('products_select', $products_select);
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
         $view->displayList();
      }
      
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/coupons.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/coupons.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/coupons.php	(revision 20)
@@ -21,11 +21,13 @@
         addSubmenu("other");
     }
 
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $mainframe = JFactory::getApplication();
         $context = "jshoping.list.admin.coupons";
         $limit = $mainframe->getUserStateFromRequest( $context.'limit', 'limit', $mainframe->getCfg('list_limit'), 'int' );
         $limitstart = $mainframe->getUserStateFromRequest( $context.'limitstart', 'limitstart', 0, 'int' );
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "C.coupon_code", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
         
         $jshopConfig = JSFactory::getConfig();  	        		
         
@@ -34,7 +36,7 @@
         
         jimport('joomla.html.pagination');
         $pageNav = new JPagination($total, $limitstart, $limit);
-        $rows = $coupons->getAllCoupons($pageNav->limitstart, $pageNav->limit);
+        $rows = $coupons->getAllCoupons($pageNav->limitstart, $pageNav->limit, $filter_order, $filter_order_Dir);
         
         $currency = JTable::getInstance('currency', 'jshop');
         $currency->load($jshopConfig->mainCurrency);
@@ -43,7 +45,9 @@
         $view->setLayout("list");		
         $view->assign('rows', $rows);        
         $view->assign('currency', $currency->currency_code);
-        $view->assign('pageNav', $pageNav);        
+        $view->assign('pageNav', $pageNav);   
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
 		$view->displayList(); 
     }
     
@@ -53,9 +57,10 @@
         $coupon->load($coupon_id);
         $edit = ($coupon_id)?($edit = 1):($edit = 0);
         $arr_type_coupon = array();
+        $arr_type_coupon[0] = new stdClass();
         $arr_type_coupon[0]->coupon_type = 0;
         $arr_type_coupon[0]->coupon_value = _JSHOP_COUPON_PERCENT;
-
+        $arr_type_coupon[1] = new stdClass();
         $arr_type_coupon[1]->coupon_type = 1;
         $arr_type_coupon[1]->coupon_value = _JSHOP_COUPON_ABS_VALUE;
         
@@ -86,11 +91,10 @@
         $view->displayEdit();
     }
     
-    function save() {        
-
+    function save(){
         $coupon_id = JRequest::getInt("coupon_id");        
         $coupon = JTable::getInstance('coupon', 'jshop');
-        
+
         JPluginHelper::importPlugin('jshoppingadmin');
         $dispatcher = JDispatcher::getInstance();        
         
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/orders.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/orders.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/orders.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.10.1 05.08.2012
+* @version      3.12.0 05.08.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -19,7 +19,7 @@
         addSubmenu("orders");
     }
 
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $jshopConfig = JSFactory::getConfig();
         $mainframe = JFactory::getApplication();        
         $context = "jshopping.list.admin.orders";
@@ -187,6 +187,12 @@
         
         $order->order_tax_list = $order->getTaxExt();
         
+        if ($order->coupon_id){
+            $coupon = JTable::getInstance('coupon', 'jshop'); 
+            $coupon->load($order->coupon_id);
+            $order->coupon_code = $coupon->coupon_code;
+        }
+        
         $tmp_fields = $jshopConfig->getListFieldsRegister();
         $config_fields = $tmp_fields["address"];
         $count_filed_delivery = $jshopConfig->getEnableDeliveryFiledRegistration('address');
@@ -205,11 +211,18 @@
                 }
             }
         }
-        $deliverytimes = JSFactory::getAllDeliveryTime();
-        $order->delivery_time_name = $deliverytimes[$order->delivery_times_id];
-        if ($order->delivery_time_name==""){
-            $order->delivery_time_name = $order->delivery_time;
+        $order->delivery_time_name = '';
+        $order->delivery_date_f = '';
+        if ($jshopConfig->show_delivery_time_checkout){
+            $deliverytimes = JSFactory::getAllDeliveryTime();
+            $order->delivery_time_name = $deliverytimes[$order->delivery_times_id];
+            if ($order->delivery_time_name==""){
+                $order->delivery_time_name = $order->delivery_time;
+            }
         }
+        if ($jshopConfig->show_delivery_date && !datenull($order->delivery_date)){
+            $order->delivery_date_f = formatdate($order->delivery_date);
+        }
         
         JPluginHelper::importPlugin('jshoppingorder');
         $dispatcher = JDispatcher::getInstance();
@@ -481,6 +494,11 @@
         $first=array(0=>"- - -");
         $delivery_time_select = JHTML::_('select.genericlist', array_merge($first,$deliverytimes), 'delivery_times_id', '', 'id', 'name', $order->delivery_times_id);
         
+		$users = $this->getModel('users');
+		$users_list = $users->getUsers();
+		$first = array(0=>'- - -');
+		$users_list_select = JHTML::_('select.genericlist', array_merge($first,$users_list), 'user_id', 'onchange="updateBillingShippingForUser(this.value);"', 'user_id', 'name', $order->user_id);
+		
         $view=$this->getView("orders", 'html');
         $view->setLayout("edit");
         $view->assign('config', $jshopConfig); 
@@ -498,7 +516,8 @@
         $view->assign('payments_select', $payments_select);
         $view->assign('select_language', $select_language);
         $view->assign('delivery_time_select', $delivery_time_select);
-        JPluginHelper::importPlugin('jshoppingadmin');
+		$view->assign('users_list_select', $users_list_select);
+		JPluginHelper::importPlugin('jshoppingadmin');
         $dispatcher = JDispatcher::getInstance();
         $dispatcher->trigger('onBeforeEditOrders', array(&$view));
         $view->displayEdit();
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/payments.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/payments.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/payments.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.1 22.08.2012
+* @version      3.12.0 14.11.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -21,12 +21,20 @@
         addSubmenu("other");
     }
 	
-	function display() {
+	function display($cachable = false, $urlparams = false){
 		$payments = $this->getModel("payments");
-		$rows = $payments->getAllPaymentMethods(0);
+        
+        $mainframe = JFactory::getApplication();
+		$context = "jshoping.list.admin.payments";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "payment_ordering", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
+        
+		$rows = $payments->getAllPaymentMethods(0, $filter_order, $filter_order_Dir);
 		$view=$this->getView("payments", 'html');
         $view->setLayout("list");
 		$view->assign('rows', $rows);
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
         $view->displayList();
 	}
 	
@@ -66,8 +74,9 @@
             $all_taxes = $_tax->getAllTaxes();
             $list_tax = array();
             foreach($all_taxes as $tax) {
-                $list_tax[] = JHTML::_('select.option', $tax->tax_id, $tax->tax_name . ' (' . $tax->tax_value . '%)','tax_id','tax_name');
-            }        
+                $list_tax[] = JHTML::_('select.option', $tax->tax_id, $tax->tax_name.' ('.$tax->tax_value.'%)','tax_id','tax_name');
+            }
+            $list_tax[] = JHTML::_('select.option', -1,_JSHOP_PRODUCT_TAX_RATE,'tax_id','tax_name');
             $lists['tax'] = JHTML::_('select.genericlist', $list_tax, 'tax_id', 'class = "inputbox"','tax_id','tax_name', $payment->tax_id);
         }
         
@@ -93,7 +102,7 @@
         $view->displayEdit();
 	}	
 	
-	function save() {
+	function save(){
 		$payment_id = JRequest::getInt("payment_id");
         JPluginHelper::importPlugin('jshoppingadmin');
         $dispatcher = JDispatcher::getInstance();
@@ -131,7 +140,6 @@
             $this->setRedirect("index.php?option=com_jshopping&controller=payments&task=edit&payment_id=".$payment->payment_id);
             return 0;
         }
-		
 		$payment->store();
 
         $dispatcher->trigger('onAfterSavePayment', array(&$payment) );
@@ -243,6 +251,6 @@
 
         $this->setRedirect("index.php?option=com_jshopping&controller=payments");
     }
-	   
+
 }
 ?>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/licensekeyaddon.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/licensekeyaddon.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/licensekeyaddon.php	(revision 20)
@@ -21,7 +21,7 @@
         addSubmenu("other");        
     }
 
-	function display(){
+	function display($cachable = false, $urlparams = false){
         $alias = JRequest::getVar("alias");
 		$back = JRequest::getVar("back");
 		$addon = JTable::getInstance('addon', 'jshop');
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/units.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/units.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/units.php	(revision 20)
@@ -21,7 +21,7 @@
         addSubmenu("other");
     }
 
-	function display(){
+	function display($cachable = false, $urlparams = false){
 		$_units = $this->getModel("units");
 		$rows = $_units->getUnits();
         
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/currencies.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/currencies.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/currencies.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      2.9.4 03.11.2010
+* @version      3.12.0 03.11.2010
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -21,8 +21,13 @@
         addSubmenu("other");
     }
         
-    function display() {        
+    function display($cachable = false, $urlparams = false){        
         $jshopConfig = JSFactory::getConfig();        
+        $mainframe = JFactory::getApplication();
+		$context = "jshoping.list.admin.currencies";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "currency_ordering", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
+        
         $current_currency = JTable::getInstance('currency', 'jshop');
         $current_currency->load($jshopConfig->mainCurrency);
         if ($current_currency->currency_value!=1){
@@ -30,21 +35,24 @@
         }
         
         $currencies = $this->getModel("currencies");
-        $rows = $currencies->getAllCurrencies(0);
+        $rows = $currencies->getAllCurrencies(0, $filter_order, $filter_order_Dir);
         
         $view=$this->getView("currencies", 'html');
         $view->setLayout("list");        
         $view->assign('rows', $rows);        
-        $view->assign('config', $jshopConfig);        
+        $view->assign('config', $jshopConfig);  
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
         $view->displayList();
     }
     
-    function edit() {        
+    function edit(){        
         $db = JFactory::getDBO();        
         $currency = JTable::getInstance('currency', 'jshop');
         $currencies = $this->getModel("currencies");
         $currency_id = JRequest::getInt('currency_id');
         $currency->load($currency_id);
+        if ($currency->currency_value==0) $currency->currency_value = 1;
         $first[] = JHTML::_('select.option', '0',_JSHOP_ORDERING_FIRST,'currency_ordering','currency_name');
         $rows = array_merge($first, $currencies->getAllCurrencies() );
         $lists['order_currencies'] = JHTML::_('select.genericlist', $rows,'currency_ordering','class="inputbox" size="1"','currency_ordering','currency_name',$currency->currency_ordering);
@@ -76,6 +84,7 @@
             $this->setRedirect("index.php?option=com_jshopping&controller=currencies");
             return 0;
         }
+        if ($currency->currency_value==0) $currency->currency_value = 1;
 
         $this->_reorderCurrency($currency);
         if (!$currency->store()) {
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/products.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/products.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/products.php	(revision 20)
@@ -20,7 +20,7 @@
         addSubmenu("products");
     }
     
-    function display(){    
+    function display($cachable = false, $urlparams = false){    
         $mainframe = JFactory::getApplication();    
         $db = JFactory::getDBO();
         $jshopConfig = JSFactory::getConfig();
@@ -74,6 +74,7 @@
             }
         }
         
+        $parentTop = new stdClass();
         $parentTop->category_id = 0;
         $parentTop->name = " - - - ";
         $categories_select = buildTreeCategory(0,1,0);
@@ -81,11 +82,12 @@
         $lists['treecategories'] = JHTML::_('select.genericlist', $categories_select,'category_id','onchange="document.adminForm.submit();"', 'category_id', 'name', $category_id );
         
         $manuf1 = array();
+        $manuf1[0] = new stdClass();
         $manuf1[0]->manufacturer_id = '0';
         $manuf1[0]->name = " - - - ";
 
         $_manufacturer = $this->getModel('manufacturers');
-        $manufs = $_manufacturer->getAllManufacturers(0);
+        $manufs = $_manufacturer->getList();
         $manufs = array_merge($manuf1, $manufs);
         $lists['manufacturers'] = JHTML::_('select.genericlist', $manufs, 'manufacturer_id','onchange="document.adminForm.submit();"', 'manufacturer_id', 'name', $manufacturer_id);
         
@@ -144,7 +146,8 @@
         
         $product_id = JRequest::getInt('product_id');
         $product_attr_id = JRequest::getInt('product_attr_id');        
-        
+        $category_id = JRequest::getInt('category_id');
+		
         //parent product
         if ($product_attr_id){
             JRequest::setVar("hidemainmenu", 1);
@@ -209,6 +212,9 @@
             $videos = array();
             $files = array();
             $categories_select = null;
+			if ($category_id) {
+                $categories_select = $category_id;
+            }
             $related_products = array();
         }
         if ($jshopConfig->tax){
@@ -228,11 +234,12 @@
         $lists['files'] = $files;
 
         $manuf1 = array();
+        $manuf1[0] = new stdClass();
         $manuf1[0]->manufacturer_id = '0';
         $manuf1[0]->name = _JSHOP_NONE;
 
         $_manufacturer =$this->getModel('manufacturers');
-        $manufs = $_manufacturer->getAllManufacturers(0);
+        $manufs = $_manufacturer->getList();
         $manufs = array_merge($manuf1, $manufs);
 
         //Attributes
@@ -252,7 +259,7 @@
         $first = array();
         $first[] = JHTML::_('select.option', '0',_JSHOP_SELECT, 'value_id','name');
 
-        foreach ($all_attributes as $key => $value){
+        foreach($all_attributes as $key=>$value){
             $values_for_attribut = $_attribut_value->getAllValues($value->attr_id);
             $all_attributes[$key]->values_select = JHTML::_('select.genericlist', array_merge($first, $values_for_attribut),'value_id['.$value->attr_id.']','class = "inputbox" size = "5" multiple="multiple" id = "value_id_'.$value->attr_id.'"','value_id','name');
             $all_attributes[$key]->values = $values_for_attribut;
@@ -271,7 +278,7 @@
         $price_modification[] = JHTML::_('select.option', '=','=', 'id','name');
         $price_modification[] = JHTML::_('select.option', '%','%', 'id','name');
         
-        foreach ($all_independent_attributes as $key => $value){
+        foreach($all_independent_attributes as $key=>$value){
             $values_for_attribut = $_attribut_value->getAllValues($value->attr_id);            
             $all_independent_attributes[$key]->values_select = JHTML::_('select.genericlist', array_merge($first, $values_for_attribut),'attr_ind_id_tmp_'.$value->attr_id.'','class = "inputbox" ','value_id','name');
             $all_independent_attributes[$key]->values = $values_for_attribut;
@@ -286,6 +293,7 @@
             $_deliveryTimes = $this->getModel("deliveryTimes");
             $all_delivery_times = $_deliveryTimes->getDeliveryTimes();                
             $all_delivery_times0 = array();
+            $all_delivery_times0[0] = new stdClass();
             $all_delivery_times0[0]->id = '0';
             $all_delivery_times0[0]->name = _JSHOP_NONE;        
             $lists['deliverytimes'] = JHTML::_('select.genericlist', array_merge($all_delivery_times0, $all_delivery_times),'delivery_times_id','class = "inputbox" size = "1"','id','name',$product->delivery_times_id);        
@@ -610,6 +618,7 @@
             $this->setRedirect("index.php?option=com_jshopping&controller=products&task=edit&product_id=".$cid[0]);
             return 0;
         }        
+        $id_vendor_cuser = getIdVendorForCUser();
         $jshopConfig = JSFactory::getConfig();
         $db = JFactory::getDBO();
         JPluginHelper::importPlugin('jshoppingadmin');
@@ -633,13 +642,15 @@
         $categories = buildTreeCategory(0,1,0);
         
         $manuf1 = array();
+        $manuf1[-1] = new stdClass();
         $manuf1[-1]->manufacturer_id = '-1';
         $manuf1[-1]->name = "- - -";
+        $manuf1[0] = new stdClass();
         $manuf1[0]->manufacturer_id = '0';
         $manuf1[0]->name = _JSHOP_NONE;
 
         $_manufacturer =$this->getModel('manufacturers');
-        $manufs = $_manufacturer->getAllManufacturers(0);
+        $manufs = $_manufacturer->getList();
         $manufs = array_merge($manuf1, $manufs);
         
         $price_modification = array();
@@ -656,8 +667,10 @@
             $_deliveryTimes = $this->getModel("deliveryTimes");
             $all_delivery_times = $_deliveryTimes->getDeliveryTimes();                
             $all_delivery_times0 = array();
+            $all_delivery_times0[-1] = new stdClass();
             $all_delivery_times0[-1]->id = '-1';
             $all_delivery_times0[-1]->name = "- - -";
+            $all_delivery_times0[0] = new stdClass();
             $all_delivery_times0[0]->id = '0';
             $all_delivery_times0[0]->name = _JSHOP_NONE;
             $lists['deliverytimes'] = JHTML::_('select.genericlist', array_merge($all_delivery_times0, $all_delivery_times),'delivery_times_id','class = "inputbox" size = "1"','id','name');
@@ -710,10 +723,16 @@
         }
         //
         
+        $published = array();
+        $published[] = JHTML::_('select.option', '-1', "- - -", 'value', 'name');
+        $published[] = JHTML::_('select.option', 0, _JSHOP_UNPUBLISH, 'value', 'name');
+        $published[] = JHTML::_('select.option', 1, _JSHOP_PUBLISH, 'value', 'name');       
+        $lists['product_publish'] = JHTML::_('select.genericlist', $published, 'product_publish', '', 'value', 'name');
+        
         $lists['manufacturers'] = JHTML::_('select.genericlist', $manufs,'product_manufacturer_id','class = "inputbox" size = "1"','manufacturer_id','name');
         
         $lists['tax'] = JHTML::_('select.genericlist', $list_tax,'product_tax_id','class = "inputbox" size = "1"','tax_id','tax_name');
-        $lists['categories'] = JHTML::_('select.genericlist', $categories, 'category_id[]', 'class="inputbox" size="10" multiple = "multiple" '.$category_select_onclick, 'category_id', 'name');
+        $lists['categories'] = JHTML::_('select.genericlist', $categories, 'category_id[]', 'class="inputbox" size="10" multiple = "multiple" ', 'category_id', 'name');
         $lists['templates'] = getTemplates('product', "", 1);
         
         $view=$this->getView("product_edit", 'html');
@@ -729,6 +748,7 @@
     }
     
     function savegroup(){
+        $jshopConfig = JSFactory::getConfig();
         JPluginHelper::importPlugin('jshoppingadmin');
         $dispatcher = JDispatcher::getInstance();
         $dispatcher->trigger('onBeforSaveListProduct', array() );
@@ -742,6 +762,9 @@
             if ($post['access']!=-1){
                 $product->set('access', $post['access']);
             }
+            if ($post['product_publish']!=-1){
+                $product->set('product_publish', $post['product_publish']);
+            }
             if ($post['product_weight']!=""){
                 $product->set('product_weight', $post['product_weight']);
             }
@@ -776,8 +799,12 @@
                 $product->set('basic_price_unit_id', $post['basic_price_unit_id']);
             }
             if ($post['product_price']!=""){
+                $oldprice = $product->product_price;
                 $price = $_products->getModPrice($product->product_price, saveAsPrice($post['product_price']), $post['mod_price']);
                 $product->set('product_price', $price);
+                if ($post['use_old_val_price']==1){
+                    $product->set('product_old_price', $oldprice);
+                }
             }
             if ($post['product_old_price']!=""){
                 $price = $_products->getModPrice($product->product_old_price, saveAsPrice($post['product_old_price']), $post['mod_old_price']);
@@ -789,8 +816,18 @@
             if ($post['category_id']){
                 $_products->setCategoryToProduct($id, $post['category_id']);
             }
+            $_products->updatePriceAndQtyDependAttr($id, $post);            
+            $product->store();
             
-            $product->store();
+            if ($post['product_price']!=""){
+                $mprice = $product->getMinimumPrice();
+                $product->set('min_price', $mprice);
+            }
+            if (!$product->unlimited){
+                $qty = $product->getFullQty();
+                $product->set('product_quantity', $qty);
+            }
+            $product->store();            
             unset($product);
         }
 
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/config.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/config.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/config.php	(revision 20)
@@ -21,7 +21,7 @@
         addSubmenu("config");        
     }
 
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $jshopConfig = JSFactory::getConfig();        
         $current_currency = JTable::getInstance('currency', 'jshop');
         $current_currency->load($jshopConfig->mainCurrency);
@@ -137,6 +137,7 @@
         $view = $this->getView("config", 'html');
         $view->setLayout("fieldregister");
         
+        $config = new stdClass();
         include($jshopConfig->path.'lib/default_config.php');
 
         $current_fields = $jshopConfig->getListFieldsRegister();
@@ -175,7 +176,8 @@
 		$lists['currencies'] = JHTML::_('select.genericlist', $currencies,'mainCurrency','class = "inputbox" size = "1"','currency_id','currency_name',$jshopConfig->mainCurrency);
 		
 		$i = 0;
-		foreach ($jshopConfig->format_currency as $key => $value) {
+		foreach($jshopConfig->format_currency as $key=>$value){
+            $currenc[$i] = new stdClass();
 			$currenc[$i]->id_cur = $key;
 			$currenc[$i]->format = $value;
 			$i++;
@@ -283,7 +285,10 @@
         $array = array('hide_shipping_step', 'hide_payment_step', 'order_send_pdf_client','order_send_pdf_admin','hide_tax', 'show_registerform_in_logintemplate','sorting_country_in_alphabet','show_weight_order', 'discount_use_full_sum','show_cart_all_step_checkout',"show_product_code_in_cart",'show_return_policy_in_email_order',
                         'client_allow_cancel_order', 'admin_not_send_email_order_vendor_order','not_redirect_in_cart_after_buy','calcule_tax_after_discount');
         if ($tab == 7){
-            foreach ($array as $key => $value) {
+            if (!$post['next_order_number']){
+                unset($post['next_order_number']);
+            }
+            foreach($array as $key=>$value){
                 if (!isset($post[$value])) $post[$value] = 0;
             }
             $result = array();
@@ -591,6 +596,7 @@
     
 	function otherconfig(){
 		$jshopConfig = JSFactory::getConfig();
+        $config = new stdClass();
 		include($jshopConfig->path.'lib/default_config.php');
         $tax_rule_for = array();
         $tax_rule_for[] = JHTML::_('select.option', 0, _JSHOP_FIRMA_CLIENT, 'id', 'name' );
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/languages.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/languages.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/languages.php	(revision 20)
@@ -18,7 +18,7 @@
         addSubmenu("other");
     }
 
-    function display(){  	        		
+    function display($cachable = false, $urlparams = false){  	        		
         
         $languages = $this->getModel("languages");
         $rows = $languages->getAllLanguages(0);
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/attributesvalues.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/attributesvalues.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/attributesvalues.php	(revision 20)
@@ -21,13 +21,18 @@
         addSubmenu("other");
     }
 
-    function display(){
+    function display($cachable = false, $urlparams = false){
 		$attr_id = JRequest::getInt("attr_id");
 		$db = JFactory::getDBO();
         $jshopConfig = JSFactory::getConfig();
         
+        $mainframe = JFactory::getApplication();
+		$context = "jshoping.list.admin.attr_values";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "value_ordering", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
+        
 		$attributValues = $this->getModel("AttributValue");
-		$rows = $attributValues->getAllValues($attr_id);
+		$rows = $attributValues->getAllValues($attr_id, $filter_order, $filter_order_Dir);
 		$attribut = $this->getModel("attribut");
 
 		$attr_name = $attribut->getName($attr_id);
@@ -37,6 +42,8 @@
         $view->assign('attr_id', $attr_id);
         $view->assign('config', $jshopConfig);
         $view->assign('attr_name', $attr_name);
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
 		$view->displayList(); 
 	}
 	
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/productfields.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/productfields.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/productfields.php	(revision 20)
@@ -21,13 +21,19 @@
         addSubmenu("other");
     }
     
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $db = JFactory::getDBO();
+        
+        $mainframe = JFactory::getApplication();
+		$context = "jshoping.list.admin.productfields";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "F.ordering", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
+        
         $_categories = $this->getModel("categories");
         $listCats = $_categories->getAllList(1);
         
         $_productfields = $this->getModel("productFields");
-        $rows = $_productfields->getList();
+        $rows = $_productfields->getList(0, $filter_order, $filter_order_Dir);
         foreach($rows as $k=>$v){
             if ($v->allcats){
                 $rows[$k]->printcat = _JSHOP_ALL;
@@ -59,6 +65,8 @@
         $view->assign('rows', $rows);
         $view->assign('vals', $vals);
         $view->assign('types', $types);
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
         $view->displayList();
     }
     
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/importexport.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/importexport.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/importexport.php	(revision 20)
@@ -19,7 +19,7 @@
         addSubmenu("other");
     }
 
-    function display(){
+    function display($cachable = false, $urlparams = false){
         
         if ($this->getTask()!="" && $this->getTask()!="backtolistie" && JRequest::getInt("ie_id")){
             $this->view();
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/orderstatus.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/orderstatus.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/orderstatus.php	(revision 20)
@@ -21,17 +21,24 @@
         addSubmenu("other");
     }
 
-	function display(){
+	function display($cachable = false, $urlparams = false){
+        $mainframe = JFactory::getApplication();
+		$context = "jshoping.list.admin.orderstatus";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "status_id", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
+        
 		$_order = $this->getModel("orders");
-		$rows = $_order->getAllOrderStatus();
+		$rows = $_order->getAllOrderStatus($filter_order, $filter_order_Dir);
 
 		$view=$this->getView("orderstatus", 'html');
         $view->setLayout("list");
-        $view->assign('rows', $rows);        
+        $view->assign('rows', $rows); 
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
 		$view->displayList();
 	}
 	
-	function edit() {
+	function edit(){
 		$status_id = JRequest::getInt("status_id");
 		$order_status = JTable::getInstance('orderStatus', 'jshop');
 		$order_status->load($status_id);
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/other.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/other.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/other.php	(revision 20)
@@ -12,7 +12,7 @@
 
 class JshoppingControllerOther extends JController{
 
-    function display(){
+    function display($cachable = false, $urlparams = false){
         checkAccessController("other");
         addSubmenu("other");
         $view=$this->getView("panel", 'html');
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/productfieldgroups.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/productfieldgroups.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/productfieldgroups.php	(revision 20)
@@ -21,7 +21,7 @@
         addSubmenu("other");
     }
     
-    function display(){        
+    function display($cachable = false, $urlparams = false){        
         $db = JFactory::getDBO();
         $_productfieldgroups = $this->getModel("productFieldGroups");
         $rows = $_productfieldgroups->getList();
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/shippingextprice.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/shippingextprice.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/shippingextprice.php	(revision 20)
@@ -22,7 +22,7 @@
         addSubmenu("other");
     }
     
-    function display(){
+    function display($cachable = false, $urlparams = false){
 		$shippings = $this->getModel("shippingExtPrice");
 		$rows = $shippings->getList();
         
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/categories.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/categories.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/categories.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.1 31.08.2012
+* @version      3.12.0 31.08.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -20,42 +20,32 @@
         addSubmenu("categories");
     }
     
-    function display(){
+    function display($cachable = false, $urlparams = false){
         $mainframe = JFactory::getApplication();
-        $jshopConfig = JSFactory::getConfig();
         $_categories = $this->getModel("categories");
         
         $context = "jshopping.list.admin.category";
-        $catid = $mainframe->getUserStateFromRequest( $context.'catid', 'catid', 0, 'int');
+        $limit = $mainframe->getUserStateFromRequest($context.'limit', 'limit', $mainframe->getCfg('list_limit'), 'int' );
+        $limitstart = $mainframe->getUserStateFromRequest($context.'limitstart', 'limitstart', 0, 'int' );
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "product_id", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
+
+        $categories = $_categories->getTreeAllCategories($filter_order, $filter_order_Dir);
+        $total = count($categories);
+
+        jimport('joomla.html.pagination');
+        $pagination = new JPagination($total, $limitstart, $limit);
         
-        if ($catid){
-            $category = JTable::getInstance('category', 'jshop');
-            $category->load($catid);
-            $category->name = $category->getName();
-            $tree = $category->getTreeChild();
-        }else{
-            $tree = array();
-        }
-        
-        $countsubcat = $_categories->getAllCatCountSubCat();
         $countproducts = $_categories->getAllCatCountProducts();
-
-        $categories = $_categories->getSubCategories($catid, 'ordering');
-        $parentTop = new stdClass();
-        $parentTop->category_id = 0;
-        $parentTop->name = _JSHOP_TOP_LEVEL;
-        $categories_select = buildTreeCategory(0,1,0);
-        array_unshift($categories_select, $parentTop);
-        $lists['treecategories'] = JHTML::_('select.genericlist', $categories_select,'catid','class="inputbox" onchange = "document.adminForm.submit();"','category_id','name', $catid );
         
-        $view=$this->getView("category", 'html');
+        $categories = array_slice($categories, $pagination->limitstart, $pagination->limit);
+        $view = $this->getView("category", 'html');
         $view->setLayout("list");
         $view->assign('categories', $categories);
-        $view->assign('countsubcat', $countsubcat);
         $view->assign('countproducts', $countproducts);
-        $view->assign('lists', $lists);
-        $view->assign('tree', $tree);
-        $view->assign('category_parent_id', $catid);
+        $view->assign('pagination', $pagination);
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
         $view->displayList();
     }
     
@@ -86,6 +76,7 @@
         $lists['templates'] = getTemplates('category', $category->category_template);
         $lists['onelevel'] = $rows;    
         
+        $parentTop = new stdClass();
         $parentTop->category_id = 0;
         $parentTop->name = _JSHOP_TOP_LEVEL;
         $categories = buildTreeCategory(0,1,0);
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/deliverytimes.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/deliverytimes.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/deliverytimes.php	(revision 20)
@@ -21,12 +21,19 @@
         addSubmenu("other");
     }
 
-	function display(){
+	function display($cachable = false, $urlparams = false){
+        $mainframe = JFactory::getApplication();
+		$context = "jshoping.list.admin.deliverytimes";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "name", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
+        
 		$_deliveryTimes = $this->getModel("deliveryTimes");
-		$rows = $_deliveryTimes->getDeliveryTimes();
+		$rows = $_deliveryTimes->getDeliveryTimes($filter_order, $filter_order_Dir);
 		$view=$this->getView("deliverytimes", 'html');
         $view->setLayout("list");
-        $view->assign('rows', $rows);        
+        $view->assign('rows', $rows); 
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
 		$view->displayList();
 	}
 	
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/attributes.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/attributes.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/attributes.php	(revision 20)
@@ -21,10 +21,15 @@
         addSubmenu("other");
     }
 
-    function display(){
+    function display($cachable = false, $urlparams = false){ 
+        $mainframe = JFactory::getApplication();
+		$context = "jshoping.list.admin.attributes";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "attr_ordering", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
+        
     	$attributes = $this->getModel("attribut");
     	$attributesvalue = $this->getModel("attributValue");
-        $rows = $attributes->getAllAttributes();
+        $rows = $attributes->getAllAttributes(0, null, $filter_order, $filter_order_Dir);
 		foreach ($rows as $key => $value){
 			$rows[$key]->values = splitValuesArrayObject( $attributesvalue->getAllValues($rows[$key]->attr_id), 'name');
             $rows[$key]->count_values = count($attributesvalue->getAllValues($rows[$key]->attr_id));
@@ -32,6 +37,8 @@
         $view = $this->getView("attributes", 'html');
         $view->setLayout("list");
 		$view->assign('rows', $rows);
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
         $view->displayList();
     }
 	
Index: Z:/home/jshop/INSTALL/pack/admin/controllers/freeattributes.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/controllers/freeattributes.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/controllers/freeattributes.php	(revision 20)
@@ -21,12 +21,19 @@
         addSubmenu("other");
     }
 
-    function display(){
+    function display($cachable = false, $urlparams = false){
+        $mainframe = JFactory::getApplication();
+		$context = "jshoping.list.admin.freeattributes";
+        $filter_order = $mainframe->getUserStateFromRequest($context.'filter_order', 'filter_order', "ordering", 'cmd');
+        $filter_order_Dir = $mainframe->getUserStateFromRequest($context.'filter_order_Dir', 'filter_order_Dir', "asc", 'cmd');
+        
     	$freeattributes = $this->getModel("freeattribut");    	
-        $rows = $freeattributes->getAll();
+        $rows = $freeattributes->getAll($filter_order, $filter_order_Dir);
         $view=$this->getView("freeattributes", 'html');
         $view->setLayout("list");
 		$view->assign('rows', $rows);
+        $view->assign('filter_order', $filter_order);
+        $view->assign('filter_order_Dir', $filter_order_Dir);
         $view->displayList();
     }
 	
Index: Z:/home/jshop/INSTALL/pack/admin/install/install.sql
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/install/install.sql	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/install/install.sql	(revision 20)
@@ -27,12 +27,13 @@
 
 CREATE TABLE IF NOT EXISTS `#__jshopping_currencies` (
 `currency_id` int(11) NOT NULL auto_increment,
-`currency_name` varchar(64) NOT NULL default '',
-`currency_code` varchar(20) NOT NULL default '',
-`currency_code_iso` VARCHAR( 3 ) NOT NULL DEFAULT '',
-`currency_ordering` int(11) NOT NULL default '0',
-`currency_value` DECIMAL(14,6) NOT NULL default '0',
-`currency_publish` tinyint(1) NOT NULL default '0',
+`currency_name` varchar(64) NOT NULL,
+`currency_code` varchar(20) NOT NULL,
+`currency_code_iso` VARCHAR(3) NOT NULL,
+`currency_code_num` VARCHAR(3) NOT NULL,
+`currency_ordering` int(11) NOT NULL,
+`currency_value` DECIMAL(14,6) NOT NULL,
+`currency_publish` tinyint(1) NOT NULL,
 PRIMARY KEY  (`currency_id`)
 ) /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci*/;
 
@@ -429,8 +430,10 @@
 CREATE TABLE IF NOT EXISTS `#__jshopping_shipping_method_price` (
 `sh_pr_method_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
 `shipping_method_id` INT NOT NULL ,
-`shipping_tax_id` int(11) NOT NULL default '0',
+`shipping_tax_id` int(11) NOT NULL,
 `shipping_stand_price` DECIMAL(12,2) NOT NULL,
+`package_tax_id` int(11) NOT NULL,
+`package_stand_price` DECIMAL(12,2) NOT NULL,
 `delivery_times_id` int(11) NOT NULL,
 `params` text NOT NULL
 ) /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci*/;
@@ -506,11 +509,15 @@
 `order_payment` DECIMAL(12,2) NOT NULL,
 `order_discount` DECIMAL(12,2) NOT NULL,
 `shipping_tax` DECIMAL(8,2) NOT NULL,
+`shipping_tax_ext` text NOT NULL,
 `payment_tax` DECIMAL(8,2) NOT NULL,
+`payment_tax_ext` text NOT NULL,
+`order_package` DECIMAL(12,2) NOT NULL,
+`package_tax_ext` text NOT NULL,
 `currency_code` VARCHAR( 20 ) NOT NULL,
 `currency_code_iso` VARCHAR( 3 ) NOT NULL,
 `currency_exchange` DECIMAL(14,6) NOT NULL,
-`order_status` varchar(1) NOT NULL,
+`order_status` tinyint(4) NOT NULL,
 `order_created` tinyint(1) NOT NULL,
 `order_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
 `order_m_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -520,6 +527,7 @@
 `payment_params` text NOT NULL,
 `payment_params_data` text NOT NULL,
 `delivery_time` VARCHAR(100) NOT NULL,
+`delivery_date` DATETIME NOT NULL,
 `coupon_id` int(11) NOT NULL,
 `ip_address` varchar(15) NOT NULL,
 `order_add_info` text NOT NULL,
@@ -1035,7 +1043,7 @@
 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 3, 1, 1, 1,
 'a:3:{s:8:"register";a:15:{s:5:"title";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:6:"l_name";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:10:"firma_name";a:1:{s:7:"display";s:1:"1";}s:6:"street";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:3:"zip";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:4:"city";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:5:"state";a:1:{s:7:"display";s:1:"1";}s:7:"country";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:5:"phone";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:3:"fax";a:1:{s:7:"display";s:1:"1";}s:6:"f_name";a:2:{s:7:"require";i:1;s:7:"display";i:1;}s:5:"email";a:2:{s:7:"require";i:1;s:7:"display";i:1;}s:6:"u_name";a:2:{s:7:"require";i:1;s:7:"display";i:1;}s:8:"password";a:2:{s:7:"require";i:1;s:7:"display";i:1;}s:10:"password_2";a:2:{s:7:"require";i:1;s:7:"display";i:1;}}s:7:"address";a:22:{s:5:"title";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:6:"l_name";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:10:"firma_name";a:1:{s:7:"display";s:1:"1";}s:6:"street";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:3:"zip";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:4:"city";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:5:"state";a:1:{s:7:"display";s:1:"1";}s:7:"country";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:5:"phone";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:3:"fax";a:1:{s:7:"display";s:1:"1";}s:7:"d_title";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:8:"d_f_name";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:8:"d_l_name";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:12:"d_firma_name";a:1:{s:7:"display";s:1:"1";}s:8:"d_street";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:5:"d_zip";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:6:"d_city";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:7:"d_state";a:1:{s:7:"display";s:1:"1";}s:9:"d_country";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:7:"d_phone";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:6:"f_name";a:2:{s:7:"require";i:1;s:7:"display";i:1;}s:5:"email";a:2:{s:7:"require";i:1;s:7:"display";i:1;}}s:11:"editaccount";a:22:{s:5:"title";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:6:"l_name";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:10:"firma_name";a:1:{s:7:"display";s:1:"1";}s:6:"street";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:3:"zip";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:4:"city";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:5:"state";a:1:{s:7:"display";s:1:"1";}s:7:"country";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:5:"phone";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:3:"fax";a:1:{s:7:"display";s:1:"1";}s:7:"d_title";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:8:"d_f_name";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:8:"d_l_name";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:12:"d_firma_name";a:1:{s:7:"display";s:1:"1";}s:8:"d_street";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:5:"d_zip";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:6:"d_city";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:7:"d_state";a:1:{s:7:"display";s:1:"1";}s:9:"d_country";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:7:"d_phone";a:2:{s:7:"display";s:1:"1";s:7:"require";s:1:"1";}s:6:"f_name";a:2:{s:7:"require";i:1;s:7:"display";i:1;}s:5:"email";a:2:{s:7:"require";i:1;s:7:"display";i:1;}}}');
 
-INSERT INTO `#__jshopping_currencies` ( `currency_id` , `currency_name` , `currency_code`, `currency_code_iso` , `currency_ordering` , `currency_publish` , `currency_value` ) VALUES ( NULL , 'Euro', 'EUR', 'EUR', '1', '1', '1.00');
+INSERT INTO `#__jshopping_currencies` ( `currency_id` , `currency_name` , `currency_code`, `currency_code_iso`, `currency_code_num` , `currency_ordering` , `currency_publish` , `currency_value` ) VALUES ( NULL , 'Euro', 'EUR', 'EUR', '978', '1', '1', '1.00');
 
 INSERT INTO `#__jshopping_order_status` (`status_id`, `status_code`, `name_en-GB`, `name_de-DE`) VALUES (1, 'P', 'Pending', 'Offen'),(2, 'C', 'Confirmed', 'Bestätigt'),(3, 'X', 'Cancelled', 'Abgebrochen'),(4, 'R', 'Refunded', 'Gutschrift'),(5, 'S', 'Shipped', 'Gesendet'),(6, 'O', 'Paid', 'Bezahlt'),(7, 'F', 'Complete', 'Abgeschlossen');
 
@@ -1050,7 +1058,7 @@
 
 INSERT INTO `#__jshopping_taxes` ( `tax_id` , `tax_name` , `tax_value` ) VALUES (1, 'Normal', '19%');
 
-INSERT INTO `#__jshopping_shipping_method_price` VALUES (1, 1, 1, 10.00, 0,''),(2, 2, 1, 25.00, 0,'');
+INSERT INTO `#__jshopping_shipping_method_price` VALUES (1, 1, 1, 10.00, 1, 0, 0, ''),(2, 2, 1, 25.00, 1, 0, 0, '');
 
 INSERT INTO `#__jshopping_shipping_method_price_countries` VALUES (1, 239, 1), (2, 238, 1), (3, 237, 1), (4, 236, 1), (5, 235, 1), (6, 234, 1), (7, 233, 1), (8, 232, 1), (9, 231, 1), (10, 230, 1), (11, 229, 1), (12, 228, 1), (13, 227, 1), (14, 226, 1), (15, 225, 1), (16, 224, 1), (17, 223, 1), (18, 222, 1), (19, 221, 1), (20, 220, 1), (21, 219, 1), (22, 218, 1), (23, 217, 1), (24, 216, 1), (25, 215, 1), (26, 214, 1), (27, 213, 1), (28, 212, 1), (29, 211, 1), (30, 210, 1), (31, 209, 1), (32, 208, 1), (33, 207, 1), (34, 206, 1), (35, 205, 1), (36, 204, 1), (37, 203, 1), (38, 202, 1), (39, 201, 1), (40, 200, 1), (41, 199, 1), (42, 198, 1), (43, 197, 1), (44, 196, 1), (45, 195, 1), (46, 194, 1), (47, 193, 1), (48, 192, 1), (49, 191, 1), (50, 190, 1), (51, 189, 1), (52, 188, 1), (53, 187, 1), (54, 186, 1), (55, 185, 1), (56, 184, 1), (57, 183, 1), (58, 182, 1), (59, 181, 1), (60, 180, 1), (61, 179, 1), (62, 178, 1), (63, 177, 1), (64, 176, 1), (65, 175, 1), (66, 174, 1), (67, 173, 1), (68, 172, 1), (69, 171, 1), (70, 170, 1), (71, 169, 1), (72, 168, 1), (73, 167, 1), (74, 166, 1), (75, 165, 1), (76, 164, 1), (77, 163, 1), (78, 162, 1), (79, 161, 1), (80, 160, 1), (81, 159, 1), (82, 158, 1), (83, 157, 1), (84, 156, 1), (85, 155, 1), (86, 154, 1), (87, 153, 1), (88, 152, 1), (89, 151, 1), (90, 150, 1), (91, 149, 1), (92, 148, 1), (93, 147, 1), (94, 146, 1), (95, 145, 1), (96, 144, 1), (97, 143, 1), (98, 142, 1), (99, 141, 1), (100, 140, 1), (101, 139, 1), (102, 138, 1), (103, 137, 1), (104, 136, 1), (105, 135, 1), (106, 134, 1), (107, 133, 1), (108, 132, 1), (109, 131, 1), (110, 130, 1), (111, 129, 1), (112, 128, 1), (113, 127, 1), (114, 126, 1), (115, 125, 1), (116, 124, 1), (117, 123, 1), (118, 122, 1), (119, 121, 1), (120, 120, 1), (121, 119, 1), (122, 118, 1), (123, 117, 1), (124, 116, 1), (125, 115, 1), (126, 114, 1), (127, 113, 1), (128, 112, 1), (129, 111, 1), (130, 110, 1), (131, 109, 1), (132, 108, 1), (133, 107, 1), (134, 106, 1), (135, 105, 1), (136, 104, 1), (137, 103, 1), (138, 102, 1), (139, 101, 1), (140, 100, 1), (141, 99, 1), (142, 98, 1), (143, 97, 1), (144, 96, 1), (145, 95, 1), (146, 94, 1), (147, 93, 1), (148, 92, 1), (149, 91, 1), (150, 90, 1), (151, 89, 1), (152, 88, 1), (153, 87, 1), (154, 86, 1), (155, 85, 1), (156, 84, 1), (157, 83, 1), (158, 82, 1), (159, 81, 1), (160, 80, 1), (161, 79, 1), (162, 78, 1), (163, 77, 1), (164, 76, 1), (165, 75, 1), (166, 74, 1), (167, 73, 1), (168, 72, 1), (169, 71, 1), (170, 70, 1), (171, 69, 1), (172, 68, 1), (173, 67, 1), (174, 66, 1), (175, 65, 1), (176, 64, 1), (177, 63, 1), (178, 62, 1), (179, 61, 1), (180, 60, 1), (181, 59, 1), (182, 58, 1), (183, 57, 1), (184, 56, 1), (185, 55, 1), (186, 54, 1), (187, 53, 1), (188, 52, 1), (189, 51, 1), (190, 50, 1), (191, 49, 1), (192, 48, 1), (193, 47, 1), (194, 46, 1), (195, 45, 1), (196, 44, 1), (197, 43, 1), (198, 42, 1), (199, 41, 1), (200, 40, 1), (201, 39, 1), (202, 38, 1), (203, 37, 1), (204, 36, 1), (205, 35, 1), (206, 34, 1), (207, 33, 1), (208, 32, 1), (209, 31, 1), (210, 30, 1), (211, 29, 1), (212, 28, 1), (213, 27, 1), (214, 26, 1), (215, 25, 1), (216, 24, 1), (217, 23, 1), (218, 22, 1), (219, 21, 1), (220, 20, 1), (221, 19, 1), (222, 18, 1), (223, 17, 1), (224, 16, 1), (225, 15, 1), (226, 14, 1), (227, 13, 1), (228, 12, 1), (229, 11, 1), (230, 10, 1), (231, 9, 1), (232, 8, 1), (233, 7, 1), (234, 6, 1), (235, 5, 1), (236, 4, 1), (237, 3, 1), (238, 2, 1), (239, 1, 1), (240, 239, 2), (241, 238, 2), (242, 237, 2), (243, 236, 2), (244, 235, 2), (245, 234, 2), (246, 233, 2), (247, 232, 2), (248, 231, 2), (249, 230, 2), (250, 229, 2), (251, 228, 2), (252, 227, 2), (253, 226, 2), (254, 225, 2), (255, 224, 2), (256, 223, 2), (257, 222, 2), (258, 221, 2), (259, 220, 2), (260, 219, 2), (261, 218, 2), (262, 217, 2), (263, 216, 2), (264, 215, 2), (265, 214, 2), (266, 213, 2), (267, 212, 2), (268, 211, 2), (269, 210, 2), (270, 209, 2), (271, 208, 2), (272, 207, 2), (273, 206, 2), (274, 205, 2), (275, 204, 2), (276, 203, 2), (277, 202, 2), (278, 201, 2), (279, 200, 2), (280, 199, 2), (281, 198, 2), (282, 197, 2), (283, 196, 2), (284, 195, 2), (285, 194, 2), (286, 193, 2), (287, 192, 2), (288, 191, 2), (289, 190, 2), (290, 189, 2), (291, 188, 2), (292, 187, 2), (293, 186, 2), (294, 185, 2), (295, 184, 2), (296, 183, 2), (297, 182, 2), (298, 181, 2), (299, 180, 2), (300, 179, 2), (301, 178, 2), (302, 177, 2), (303, 176, 2), (304, 175, 2), (305, 174, 2), (306, 173, 2), (307, 172, 2), (308, 171, 2), (309, 170, 2), (310, 169, 2), (311, 168, 2), (312, 167, 2), (313, 166, 2), (314, 165, 2), (315, 164, 2), (316, 163, 2), (317, 162, 2), (318, 161, 2), (319, 160, 2), (320, 159, 2), (321, 158, 2), (322, 157, 2), (323, 156, 2), (324, 155, 2), (325, 154, 2), (326, 153, 2), (327, 152, 2), (328, 151, 2), (329, 150, 2), (330, 149, 2), (331, 148, 2), (332, 147, 2), (333, 146, 2), (334, 145, 2), (335, 144, 2), (336, 143, 2), (337, 142, 2), (338, 141, 2), (339, 140, 2), (340, 139, 2), (341, 138, 2), (342, 137, 2), (343, 136, 2), (344, 135, 2), (345, 134, 2), (346, 133, 2), (347, 132, 2), (348, 131, 2), (349, 130, 2), (350, 129, 2), (351, 128, 2), (352, 127, 2), (353, 126, 2), (354, 125, 2), (355, 124, 2), (356, 123, 2), (357, 122, 2), (358, 121, 2), (359, 120, 2), (360, 119, 2), (361, 118, 2), (362, 117, 2), (363, 116, 2), (364, 115, 2), (365, 114, 2), (366, 113, 2), (367, 112, 2), (368, 111, 2), (369, 110, 2), (370, 109, 2), (371, 108, 2), (372, 107, 2), (373, 106, 2), (374, 105, 2), (375, 104, 2), (376, 103, 2), (377, 102, 2), (378, 101, 2), (379, 100, 2), (380, 99, 2), (381, 98, 2), (382, 97, 2), (383, 96, 2), (384, 95, 2), (385, 94, 2), (386, 93, 2), (387, 92, 2), (388, 91, 2), (389, 90, 2), (390, 89, 2), (391, 88, 2), (392, 87, 2), (393, 86, 2), (394, 85, 2), (395, 84, 2), (396, 83, 2), (397, 82, 2), (398, 81, 2), (399, 80, 2), (400, 79, 2), (401, 78, 2), (402, 77, 2), (403, 76, 2), (404, 75, 2), (405, 74, 2), (406, 73, 2), (407, 72, 2), (408, 71, 2), (409, 70, 2), (410, 69, 2), (411, 68, 2), (412, 67, 2), (413, 66, 2), (414, 65, 2), (415, 64, 2), (416, 63, 2), (417, 62, 2), (418, 61, 2), (419, 60, 2), (420, 59, 2), (421, 58, 2), (422, 57, 2), (423, 56, 2), (424, 55, 2), (425, 54, 2), (426, 53, 2), (427, 52, 2), (428, 51, 2), (429, 50, 2), (430, 49, 2), (431, 48, 2), (432, 47, 2), (433, 46, 2), (434, 45, 2), (435, 44, 2), (436, 43, 2), (437, 42, 2), (438, 41, 2), (439, 40, 2), (440, 39, 2), (441, 38, 2), (442, 37, 2), (443, 36, 2), (444, 35, 2), (445, 34, 2), (446, 33, 2), (447, 32, 2), (448, 31, 2), (449, 30, 2), (450, 29, 2), (451, 28, 2), (452, 27, 2), (453, 26, 2), (454, 25, 2), (455, 24, 2), (456, 23, 2), (457, 22, 2), (458, 21, 2), (459, 20, 2), (460, 19, 2), (461, 18, 2), (462, 17, 2), (463, 16, 2), (464, 15, 2), (465, 14, 2), (466, 13, 2), (467, 12, 2), (468, 11, 2), (469, 10, 2), (470, 9, 2), (471, 8, 2), (472, 7, 2), (473, 6, 2), (474, 5, 2), (475, 4, 2), (476, 3, 2), (477, 2, 2), (478, 1, 2);
 
@@ -1058,9 +1066,9 @@
 
 INSERT INTO `#__jshopping_usergroups` VALUES (1 , 'Default', '0.00', 'Default', 1);
 
-INSERT INTO `#__jshopping_config_seo` (`alias`, `ordering`) VALUES ('category', 10),('manufacturers', 20), ('cart', 30), ('wishlist', 40), ('login', 50), ('register', 60), ('editaccount', 70), ('myorders', 80), ('myaccount', 90), ('search', 100), ('search-result', 110), ('myorder-detail', 120), ('vendors', 130),('content-agb', 140),('content-return_policy', 150),('content-shipping', 160),('checkout-address', 170),('checkout-payment', 180),('checkout-shipping', 190),('checkout-preview', 200),('lastproducts', 210),('randomproducts', 220),('bestsellerproducts', 230),('labelproducts', 240),('topratingproducts', 250),('tophitsproducts', 260),('all-products', 270);
+INSERT INTO `#__jshopping_config_seo` (`alias`, `ordering`) VALUES ('category', 10),('manufacturers', 20), ('cart', 30), ('wishlist', 40), ('login', 50), ('register', 60), ('editaccount', 70), ('myorders', 80), ('myaccount', 90), ('search', 100), ('search-result', 110), ('myorder-detail', 120), ('vendors', 130),('content-agb', 140),('content-return_policy', 150),('content-shipping', 160),('content-privacy_statement',161),('checkout-address', 170),('checkout-payment', 180),('checkout-shipping', 190),('checkout-preview', 200),('lastproducts', 210),('randomproducts', 220),('bestsellerproducts', 230),('labelproducts', 240),('topratingproducts', 250),('tophitsproducts', 260),('all-products', 270);
 
-INSERT INTO `#__jshopping_config_statictext` (`alias`) VALUES ('home'),('manufacturer'),('agb'),('return_policy'),('order_email_descr'),('order_finish_descr'),('shipping');
+INSERT INTO `#__jshopping_config_statictext` (`alias`) VALUES ('home'),('manufacturer'),('agb'),('return_policy'),('order_email_descr'),('order_email_descr_end'),('order_finish_descr'),('shipping'),('privacy_statement');
 
 INSERT INTO `#__jshopping_vendors` (`id`, `shop_name`, `company_name`, `url`, `logo`, `adress`, `city`, `zip`, `state`, `country`, `f_name`, `l_name`, `middlename`, `phone`, `fax`, `email`, `benef_bank_info`, `benef_bic`, `benef_conto`, `benef_payee`, `benef_iban`, `benef_swift`, `interm_name`, `interm_swift`, `identification_number`, `tax_number`, `additional_information`, `user_id`, `main`, `publish`) VALUES
 (1, 'Shop name', 'Company', '', '', 'Address', 'City', 'Postal Code ', 'State', 81, 'First name ', 'Last name', '', '00000000', '00000000', 'email@email.com', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', '', '', 'Additional information', 0, 1, 1);
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/admin/jshopping.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/jshopping.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/jshopping.php	(revision 20)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version      3.11.4 20.08.2012
+* @version      3.12.0 20.08.2012
 * @author       MAXXmarketing GmbH
 * @package      Jshopping
 * @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
@@ -14,7 +14,6 @@
 }
 JTable::addIncludePath(JPATH_COMPONENT_SITE.'/tables');
 require_once(JPATH_COMPONENT_SITE."/lib/factory.php");
-require_once(JPATH_COMPONENT_SITE.'/lib/functions.php');
 require_once(JPATH_COMPONENT_ADMINISTRATOR.'/functions.php');
 
 $ajax = JRequest::getInt('ajax');
@@ -41,6 +40,10 @@
     header('Content-Type: text/html;charset=UTF-8');
 }
 
+JPluginHelper::importPlugin('jshopping');
+$dispatcher = JDispatcher::getInstance();
+$dispatcher->trigger('onAfterLoadShopParamsAdmin', array());
+
 $document = JFactory::getDocument();
 $document->addScript($jshopConfig->live_path.'js/jquery/jquery-'.$jshopConfig->load_jquery_version.'.min.js');
 $document->addScript($jshopConfig->live_path.'js/jquery/jquery-noconflict.js');
Index: Z:/home/jshop/INSTALL/pack/admin/js/functions.js
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/js/functions.js	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/js/functions.js	(revision 20)
@@ -331,8 +331,10 @@
         field="<input type='text' name='attrib_price[]' value='"+entered_price+"'>";
         html+="<td>"+field+"</td>";
         
-        field="<input type='text' name='attr_count[]' value='"+entered_count+"'>";
-        html+="<td>"+field+"</td>";
+        if (use_stock=="1"){
+            field="<input type='text' name='attr_count[]' value='"+entered_count+"'>";
+            html+="<td>"+field+"</td>";
+        }
         
         field="<input type='text' name='attr_ean[]' value='"+entered_ean+"'>";
         html+="<td>"+field+"</td>";
@@ -613,9 +615,11 @@
 	if (isNaN(discount)) discount = 0;
 	var shipping = parseFloat(jQuery("input[name=order_shipping]").val());
 	if (isNaN(shipping)) shipping = 0;
+    var opackage = parseFloat(jQuery("input[name=order_package]").val());
+    if (isNaN(opackage)) opackage = 0;
 	var payment = parseFloat(jQuery("input[name=order_payment]").val());
 	if (isNaN(payment)) payment = 0;
-	result = subtotal - discount + shipping + payment;
+	result = subtotal - discount + shipping+opackage + payment;
 	
 	if (jQuery("#display_price option:selected").val() == 1) {
 		jQuery("input[name^=tax_value]").each(function(){
@@ -644,4 +648,31 @@
 	jQuery("table.admintable input[name^='product_insert_code_']").each(function(){
 		changeVideoFileField(this);
 	});
+}
+
+function setBillingShippingFields(user) {
+	for(var field in user){
+		jQuery(".jshop_address [name='" + field + "']").val(user[field]);
+	}
+}
+
+function updateBillingShippingForUser(user_id) {
+	if (user_id > 0) {
+		var data = {};
+		data['user_id'] = user_id;
+		if (userinfo_ajax){
+			userinfo_ajax.abort();
+		}
+		userinfo_ajax = jQuery.ajax({
+			url: userinfo_link,
+			dataType: "json",
+			data: data,
+			type: "post",    
+			success: function (json) {
+				setBillingShippingFields(json);
+			}
+		});
+	} else {
+		setBillingShippingFields(userinfo_fields);
+	}
 }
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/admin/views/orderstatus/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/orderstatus/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/orderstatus/tmpl/list.php	(revision 20)
@@ -6,26 +6,24 @@
 <form action = "index.php?option=com_jshopping&controller=orderstatus" method = "post" name = "adminForm">
 <table class = "adminlist">
 <thead>
-  <tr>
-    <th class = "title" width  = "10">
-      #
-    </th>
-    <th width = "20">
-	  <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count = count( $rows );?>);" />
-    </th>
-    <th width = "200" align = "left">
-      <?php echo _JSHOP_TITLE;?>
-    </th>
-    <th align = "left">
-      <?php echo _JSHOP_CODE;?>
-    </th>
-    <th width = "50">
-        <?php echo _JSHOP_EDIT;?>
-    </th>
-    <th width = "40">
-        <?php echo _JSHOP_ID;?>
-    </th>
-  </tr>
+    <tr>
+        <th class = "title" width  = "10">#</th>
+        <th width = "20">
+            <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count = count( $rows );?>);" />
+        </th>
+        <th width = "200" align = "left">
+            <?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'name', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+        <th align = "left">
+            <?php echo JHTML::_('grid.sort', _JSHOP_CODE, 'status_code', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+        <th width = "50">
+            <?php echo _JSHOP_EDIT;?>
+        </th>
+        <th width = "40">
+            <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'status_id', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+    </tr>
 </thead>  
 <?php foreach($rows as $row){ ?>
   <tr class = "row<?php echo $i % 2;?>">
@@ -53,6 +51,8 @@
 ?>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "<?php echo JRequest::getVar('task', 0)?>" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/product_edit/tmpl/info.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/product_edit/tmpl/info.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/product_edit/tmpl/info.php	(revision 20)
@@ -153,6 +153,7 @@
          <input type = "text" name = "product_ean" id = "product_ean" value = "<?php echo $row->product_ean?>" onkeyup="updateEanForAttrib()"; />
        </td>
      </tr>
+     <?php if ($jshopConfig->stock){?>
      <tr>
        <td class="key">
          <?php echo _JSHOP_QUANTITY_PRODUCT;?>*
@@ -167,20 +168,13 @@
          </div>         
        </td>
      </tr>
-     <!--<tr>
-       <td class="key"><?php echo _JSHOP_AVILABILITY_PRODUCT;?></td>
-       <td>
-         <input type = "text" name = "product_availability" id = "product_availability" value = "<?php echo $row->product_availability?>" size="80" />
-         <?php echo JHTML::tooltip(_JSHOP_AVILABILITY_PRODUCT_INFO);?>
-       </td>
-     </tr>-->
+     <?php }?>
      <tr>
        <td class="key"><?php echo _JSHOP_URL; ?></td>
        <td>
          <input type = "text" name = "product_url" id = "product_url" value = "<?php echo $row->product_url?>" size="80" />
        </td>
      </tr>
-     
      <?php if ($jshopConfig->use_different_templates_cat_prod) { ?>
      <tr>
        <td class="key">
@@ -195,7 +189,7 @@
      <?php if (!$this->withouttax){?>
      <tr>     
        <td class="key">
-         <?php echo _JSHOP_NAME_TAX;?>*
+         <?php echo _JSHOP_TAX;?>*
        </td>
        <td>
          <?php echo $lists['tax'];?>
Index: Z:/home/jshop/INSTALL/pack/admin/views/product_edit/tmpl/editlist.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/product_edit/tmpl/editlist.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/product_edit/tmpl/editlist.php	(revision 20)
@@ -6,87 +6,98 @@
 <div class="jshop_edit">
 <div class="col100">
 <table class="admintable" width="90%">
-   <td class="key" style="width:180px;">
-     <?php echo _JSHOP_ACCESS;?>
-   </td>
-   <td>
-     <?php print $this->lists['access'];?>
-   </td>
- </tr>     
- <tr>
-   <td class="key">
-     <?php echo _JSHOP_PRODUCT_PRICE;?>
-   </td>
-   <td>
-     <?php echo $this->lists['price_mod_price'];?>
-     <input type = "text" name = "product_price" value = "" />
-     <?php echo $this->lists['currency'];?>
-   </td>
- </tr>
- <tr>
-   <td class="key">
-     <?php echo _JSHOP_OLD_PRICE;?>
-   </td>
-   <td>
-    <?php echo $this->lists['price_mod_old_price'];?>
-     <input type = "text" name = "product_old_price" value = "" />
-   </td>
- </tr>
- <?php if ($jshopConfig->admin_show_product_bay_price) { ?>
- <tr>
-   <td class="key">
-     <?php echo _JSHOP_PRODUCT_BUY_PRICE;?>
-   </td>
-   <td>
-     <input type = "text" name = "product_buy_price" value = "" />
-   </td>
- </tr>
- <?php } ?>
+    <tr>
+        <td class="key" style="width:180px;">
+             <?php echo _JSHOP_PUBLISH;?>
+        </td>
+        <td>
+            <?php print $this->lists['product_publish'];?>
+        </td>
+    </tr>
+    <tr>    
+        <td class="key" style="width:180px;">
+            <?php echo _JSHOP_ACCESS;?>
+        </td>
+        <td>
+            <?php print $this->lists['access'];?>
+        </td>
+    </tr>     
+    <tr>
+        <td class="key">
+            <?php echo _JSHOP_PRODUCT_PRICE;?>
+        </td>
+        <td>
+            <?php echo $this->lists['price_mod_price'];?>
+            <input type = "text" name = "product_price" value = "" />
+            <?php echo $this->lists['currency'];?>
+        </td>
+    </tr>
+    <tr>
+        <td class="key">
+            <?php echo _JSHOP_OLD_PRICE;?>
+        </td>
+        <td>
+            <span id='foldprice'><?php echo $this->lists['price_mod_old_price'];?>
+            <input type = "text" name = "product_old_price" value = "" />
+            <span style="width:5px;"></span>
+            </span>
+            <input type="checkbox" name="use_old_val_price" value="1" onclick="shfoldprice(this.checked)"> <?php print _JSHOP_USE_OLD_VALUE_PRICE?>
+        </td>
+    </tr>
+    <?php if ($jshopConfig->admin_show_product_bay_price) { ?>
+    <tr>
+        <td class="key">
+            <?php echo _JSHOP_PRODUCT_BUY_PRICE;?>
+        </td>
+        <td>
+            <input type = "text" name = "product_buy_price" value = "" />
+        </td>
+    </tr>
+    <?php } ?>
+    <tr>
+        <td class="key">
+            <?php echo _JSHOP_PRODUCT_WEIGHT;?>
+        </td>
+        <td>
+            <input type = "text" name = "product_weight" value = "" /> <?php print sprintUnitWeight();?>
+        </td>
+    </tr>
+    <tr>
+    <td class="key">
+    <?php echo _JSHOP_QUANTITY_PRODUCT;?>
+    </td>
+        <td>
+            <div id="block_enter_prod_qty" style="padding-bottom:2px;<?php if ($row->unlimited) print "display:none;";?>">
+                <input type = "text" name = "product_quantity" id = "product_quantity" value = "" />
+            </div>
+            <div>         
+                <input type="checkbox" name="unlimited" value="1" onclick="ShowHideEnterProdQty(this.checked)" /> <?php print _JSHOP_UNLIMITED;?>
+            </div>         
+        </td>
+    </tr>
+    <?php if ($jshopConfig->use_different_templates_cat_prod) { ?>
+    <tr>
+        <td class="key">
+            <?php echo _JSHOP_TEMPLATE_PRODUCT;?>
+        </td>
+        <td>
+            <?php echo $lists['templates'];?>
+        </td>
+    </tr>
+    <?php } ?>
  
+    <?php if (!$this->withouttax){?>
+    <tr>     
+        <td class="key">
+            <?php echo _JSHOP_NAME_TAX;?>*
+        </td>
+        <td>
+            <?php echo $lists['tax'];?>
+        </td>
+    </tr>
+    <?php }?>
  <tr>
    <td class="key">
-     <?php echo _JSHOP_PRODUCT_WEIGHT;?>
-   </td>
-   <td>
-     <input type = "text" name = "product_weight" value = "" /> <?php print sprintUnitWeight();?>
-   </td>
- </tr>
- <tr>
-   <td class="key">
-     <?php echo _JSHOP_QUANTITY_PRODUCT;?>
-   </td>
-   <td>
-     <div id="block_enter_prod_qty" style="padding-bottom:2px;<?php if ($row->unlimited) print "display:none;";?>">
-         <input type = "text" name = "product_quantity" id = "product_quantity" value = "" />
-     </div>
-     <div>         
-        <input type="checkbox" name="unlimited" value="1" onclick="ShowHideEnterProdQty(this.checked)" /> <?php print _JSHOP_UNLIMITED;?>
-     </div>         
-   </td>
- </tr>
- <?php if ($jshopConfig->use_different_templates_cat_prod) { ?>
- <tr>
-   <td class="key">
-     <?php echo _JSHOP_TEMPLATE_PRODUCT;?>
-   </td>
-   <td>
-     <?php echo $lists['templates'];?>
-   </td>
- </tr>
- <?php } ?>
- 
- <?php if (!$this->withouttax){?>
- <tr>     
-   <td class="key">
-     <?php echo _JSHOP_NAME_TAX;?>*
-   </td>
-   <td>
-     <?php echo $lists['tax'];?>
-   </td>
- </tr>
- <?php }?>
- <tr>
-   <td class="key">
      <?php echo _JSHOP_NAME_MANUFACTURER;?>
    </td>
    <td>
@@ -164,4 +175,13 @@
 <?php foreach($this->cid as $cid){?>
 <input type="hidden" name="cid[]" value="<?php print $cid?>">
 <?php }?>
-</form>
\ No newline at end of file
+</form>
+<script type="text/javascript">
+function shfoldprice(checked){
+    if (checked){
+        jQuery("#foldprice").hide();
+    }else{
+        jQuery("#foldprice").show();
+    }
+}
+</script>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/admin/views/product_edit/tmpl/attribute.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/product_edit/tmpl/attribute.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/product_edit/tmpl/attribute.php	(revision 20)
@@ -6,6 +6,7 @@
         var folder_image_attrib = "<?php print $jshopConfig->image_attributes_live_path?>";
         var use_basic_price = "<?php print $jshopConfig->admin_show_product_basic_price?>";
         var use_bay_price = "<?php print $jshopConfig->admin_show_product_bay_price?>";
+        var use_stock = "<?php print intval($jshopConfig->stock)?>";
         var attrib_images = new Object();
         <?php foreach($lists['attribs_values'] as $k=>$v){?>
         attrib_images[<?php print $v->value_id?>] = "<?php print $v->image?>";
@@ -45,8 +46,10 @@
        <?php foreach($lists['all_attributes'] as $key=>$value){ ?>
             <th width="120"><?php echo $value->name?></th>
        <?php } ?>
-            <th width="120"><?php print _JSHOP_PRICE; ?></th>            
+            <th width="120"><?php print _JSHOP_PRICE; ?></th>
+            <?php if ($jshopConfig->stock){?>
             <th width="120"><?php print _JSHOP_QUANTITY_PRODUCT ?></th>
+            <?php }?>
             <th width="120"><?php print _JSHOP_EAN_PRODUCT ?></th>
             <th width="120"><?php print _JSHOP_PRODUCT_WEIGHT?> (<?php print sprintUnitWeight()?>)</th>
             <?php if ($jshopConfig->admin_show_product_basic_price){?>
@@ -77,7 +80,9 @@
                     print "<td><input type='hidden' name='attrib_id[".$value->attr_id."][]' value='".$tmp_val."'>".$image_.$tmp_val_val."</td>";
                }
                print "<td><input type='text' name='attrib_price[]' value='".$v->price."'></td>";
+               if ($jshopConfig->stock){
                print "<td><input type='text' name='attr_count[]' value='".$v->count."'></td>";
+               }
                print "<td><input type='text' name='attr_ean[]' value='".$v->ean."'></td>";
                print "<td><input type='text' name='attr_weight[]' value='".$v->weight."'></td>";
                if ($jshopConfig->admin_show_product_basic_price){
@@ -100,7 +105,10 @@
        foreach($lists['all_attributes'] as $key=>$value){
            print "<td></td>";
        }
-       print "<td></td><td></td><td></td><td></td>";
+       if ($jshopConfig->stock){
+       print "<td></td>";
+       }
+       print "<td></td><td></td><td></td>";
        if ($jshopConfig->admin_show_product_basic_price) print "<td></td>";
        print "<td></td>";
        if ($jshopConfig->admin_show_product_bay_price) print "<td></td>";              
@@ -124,10 +132,12 @@
                 <td class="key"><?php print _JSHOP_PRICE;?>*</td>
                 <td><input type="text" id="attr_price" value="<?php echo $row->product_price?>" style="width:100px;"></td>
             </tr>
+            <?php if ($jshopConfig->stock){?>
             <tr>
                 <td class="key"><?php print _JSHOP_QUANTITY_PRODUCT?>*</td>
                 <td><input type="text" id="attr_count"  style="width:100px;" value="1"></td> 
             </tr>
+            <?php }?>
             <tr>
                 <td class="key"><?php print _JSHOP_EAN_PRODUCT?></td>
                 <td><input type="text" id="attr_ean" style="width:100px;" value="<?php echo $row->product_ean?>"></td>
Index: Z:/home/jshop/INSTALL/pack/admin/views/comments/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/comments/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/comments/tmpl/list.php	(revision 20)
@@ -5,64 +5,64 @@
 ?>
 <form action = "index.php?option=com_jshopping&controller=reviews" method = "post" name = "adminForm">
     <table width = "100%">
-      <tr>
-        <td width = "95%" align = "right">
-            <?php echo $this->categories;?>
-        </td>
-        <td>
-           <?php echo $this->products_select;?>  
-        </td>
-        <td>
-            <input type = "text" name = "text_search" value = "<?php echo $this->text_search;?>" />
-        </td>
-        <td>
-            <input type = "submit" class = "button" value = "<?php echo _JSHOP_SEARCH;?>" />
-        </td>
-      </tr>
+        <tr>
+            <td width = "95%" align = "right">
+                <?php echo $this->categories;?>
+            </td>
+            <td>
+                <?php echo $this->products_select;?>  
+            </td>
+            <td>
+                <input type = "text" name = "text_search" value = "<?php echo $this->text_search;?>" />
+            </td>
+            <td>
+                <input type = "submit" class = "button" value = "<?php echo _JSHOP_SEARCH;?>" />
+            </td>
+        </tr>
     </table>
 
     <table class = "adminlist" >
     <thead> 
-      <tr>
-        <th class = "title" width  = "10">
-          #
-        </th>
-        <th width = "20">
-          <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count;?>);" />
-        </th>
-        <th width = "200" align = "left">
-          <?php echo _JSHOP_NAME_PRODUCT; ?>
-        </th>
-        <th>
-          <?php echo _JSHOP_USER; ?>   
-        </th>        
-        <th>
-          <?php echo _JSHOP_EMAIL; ?> 
-        </th>
-        <th align = "left">
-          <?php echo _JSHOP_PRODUCT_REVIEW; ?>
-        </th>
-        <th>
-          <?php echo _JSHOP_REVIEW_MARK; ?>
-        </th> 
-        <th>
-          <?php echo _JSHOP_DATE; ?>  
-        </th>
-        <th>
-          IP
-        </th>
-        <th width="50">
-            <?php echo _JSHOP_PUBLISH;?>       
-        </th>
-        <th width="50">
-            <?php echo _JSHOP_EDIT; ?>
-        </th>
-        <th width="50">
-            <?php echo _JSHOP_DELETE; ?>
-        </th>
-        <th width = "40">
-            <?php echo _JSHOP_ID; ?>
-        </th>
+        <tr>
+            <th class = "title" width  = "10">
+                #
+            </th>
+            <th width = "20">
+                <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count;?>);" />
+            </th>
+            <th width = "200" align = "left">
+                <?php echo JHTML::_('grid.sort', _JSHOP_NAME_PRODUCT, 'name', $this->filter_order_Dir, $this->filter_order); ?>
+            </th>
+            <th>
+                <?php echo JHTML::_('grid.sort', _JSHOP_USER, 'pr_rew.user_name', $this->filter_order_Dir, $this->filter_order); ?>
+            </th>        
+            <th>
+                <?php echo JHTML::_('grid.sort', _JSHOP_EMAIL, 'pr_rew.user_email', $this->filter_order_Dir, $this->filter_order); ?>
+            </th>
+            <th align = "left">
+                <?php echo JHTML::_('grid.sort', _JSHOP_PRODUCT_REVIEW, 'pr_rew.review', $this->filter_order_Dir, $this->filter_order); ?>
+            </th>
+            <th>
+                <?php echo JHTML::_('grid.sort', _JSHOP_REVIEW_MARK, 'pr_rew.mark', $this->filter_order_Dir, $this->filter_order); ?>
+            </th> 
+            <th>
+                <?php echo JHTML::_('grid.sort', _JSHOP_DATE, 'pr_rew.time', $this->filter_order_Dir, $this->filter_order); ?> 
+            </th>
+            <th>
+                <?php echo JHTML::_('grid.sort', 'IP', 'pr_rew.ip', $this->filter_order_Dir, $this->filter_order); ?>
+            </th>
+            <th width="50">
+                <?php echo _JSHOP_PUBLISH;?>       
+            </th>
+            <th width="50">
+                <?php echo _JSHOP_EDIT; ?>
+            </th>
+            <th width="50">
+                <?php echo _JSHOP_DELETE; ?>
+            </th>
+            <th width = "40">
+                <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'pr_rew.review_id', $this->filter_order_Dir, $this->filter_order); ?>
+            </th>
       </tr>
     </thead> 
     <?php
@@ -120,7 +120,9 @@
      </tfoot>   
      </table>
           
-     <input type = "hidden" name = "task" value = "" />
-     <input type = "hidden" name = "hidemainmenu" value = "0" />
-     <input type = "hidden" name = "boxchecked" value = "0" />
+    <input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+    <input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
+    <input type = "hidden" name = "task" value = "" />
+    <input type = "hidden" name = "hidemainmenu" value = "0" />
+    <input type = "hidden" name = "boxchecked" value = "0" />
 </form>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/admin/views/deliverytimes/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/deliverytimes/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/deliverytimes/tmpl/list.php	(revision 20)
@@ -7,23 +7,21 @@
 
 <table class = "adminlist">
 <thead>
-  <tr>
-    <th class = "title" width  = "10">
-      #
-    </th>
-    <th width = "20">
-	  <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $rows );?>);" />
-    </th>
-    <th align = "left">
-      <?php echo _JSHOP_TITLE;?>
-    </th>    
-    <th width="50">
-    	<?php print _JSHOP_EDIT?>
-    </th>
-    <th width = "40">
-        <?php echo _JSHOP_ID;?>
-    </th>
-  </tr>
+    <tr>
+        <th class = "title" width  = "10">#</th>
+        <th width = "20">
+            <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $rows );?>);" />
+        </th>
+        <th align = "left">
+            <?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'name', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>    
+        <th width="50">
+            <?php print _JSHOP_EDIT?>
+        </th>
+        <th width = "40">
+            <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'id', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+    </tr>
 </thead>
 <?php
  $count = count($rows);
@@ -52,6 +50,8 @@
 ?>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/attributes/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/attributes/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/attributes/tmpl/list.php	(revision 20)
@@ -1,35 +1,38 @@
 <?php 
 displaySubmenuOptions();
 $rows = $this->rows; $count = count ($rows); $i = 0; 
+$saveOrder = $this->filter_order_Dir=="asc" && $this->filter_order=="attr_ordering";
 ?>
 <form action = "index.php?option=com_jshopping&controller=attributes" method = "post" name = "adminForm">
 <table class = "adminlist">
 <thead>
   <tr>
     <th class = "title" width  = "10">
-      #
+        #
     </th>
     <th width = "20">
-	  <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count;?>);" />
+        <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count;?>);" />
     </th>
     <th width = "200" align = "left">
-      <?php echo _JSHOP_TITLE; ?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'name', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th align = "left">
-      <?php echo _JSHOP_OPTIONS; ?>
+        <?php echo _JSHOP_OPTIONS; ?>
     </th>
     <th align = "left">
-      <?php echo _JSHOP_DEPENDENT; ?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_DEPENDENT, 'independent', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th colspan = "3" width = "40">
-      <?php echo _JSHOP_ORDERING?>
-      <a class="saveorder" href="javascript:saveorder(<?php echo ($count-1);?>, 'saveorder')"></a>
+        <?php echo JHTML::_('grid.sort', _JSHOP_ORDERING, 'attr_ordering', $this->filter_order_Dir, $this->filter_order); ?>
+        <?php if ($saveOrder){?>
+            <a class="saveorder" href="javascript:saveorder(<?php echo ($count-1);?>, 'saveorder')"></a>
+        <?php }?>
     </th>
     <th width = "50">
         <?php echo _JSHOP_EDIT; ?>
     </th>
     <th width = "40">
-        <?php echo _JSHOP_ID; ?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'attr_id', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
   </tr>
 </thead>
@@ -61,16 +64,16 @@
    </td>
    <td align = "right" width = "20">
    <?php
-        if ($i != 0) echo '<a href = "index.php?option=com_jshopping&controller=attributes&task=order&id=' . $row->attr_id . '&order=up&number=' . $row->attr_ordering . '"><img alt="' . _JSHOP_UP . '" src="components/com_jshopping/images/uparrow.png"/></a>';
+        if ($i != 0 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=attributes&task=order&id=' . $row->attr_id . '&order=up&number=' . $row->attr_ordering . '"><img alt="' . _JSHOP_UP . '" src="components/com_jshopping/images/uparrow.png"/></a>';
    ?>
    </td>
    <td align = "left" width = "20">
    <?php
-        if ($i!=$count-1) echo '<a href = "index.php?option=com_jshopping&controller=attributes&task=order&id=' . $row->attr_id . '&order=down&number=' . $row->attr_ordering . '"><img alt="' . _JSHOP_DOWN . '" src="components/com_jshopping/images/downarrow.png"/></a>';
+        if ($i!=$count-1 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=attributes&task=order&id=' . $row->attr_id . '&order=down&number=' . $row->attr_ordering . '"><img alt="' . _JSHOP_DOWN . '" src="components/com_jshopping/images/downarrow.png"/></a>';
    ?>
    </td>
    <td align = "center" width = "10">
-    <input type="text" name="order[]" id = "ord<?php echo $row->attr_id;?>" size="5" value="<?php echo $row->attr_ordering?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />
+    <input type="text" name="order[]" id = "ord<?php echo $row->attr_id;?>" size="5" value="<?php echo $row->attr_ordering?>" <?php if (!$saveOrder) echo 'disabled'?> class="text_area" style="text-align: center" />
    </td>
    <td align="center">
         <a href='index.php?option=com_jshopping&controller=attributes&task=edit&attr_id=<?php print $row->attr_id;?>'><img src='components/com_jshopping/images/icon-16-edit.png'></a>
@@ -85,6 +88,8 @@
 ?>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "<?php echo JRequest::getVar('task', 0)?>" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/freeattributes/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/freeattributes/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/freeattributes/tmpl/list.php	(revision 20)
@@ -1,6 +1,7 @@
 <?php 
 displaySubmenuOptions();
 $rows = $this->rows; $count = count ($rows); $i = 0; 
+$saveOrder = $this->filter_order_Dir=="asc" && $this->filter_order=="ordering";
 ?>
 <form action = "index.php?option=com_jshopping&controller=freeattributes" method = "post" name = "adminForm">
 <table class = "adminlist">
@@ -13,20 +14,22 @@
 	  <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count;?>);" />
     </th>
     <th align = "left">
-      <?php echo _JSHOP_TITLE; ?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'name', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th width = "80" align = "left">
-      <?php echo _JSHOP_REQUIRED; ?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_REQUIRED, 'required', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th colspan = "3" width = "40">
-      <?php echo _JSHOP_ORDERING?>
-      <a class="saveorder" href="javascript:saveorder(<?php echo ($count-1);?>, 'saveorder')"></a>
+        <?php echo JHTML::_('grid.sort', _JSHOP_ORDERING, 'ordering', $this->filter_order_Dir, $this->filter_order); ?>
+        <?php if ($saveOrder){?>
+            <a class="saveorder" href="javascript:saveorder(<?php echo ($count-1);?>, 'saveorder')"></a>
+        <?php }?>
     </th>
     <th width = "50">
         <?php echo _JSHOP_EDIT; ?>
     </th>
     <th width = "40">
-        <?php echo _JSHOP_ID; ?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'id', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
   </tr>
 </thead>
@@ -51,16 +54,16 @@
    </td>
    <td align = "right" width = "20">
     <?php
-      if ($i != 0) echo '<a href = "index.php?option=com_jshopping&controller=freeattributes&task=order&id='.$row->id.'&move=-1"><img width="12" height="12" border="0" alt="' . _JSHOP_UP . '" src="components/com_jshopping/images/uparrow.png"/></a>';
+      if ($i != 0 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=freeattributes&task=order&id='.$row->id.'&move=-1"><img width="12" height="12" border="0" alt="' . _JSHOP_UP . '" src="components/com_jshopping/images/uparrow.png"/></a>';
     ?>
    </td>
    <td align = "left" width = "20">
       <?php
-        if ($i!=$count-1) echo '<a href = "index.php?option=com_jshopping&controller=freeattributes&task=order&id='.$row->id.'&move=1"><img width="12" height="12" border="0" alt="' . _JSHOP_DOWN . '" src="components/com_jshopping/images/downarrow.png"/></a>';
+        if ($i != $count-1 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=freeattributes&task=order&id='.$row->id.'&move=1"><img width="12" height="12" border="0" alt="' . _JSHOP_DOWN . '" src="components/com_jshopping/images/downarrow.png"/></a>';
       ?>
    </td>
    <td align = "center" width = "10">
-    <input type="text" name="order[]" id = "ord<?php echo $row->id;?>" size="5" value="<?php echo $row->ordering?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />
+    <input type="text" name="order[]" id = "ord<?php echo $row->id;?>" size="5" value="<?php echo $row->ordering?>" <?php if (!$saveOrder) echo 'disabled'?> class="text_area" style="text-align: center" />
    </td>
    <td align="center">
         <a href='index.php?option=com_jshopping&controller=freeattributes&task=edit&id=<?php print $row->id;?>'><img src='components/com_jshopping/images/icon-16-edit.png'></a>
@@ -75,6 +78,8 @@
 ?>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/manufacturer/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/manufacturer/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/manufacturer/tmpl/list.php	(revision 20)
@@ -3,6 +3,7 @@
 $manufacturers = $this->rows;
 $count = count($manufacturers);
 $i = 0;
+$saveOrder=$this->filter_order_Dir=="asc" && $this->filter_order=="ordering";
 ?>
 <form action = "index.php?option=com_jshopping&controller=manufacturers" method = "post" name = "adminForm">
 <table class = "adminlist">
@@ -15,11 +16,13 @@
       <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count = count( $manufacturers );?>);" />
     </th>
     <th align = "left">
-      <?php echo _JSHOP_TITLE; ?>
+      <?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'name', $this->filter_order_Dir, $this->filter_order)?>
     </th>
     <th colspan = "3" width = "40">
-      <?php echo _JSHOP_ORDERING; ?>
+      <?php echo JHTML::_( 'grid.sort', _JSHOP_ORDERING, 'ordering', $this->filter_order_Dir, $this->filter_order);?>
+      <?php if ($saveOrder){?>
       <a class="saveorder" href="javascript:saveorder(<?php echo ($count-1);?>, 'saveorder')" title="Save Order"></a>
+      <?php }?>
     </th>
     <th width = "50">
       <?php echo _JSHOP_PUBLISH;?>
@@ -28,7 +31,7 @@
         <?php echo _JSHOP_EDIT;?>
     </th>
     <th width = "40">
-        <?php echo _JSHOP_ID;?>
+        <?php echo JHTML::_( 'grid.sort', _JSHOP_ID, 'manufacturer_id', $this->filter_order_Dir, $this->filter_order);?>
     </th>
   </tr>
 </thead>  
@@ -47,12 +50,12 @@
    </td>
    <td align = "right" width = "20">
     <?php
-        if ($i != 0) echo '<a href = "index.php?option=com_jshopping&controller=manufacturers&task=order&id='.$man->manufacturer_id.'&move=-1"><img alt="'._JSHOP_UP.'" src="components/com_jshopping/images/uparrow.png"/></a>';
+        if ($i!=0 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=manufacturers&task=order&id='.$man->manufacturer_id.'&move=-1"><img alt="'._JSHOP_UP.'" src="components/com_jshopping/images/uparrow.png"/></a>';
     ?>
    </td>
    <td align = "left" width = "20">
     <?php
-        if ($i != $count - 1) echo '<a href = "index.php?option=com_jshopping&controller=manufacturers&task=order&id='.$man->manufacturer_id.'&move=1"><img alt="'._JSHOP_DOWN.'" src="components/com_jshopping/images/downarrow.png"/></a>';
+        if ($i!=($count-1) && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=manufacturers&task=order&id='.$man->manufacturer_id.'&move=1"><img alt="'._JSHOP_DOWN.'" src="components/com_jshopping/images/downarrow.png"/></a>';
     ?>
    </td>
    <td align = "center" width = "10">
@@ -76,6 +79,8 @@
 ?>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/product_labels/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/product_labels/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/product_labels/tmpl/list.php	(revision 20)
@@ -7,26 +7,23 @@
 
 <table class = "adminlist">
 <thead>
-  <tr>
-    <th class = "title" width  = "10">
-      #
-    </th>
-    <th width = "20">
-	  <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $rows );?>);" />
-    </th>
-    <th align = "left">
-      <?php echo _JSHOP_TITLE;?>
-    </th>
-    <th align = "left">
-      <?php echo _JSHOP_IMAGE;?>
-    </th>    
-    <th width="50">
-    	<?php print _JSHOP_EDIT?>
-    </th>
-    <th width = "40">
-        <?php echo _JSHOP_ID;?>
-    </th>
-  </tr>
+    <tr>
+        <th class = "title" width  = "10">#</th>
+        <th width = "20">
+            <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $rows );?>);" />
+        </th>
+        <th align = "left">
+            <?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'name', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+        <th align = "left">
+            <?php echo _JSHOP_IMAGE;?>
+        </th>    
+        <th width="50">
+            <?php print _JSHOP_EDIT?>
+        </th>
+        <th width = "40">
+            <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'id', $this->filter_order_Dir, $this->filter_order); ?>
+    </tr>
 </thead>
 <?php
  $count = count($rows);
@@ -60,6 +57,8 @@
 ?>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/product_field_values/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/product_field_values/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/product_field_values/tmpl/list.php	(revision 20)
@@ -1,31 +1,34 @@
-<?php 
+<?php
 displaySubmenuOptions("productfields");
 $rows = $this->rows; $count = count ($rows); $i = 0; 
+$saveOrder = $this->filter_order_Dir=="asc" && $this->filter_order=="ordering";
 ?>
 <form action = "index.php?option=com_jshopping&controller=productfieldvalues&field_id=<?php print $this->field_id?>" method = "post" name = "adminForm">
 <table class = "adminlist">
 <thead>
-  <tr>
-    <th class = "title" width  = "10">
-      #
-    </th>
-    <th width = "20">
-	  <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count;?>);" />
-    </th>
-    <th align = "left">
-      <?php echo _JSHOP_TITLE; ?>
-    </th>
-    <th colspan = "3" width = "40">
-      <?php echo _JSHOP_ORDERING; ?>
-      <a href="javascript:saveorder(<?php echo ($count-1);?>, 'saveorder')" title="Save Order" class="saveorder"></a>
-    </th>
-    <th width = "50">
-        <?php echo _JSHOP_EDIT; ?>
-    </th>
-    <th width = "40">
-        <?php echo _JSHOP_ID; ?>
-    </th>
-  </tr>
+    <tr>
+        <th class = "title" width  = "10">
+            #
+        </th>
+        <th width = "20">
+            <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count;?>);" />
+        </th>
+        <th align = "left">
+            <?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'name', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+        <th colspan = "3" width = "40">
+            <?php echo JHTML::_('grid.sort', _JSHOP_ORDERING, 'ordering', $this->filter_order_Dir, $this->filter_order); ?>
+            <?php if ($saveOrder){?>
+                <a href="javascript:saveorder(<?php echo ($count-1);?>, 'saveorder')" title="Save Order" class="saveorder"></a>
+            <?php }?>
+        </th>
+        <th width = "50">
+            <?php echo _JSHOP_EDIT; ?>
+        </th>
+        <th width = "40">
+            <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'id', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+    </tr>
 </thead>
 <?php
  foreach ($rows as $row){
@@ -42,16 +45,16 @@
    </td>
    <td align = "right" width = "20">
     <?php
-        if ($i != 0) echo '<a href = "index.php?option=com_jshopping&controller=productfieldvalues&task=order&id='.$row->id.'&move=-1&field_id='.$this->field_id.'"><img alt="'._JSHOP_UP.'" src="components/com_jshopping/images/uparrow.png"/></a>';
+        if ($i != 0 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=productfieldvalues&task=order&id='.$row->id.'&move=-1&field_id='.$this->field_id.'"><img alt="'._JSHOP_UP.'" src="components/com_jshopping/images/uparrow.png"/></a>';
     ?>
    </td>
    <td align = "left" width = "20">
     <?php
-        if ($i != $count - 1) echo '<a href = "index.php?option=com_jshopping&controller=productfieldvalues&task=order&id='.$row->id.'&move=1&field_id='.$this->field_id.'"><img alt="'._JSHOP_DOWN.'" src="components/com_jshopping/images/downarrow.png"/></a>';
+        if ($i != $count - 1 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=productfieldvalues&task=order&id='.$row->id.'&move=1&field_id='.$this->field_id.'"><img alt="'._JSHOP_DOWN.'" src="components/com_jshopping/images/downarrow.png"/></a>';
     ?>
    </td>
    <td align = "center" width = "10">
-    <input type="text" name="order[]" id = "ord<?php echo $row->id;?>"  size="5" value="<?php echo $row->ordering; ?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />    
+    <input type="text" name="order[]" id = "ord<?php echo $row->id;?>"  size="5" value="<?php echo $row->ordering; ?>" <?php if (!$saveOrder) echo 'disabled'?> class="text_area" style="text-align: center" />    
    </td>
    <td align="center">
         <a href='index.php?option=com_jshopping&controller=productfieldvalues&task=edit&field_id=<?php print $this->field_id?>&id=<?php print $row->id;?>'><img src='components/com_jshopping/images/icon-16-edit.png'></a>
@@ -66,6 +69,8 @@
 ?>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/shippings/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/shippings/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/shippings/tmpl/list.php	(revision 20)
@@ -2,36 +2,39 @@
 displaySubmenuOptions();
 $shippings = $this->rows;
 $i = 0;
+$saveOrder = $this->filter_order_Dir=="asc" && $this->filter_order=="ordering";
 ?>
 <form action = "index.php?option=com_jshopping&controller=shippings" method = "post" name = "adminForm">
 
 <table class = "adminlist">
 <thead>
-  <tr>
-    <th class = "title" width  = "10">#</th>
-    <th width = "20">
-      <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />
-    </th>
-    <th align = "left">
-      <?php echo _JSHOP_TITLE; ?>
-    </th>
-    <th width="200">
-        <?php echo _JSHOP_SHIPPING_PRICES; ?>    
-    </th>
-    <th width = "100">
-      <?php echo _JSHOP_ORDERING; ?>
-      <?php echo JHtml::_('grid.order',  $shippings, 'filesave.png', 'saveorder');?>
-    </th>
-    <th width = "30">
-      <?php echo _JSHOP_PUBLISH; ?>
-    </th>
-    <th width = "50">
-        <?php echo _JSHOP_EDIT; ?>
-    </th>
-    <th width = "40">
-        <?php echo _JSHOP_ID; ?>
-    </th>
-  </tr>
+    <tr>
+        <th class = "title" width  = "10">#</th>
+        <th width = "20">
+            <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />
+        </th>
+        <th align = "left">
+            <?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'name', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+        <th width="200">
+            <?php echo _JSHOP_SHIPPING_PRICES; ?>    
+        </th>
+        <th width = "80">
+            <?php echo JHTML::_('grid.sort', _JSHOP_ORDERING, 'ordering', $this->filter_order_Dir, $this->filter_order); ?>
+            <?php if ($saveOrder){?>
+                <?php echo JHtml::_('grid.order',  $shippings, 'filesave.png', 'saveorder');?>
+            <?php }?>
+        </th>
+        <th width = "30">
+            <?php echo _JSHOP_PUBLISH; ?>
+        </th>
+        <th width = "50">
+            <?php echo _JSHOP_EDIT; ?>
+        </th>
+        <th width = "40">
+            <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'shipping_id', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+    </tr>
 </thead>  
 <?php
 $count = count($shippings);
@@ -56,9 +59,9 @@
     <a href = "index.php?option=com_jshopping&controller=shippingsprices&shipping_id_back=<?php print $shipping->shipping_id;?>"><?php echo _JSHOP_SHIPPING_PRICES." (".$shipping->count_shipping_price.")"?> <img src = "components/com_jshopping/images/tree.gif" border = "0" /></a>
    </td>
    <td class="order">
-    <span><?php if ($i != 0) echo JHtml::_('jgrid.orderUp', $i, "orderup");?></span>
-    <span><?php if ($i != $count - 1) echo JHtml::_('jgrid.orderDown', $i, "orderdown");?></span>
-    <input type="text" name="order[]" size="5" value="<?php echo $shipping->ordering;?>" class="text-area-order" />
+    <span><?php if ($i != 0 && $saveOrder) echo JHtml::_('jgrid.orderUp', $i, "orderup");?></span>
+    <span><?php if ($i != $count - 1 && $saveOrder) echo JHtml::_('jgrid.orderDown', $i, "orderdown");?></span>
+    <input type="text" name="order[]" size="5" value="<?php echo $shipping->ordering;?>" <?php if (!$saveOrder) echo 'disabled'?> class="text-area-order" />
    </td>
    <td align = "center">
     <?php echo JHtml::_('jgrid.published', $shipping->published, $i);?>
@@ -73,6 +76,8 @@
 <?php } ?>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/addons/view.html.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/addons/view.html.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/addons/view.html.php	(revision 20)
@@ -13,6 +13,8 @@
         JToolBarHelper::title(_JSHOP_ADDONS, 'generic.png' );
         JToolBarHelper::save();
         JToolBarHelper::spacer();
+        JToolBarHelper::apply();
+        JToolBarHelper::spacer();
         JToolBarHelper::cancel();        
         parent::display($tpl);
     }
Index: Z:/home/jshop/INSTALL/pack/admin/views/addons/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/addons/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/addons/tmpl/list.php	(revision 20)
@@ -57,7 +57,7 @@
     <?php }?>
    </td>
    <td align="center">
-    <a href='index.php?option=com_jshopping&controller=addons&task=remove&id=<?php print $row->id?>' onclick="return confirm('<?php print _JSHOP_DELETE?>')"><img src='components/com_jshopping/images/publish_r.png'></a>
+    <a href='index.php?option=com_jshopping&controller=addons&task=remove&id=<?php print $row->id?>' onclick="return confirm('<?php print _JSHOP_DELETE_ALL_DATA?>')"><img src='components/com_jshopping/images/publish_r.png'></a>
    </td>
    <td align="center">
     <?php print $row->id;?>
Index: Z:/home/jshop/INSTALL/pack/admin/views/shippingsprices/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/shippingsprices/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/shippingsprices/tmpl/list.php	(revision 20)
@@ -15,19 +15,19 @@
 	  		<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $shipping_prices );?>);" />
     	</th>
     	<th align = "left">
-      		<?php echo _JSHOP_TITLE; ?>
+      		<?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'name', $this->filter_order_Dir, $this->filter_order); ?>
     	</th>
         <th>
             <?php echo _JSHOP_COUNTRIES; ?>
         </th>
         <th width="100">
-            <?php echo _JSHOP_PRICE; ?>
+            <?php echo JHTML::_('grid.sort', _JSHOP_PRICE, 'shipping_price.shipping_stand_price', $this->filter_order_Dir, $this->filter_order); ?>
         </th>
     	<th width = "70">
 	        <?php echo _JSHOP_EDIT; ?>
 	    </th>
         <th width = "40">
-            <?php echo _JSHOP_ID; ?>
+            <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'shipping_price.sh_pr_method_id', $this->filter_order_Dir, $this->filter_order); ?>
         </th>
   	</tr>
 </thead>
@@ -61,6 +61,8 @@
 	<?php } ?>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "" />
 <input type = "hidden" name = "shipping_id_back" value = "<?php echo $this->shipping_id_back;?>" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/shippingsprices/tmpl/edit.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/shippingsprices/tmpl/edit.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/shippingsprices/tmpl/edit.php	(revision 20)
@@ -35,25 +35,46 @@
 </td>
 </tr>
 <?php }?>
+<tr>
+<td class="key">
+    <?php echo _JSHOP_PRICE?>*
+</td>
+<td>
+    <input type = "text" class = "inputbox" name = "shipping_stand_price" value = "<?php echo $row->shipping_stand_price?>" />
+    <?php echo $this->currency->currency_code; ?>
+</td>
+</tr>
 <?php if ($this->config->tax){?>
 <tr>
  <td class="key">
-	<?php echo _JSHOP_SELECT_TAX?>*
+	<?php echo _JSHOP_TAX?>*
  </td>
  <td>
  	<?php echo $lists['taxes']?>
  </td>
 </tr>
 <?php }?>
+
 <tr>
 <td class="key">
-	<?php echo _JSHOP_PRICE?>*
+    <?php echo _JSHOP_PACKAGE_PRICE?>*
 </td>
 <td>
-	<input type = "text" class = "inputbox" name = "shipping_stand_price" value = "<?php echo $row->shipping_stand_price?>" />
+    <input type = "text" class = "inputbox" name = "package_stand_price" value = "<?php echo $row->package_stand_price?>" />
     <?php echo $this->currency->currency_code; ?>
 </td>
 </tr>
+<?php if ($this->config->tax){?>
+<tr>
+ <td class="key">
+    <?php echo _JSHOP_PACKAGE_TAX?>*
+ </td>
+ <td>
+     <?php echo $lists['package_taxes']?>
+ </td>
+</tr>
+<?php }?>
+
 <?php foreach($this->extensions as $extension){
     $extension->exec->showShippingPriceForm($row->getParams(), $extension, $this);
 }
Index: Z:/home/jshop/INSTALL/pack/admin/views/countries/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/countries/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/countries/tmpl/list.php	(revision 20)
@@ -3,6 +3,7 @@
 $countries = $this->rows;
 $pageNav = $this->pageNav;
 $i = 0;
+$saveOrder = $this->filter_order_Dir=="asc" && $this->filter_order=="ordering";
 ?>
 <form action = "index.php?option=com_jshopping&controller=countries" method = "post" name = "adminForm">
 
@@ -18,32 +19,34 @@
 <thead>
   <tr>
     <th class = "title" width  = "10">
-      #
+        #
     </th>
     <th width = "20">
-	  <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $countries );?>);" />
+        <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $countries );?>);" />
     </th>
     <th align = "left">
-      <?php echo _JSHOP_COUNTRY; ?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_COUNTRY, 'name', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
 	<th width = "90">
-      <?php echo _JSHOP_CODE; ?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_CODE, 'country_code', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th width = "90">
-      <?php echo _JSHOP_CODE; ?> 2
+        <?php echo JHTML::_('grid.sort', _JSHOP_CODE . '2', 'country_code_2', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th colspan = "3" width = "40">
-      <?php echo _JSHOP_ORDERING; ?>
-      <a class="saveorder" href="javascript:saveorder(<?php echo count( $countries ) - 1;?>,'saveorder')" title="Save Order"></a>
+        <?php echo JHTML::_('grid.sort', _JSHOP_ORDERING, 'ordering', $this->filter_order_Dir, $this->filter_order); ?>
+        <?php if ($saveOrder){?>
+            <a class="saveorder" href="javascript:saveorder(<?php echo count( $countries ) - 1;?>,'saveorder')" title="Save Order"></a>
+        <?php }?>
     </th>
     <th width = "50">
-      <?php echo _JSHOP_PUBLISH; ?>
+        <?php echo _JSHOP_PUBLISH; ?>
     </th>
     <th width="50">
     	<?php print _JSHOP_EDIT; ?>
     </th>
 	<th width = "50">
-      <?php print _JSHOP_ID;?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'country_id', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
   </tr>
 </thead>
@@ -53,43 +56,43 @@
   ?>
   <tr class = "row<?php echo $i % 2;?>">
    <td>
-     <?php echo $pageNav->getRowOffset($i);?>
+        <?php echo $pageNav->getRowOffset($i);?>
    </td>
    <td>
-     <input type = "checkbox" onclick = "isChecked(this.checked)" name = "cid[]" id = "cb<?php echo $i;?>" value = "<?php echo $country->country_id?>" />
+        <input type = "checkbox" onclick = "isChecked(this.checked)" name = "cid[]" id = "cb<?php echo $i;?>" value = "<?php echo $country->country_id?>" />
    </td>
    <td>
-     <a href = "index.php?option=com_jshopping&controller=countries&task=edit&country_id=<?php echo $country->country_id; ?>"><?php echo $country->name;?></a>
+        <a href = "index.php?option=com_jshopping&controller=countries&task=edit&country_id=<?php echo $country->country_id; ?>"><?php echo $country->name;?></a>
    </td>
    <td align="center">
-     <?php echo $country->country_code;?>
+        <?php echo $country->country_code;?>
    </td>
    <td align="center">
-     <?php echo $country->country_code_2;?>
+        <?php echo $country->country_code_2;?>
    </td>
    <td align = "right" width = "20">
-    <?php
-      if ($i != 0) echo '<a href = "index.php?option=com_jshopping&controller=countries&task=order&id=' . $country->country_id . '&order=up&number=' . $country->ordering . '"><img alt="' . _JSHOP_UP . '" src="components/com_jshopping/images/uparrow.png"/></a>';
-    ?>
+        <?php
+            if ($i != 0 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=countries&task=order&id=' . $country->country_id . '&order=up&number=' . $country->ordering . '"><img alt="' . _JSHOP_UP . '" src="components/com_jshopping/images/uparrow.png"/></a>';
+        ?>
    </td>
    <td align = "left" width = "20">
-      <?php
-        if ($i != $count - 1) echo '<a href = "index.php?option=com_jshopping&controller=countries&task=order&id=' . $country->country_id . '&order=down&number=' . $country->ordering . '"><img alt="' . _JSHOP_DOWN . '" src="components/com_jshopping/images/downarrow.png"/></a>';
-      ?>
+        <?php
+            if ($i != $count - 1 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=countries&task=order&id=' . $country->country_id . '&order=down&number=' . $country->ordering . '"><img alt="' . _JSHOP_DOWN . '" src="components/com_jshopping/images/downarrow.png"/></a>';
+        ?>
    </td>
-   <td align = "center" width = "10">
-    <input type="text" name="order[]" id = "ord<?php echo $country->country_id;?>"  size="5" value="<?php echo $country->ordering; ?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />    
-   </td>
-   <td align="center">
-     <?php
-       echo $published = ($country->country_publish) ? ('<a href = "javascript:void(0)" onclick = "return listItemTask(\'cb' . $i . '\', \'unpublish\')"><img src="components/com_jshopping/images/tick.png" title = "'._JSHOP_PUBLISH.'" ></a>') : ('<a href = "javascript:void(0)" onclick = "return listItemTask(\'cb' . $i . '\', \'publish\')"><img title = "'._JSHOP_UNPUBLISH.'" src="components/com_jshopping/images/publish_x.png"></a>');
-     ?>
-   </td>
+    <td align = "center" width = "10">
+        <input type="text" name="order[]" id = "ord<?php echo $country->country_id;?>"  size="5" value="<?php echo $country->ordering; ?>" <?php if (!$saveOrder) echo 'disabled'?> class="text_area" style="text-align: center" />    
+    </td>
+    <td align="center">
+        <?php
+            echo $published = ($country->country_publish) ? ('<a href = "javascript:void(0)" onclick = "return listItemTask(\'cb' . $i . '\', \'unpublish\')"><img src="components/com_jshopping/images/tick.png" title = "'._JSHOP_PUBLISH.'" ></a>') : ('<a href = "javascript:void(0)" onclick = "return listItemTask(\'cb' . $i . '\', \'publish\')"><img title = "'._JSHOP_UNPUBLISH.'" src="components/com_jshopping/images/publish_x.png"></a>');
+        ?>
+    </td>
 	<td align="center">
-		<a href='index.php?option=com_jshopping&controller=countries&task=edit&country_id=<?php print $country->country_id;?>'><img src='components/com_jshopping/images/icon-16-edit.png'></a>
+        <a href='index.php?option=com_jshopping&controller=countries&task=edit&country_id=<?php print $country->country_id;?>'><img src='components/com_jshopping/images/icon-16-edit.png'></a>
 	</td>
 	<td align="center">
-     <?php echo $country->country_id;?>
+        <?php echo $country->country_id;?>
    </td>
   </tr>
 <?php
@@ -98,11 +101,13 @@
 ?>
 <tfoot>
 <tr>
-	<td colspan="11"><?php echo $pageNav->getListFooter();?></td>
+    <td colspan="11"><?php echo $pageNav->getListFooter();?></td>
 </tr>
 </tfoot>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/category/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/category/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/category/tmpl/list.php	(revision 20)
@@ -1,48 +1,35 @@
-<?php $categories = $this->categories; $lists = $this->lists; $i = 0; $count = count( $categories );?>
+<?php 
+    $categories = $this->categories; 
+    $i = 0; 
+    $count = count( $categories ); 
+    $pageNav = $this->pagination;
+    $saveOrder = $this->filter_order_Dir=="asc" && $this->filter_order=="ordering";
+?>
 <form action = "index.php?option=com_jshopping&controller=categories" method = "post" enctype = "multipart/form-data" name = "adminForm">
-
-<table width = "100%" style="margin-bottom:5px;">
-  <tr>
-    <td>
-        <?php 
-        if (count($this->tree)){
-            print "<a href='index.php?option=com_jshopping&controller=categories&catid=0'>"._JSHOP_TOP_LEVEL."</a>";
-            foreach($this->tree as $_row){
-                print " \\ <a href='index.php?option=com_jshopping&controller=categories&catid=".$_row->category_id."'>".$_row->name."</a>";                
-            }
-        }
-        ?>
-    </td>
-    <td align = "right">
-      <?php echo $lists['treecategories'];?>
-    </td>
-  </tr>
-</table>
 <table class = "adminlist">
 <thead>
-  <tr>
-    <th class = "title" width  = "10">#</th>
+    <tr>
+        <th class = "title" width  = "10">#</th>
     <th width = "20">
-      <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count;?>);" />
+        <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count;?>);" />
     </th>
     <th width = "200" align = "left">
-      <?php echo _JSHOP_TITLE;?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'name', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th align = "left">
-      <?php echo _JSHOP_DESCRIPTION;?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_DESCRIPTION, 'description', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th width = "80" align = "left">
-      <?php echo _JSHOP_SUBCATEGORYS;?>
-    </th>
-    <th width = "80" align = "left">
-      <?php echo _JSHOP_CATEGORY_PRODUCTS;?>
+        <?php echo _JSHOP_CATEGORY_PRODUCTS;?>
     </th>    
     <th colspan = "3" width = "40">
-      <?php echo _JSHOP_ORDERING?>
-      <a class="saveorder" href="javascript:saveorder(<?php echo ($count-1);?>, 'saveorder')" title="Save Order"></a>
+        <?php echo JHTML::_( 'grid.sort', _JSHOP_ORDERING, 'ordering', $this->filter_order_Dir, $this->filter_order); ?>
+        <?php if ($saveOrder){?>
+            <a class="saveorder" href="javascript:saveorder(<?php echo ($count-1);?>, 'saveorder')" title="Save Order"></a>
+        <?php }?>
     </th>
     <th width = "50">
-      <?php echo _JSHOP_PUBLISH;?>
+        <?php echo _JSHOP_PUBLISH;?>
     </th>
     <th width="50">
         <?php echo _JSHOP_EDIT;?>
@@ -51,68 +38,61 @@
         <?php echo _JSHOP_DELETE;?>
     </th>
     <th width="50">
-        <?php print _JSHOP_ID;?>
+        <?php echo JHTML::_( 'grid.sort', _JSHOP_ID, 'id', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
-  </tr>
-  </thead>  
-<?php
- foreach($categories as $category){
-  ?>
-  <tr class = "row<?php echo $i % 2;?>">
-   <td>
-     <?php echo $i+1;?>
-   </td>
-   <td>
-     <input type = "checkbox" onclick = "isChecked(this.checked)" name = "cid[]" id = "cb<?php echo $i;?>" value = "<?php echo $category->category_id?>" />
-   </td>
-   <td>
-     <a href = "index.php?option=com_jshopping&controller=categories&task=edit&category_id=<?php echo $category->category_id; ?>"><?php echo $category->name;?></a>     
-   </td>
-   <td>
-     <?php echo $category->short_description;?>
-   </td>
-   <td align="center">    
-     <a href = "index.php?option=com_jshopping&controller=categories&catid=<?php echo $category->category_id?>">
-       (<?php print intval($this->countsubcat[$category->category_id]);?>) <img src = "components/com_jshopping/images/tree.gif" border = "0" />
-     </a>    
-   </td>
-   <td align="center">
-     <a href = "index.php?option=com_jshopping&controller=products&category_id=<?php echo $category->category_id?>">
-       (<?php print intval($this->countproducts[$category->category_id]);?>)  <img src = "components/com_jshopping/images/tree.gif" border = "0" />
-     </a>
-   </td>
-   <td align = "right" width = "20">
-    <?php
-      if ($i != 0) echo '<a href = "index.php?option=com_jshopping&controller=categories&task=order&id='.$category->category_id.'&move=-1"><img alt="' . _JSHOP_UP . '" src="components/com_jshopping/images/uparrow.png"/></a>';
-    ?>
-   </td>
-   <td align = "left" width = "20"> 
-      <?php
-        if ($i != $count - 1) echo '<a href = "index.php?option=com_jshopping&controller=categories&task=order&id='.$category->category_id.'&move=1"><img alt="' . _JSHOP_DOWN . '" src="components/com_jshopping/images/downarrow.png"/></a>';
-      ?>
-   </td>
-   <td align = "center" width = "10">
-    <input type="text" name="order[]" id = "ord<?php echo $category->category_id;?>"  size="5" value="<?php echo $category->ordering; ?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />
-   </td>
-   <td align="center">
-     <?php
-       echo $published = ($category->category_publish) ? ('<a href = "javascript:void(0)" onclick = "return listItemTask(\'cb' . $i . '\', \'unpublish\')"><img title = "' . _JSHOP_PUBLISH . '" alt="" src="components/com_jshopping/images/tick.png"></a>') : ('<a href = "javascript:void(0)" onclick = "return listItemTask(\'cb' . $i . '\', \'publish\')"><img title = "' . _JSHOP_UNPUBLISH . '" alt="" src="components/com_jshopping/images/publish_x.png"></a>');
-     ?>
-   </td>
-   <td align="center">
+    </tr>
+    </thead>  
+<?php foreach($categories as $category) { ?>
+    <tr class = "row<?php echo $i % 2;?>">
+    <td>
+        <?php echo $pageNav->getRowOffset($i);?>
+    </td>
+    <td>
+        <input type = "checkbox" onclick = "isChecked(this.checked)" name = "cid[]" id = "cb<?php echo $i;?>" value = "<?php echo $category->category_id?>" />
+    </td>
+    <td>
+        <?php print $category->space; ?><a href = "index.php?option=com_jshopping&controller=categories&task=edit&category_id=<?php echo $category->category_id; ?>"><?php echo $category->name;?></a>     
+    </td>
+    <td>
+        <?php echo $category->short_description;?>
+    </td>
+    <td align="center">
+        <a href = "index.php?option=com_jshopping&controller=products&category_id=<?php echo $category->category_id?>">
+        (<?php print intval($this->countproducts[$category->category_id]);?>)  <img src = "components/com_jshopping/images/tree.gif" border = "0" />
+        </a>
+    </td>
+    <td align = "right" width = "20">
+        <?php if ($saveOrder && $category->isPrev) echo '<a href = "index.php?option=com_jshopping&controller=categories&task=order&id='.$category->category_id.'&move=-1"><img alt="' . _JSHOP_UP . '" src="components/com_jshopping/images/uparrow.png"/></a>'; ?>
+    </td>
+    <td align = "left" width = "20"> 
+        <?php if ($saveOrder && $category->isNext) echo '<a href = "index.php?option=com_jshopping&controller=categories&task=order&id='.$category->category_id.'&move=1"><img alt="' . _JSHOP_DOWN . '" src="components/com_jshopping/images/downarrow.png"/></a>'; ?>
+    </td>
+    <td align = "center" width = "10">
+        <input type="text" name="order[]" id = "ord<?php echo $category->category_id;?>"  size="5" value="<?php echo $category->ordering; ?>" <?php if (!$saveOrder) echo 'disabled'?> class="text_area" style="text-align: center" />
+    </td>
+    <td align="center">
+        <?php echo $published = ($category->category_publish) ? ('<a href = "javascript:void(0)" onclick = "return listItemTask(\'cb' . $i . '\', \'unpublish\')"><img title = "' . _JSHOP_PUBLISH . '" alt="" src="components/com_jshopping/images/tick.png"></a>') : ('<a href = "javascript:void(0)" onclick = "return listItemTask(\'cb' . $i . '\', \'publish\')"><img title = "' . _JSHOP_UNPUBLISH . '" alt="" src="components/com_jshopping/images/publish_x.png"></a>'); ?>
+    </td>
+    <td align="center">
         <a href='index.php?option=com_jshopping&controller=categories&task=edit&category_id=<?php print $category->category_id?>'><img src='components/com_jshopping/images/icon-16-edit.png'></a>
-   </td>
-   <td align="center">
+    </td>
+    <td align="center">
         <a href='index.php?option=com_jshopping&controller=categories&task=remove&cid[]=<?php print $category->category_id?>' onclick="return confirm('<?php print _JSHOP_DELETE?>');"><img src='components/com_jshopping/images/publish_r.png'></a>
-   </td>
-   <td align="center">
-    <?php print $category->category_id?>
-   </td>
-  </tr>
+    </td>
+    <td align="center">
+        <?php print $category->category_id?>
+    </td>
+    </tr>
 <?php $i++; } ?>
+<tfoot>
+<tr>
+    <td colspan = "12"><?php echo $pageNav->getListFooter();?></td>
+</tr>
+</tfoot>
 </table>
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
-<input type = "hidden" name = "category_parent_id" value = "<?php print $this->category_parent_id;?>" />
 </form>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/admin/views/usergroups/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/usergroups/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/usergroups/tmpl/list.php	(revision 20)
@@ -14,13 +14,13 @@
 	  		<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $usergroups );?>);" />
     	</th>
     	<th width = "150" align = "left">
-      		<?php echo _JSHOP_TITLE; ?>
+      		<?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'usergroup_name', $this->filter_order_Dir, $this->filter_order); ?>
     	</th>
     	<th align = "left">
-      		<?php echo _JSHOP_DESCRIPTION; ?>
+      		<?php echo JHTML::_('grid.sort', _JSHOP_DESCRIPTION, 'usergroup_description', $this->filter_order_Dir, $this->filter_order); ?>
     	</th>
         <th width="80">
-            <?php print _JSHOP_USERGROUP_DISCOUNT;?>
+            <?php echo JHTML::_('grid.sort', _JSHOP_USERGROUP_DISCOUNT, 'usergroup_discount', $this->filter_order_Dir, $this->filter_order); ?>
         </th>
     	<th width = "100">
 			<?php echo _JSHOP_USERGROUP_IS_DEFAULT; ?>
@@ -29,7 +29,7 @@
 	        <?php echo _JSHOP_EDIT; ?>
 	    </th>
         <th width = "40">
-            <?php echo _JSHOP_ID; ?>
+            <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'usergroup_id', $this->filter_order_Dir, $this->filter_order); ?>
         </th>
   	</tr>
 </thead>
@@ -60,7 +60,9 @@
 	</tr>	
 <?php } ?>
 </table>
-
+    
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/taxes/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/taxes/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/taxes/tmpl/list.php	(revision 20)
@@ -6,26 +6,26 @@
 <form action = "index.php?option=com_jshopping&controller=taxes" method = "post" name = "adminForm">
 <table class = "adminlist">
 <thead>
-  <tr>
-    <th class = "title" width  = "10">
-      #
-    </th>
-    <th width = "20">
-      <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count = count( $taxes );?>);" />
-    </th>
-    <th align = "left">
-      <?php echo _JSHOP_TITLE; ?>
-    </th>
-    <th width = "150">
-        <?php echo _JSHOP_EXTENDED_RULE_TAX; ?>
-    </th>
-    <th width = "50">
-        <?php echo _JSHOP_EDIT; ?>
-    </th>
-    <th width = "40">
-        <?php echo _JSHOP_ID; ?>
-    </th>
-  </tr>
+    <tr>
+        <th class = "title" width  = "10">
+            #
+        </th>
+        <th width = "20">
+            <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count = count( $taxes );?>);" />
+        </th>
+        <th align = "left">
+            <?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'tax_name', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+        <th width = "150">
+            <?php echo _JSHOP_EXTENDED_RULE_TAX; ?>
+        </th>
+        <th width = "50">
+            <?php echo _JSHOP_EDIT; ?>
+        </th>
+        <th width = "40">
+            <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'tax_id', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+    </tr>
 </thead>  
 <?php
  foreach($taxes as $tax){
@@ -55,6 +55,8 @@
 ?>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "<?php echo JRequest::getVar('task')?>" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/coupons/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/coupons/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/coupons/tmpl/list.php	(revision 20)
@@ -16,34 +16,34 @@
       <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $coupons );?>);" />
     </th>
     <th align = "left">
-      <?php echo _JSHOP_CODE;?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_CODE, 'C.coupon_code', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th width = "200" align = "left">
-      <?php echo _JSHOP_VALUE; ?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_VALUE, 'C.coupon_value', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th width = "80">
-      <?php echo _JSHOP_START_DATE_COUPON;?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_START_DATE_COUPON, 'C.coupon_start_date', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th width = "80">
-      <?php echo _JSHOP_EXPIRE_DATE_COUPON;?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_EXPIRE_DATE_COUPON, 'C.coupon_expire_date', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th width = "80">
-      <?php echo _JSHOP_FINISHED_AFTER_USED;?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_FINISHED_AFTER_USED, 'C.finished_after_used', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th width = "80">
-      <?php echo _JSHOP_FOR_USER;?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_FOR_USER, 'C.for_user_id', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th width = "80">
-      <?php echo _JSHOP_COUPON_USED;?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_COUPON_USED, 'C.used', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th width = "50">
-      <?php echo _JSHOP_PUBLISH;?>
+        <?php echo _JSHOP_PUBLISH;?>
     </th>
     <th width = "50">
         <?php echo _JSHOP_EDIT;?>
     </th>
     <th width = "40">
-      <?php echo _JSHOP_ID;?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'C.coupon_id', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
   </tr>
 </thead>  
@@ -105,6 +105,8 @@
 </tfoot>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/orders/tmpl/show.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/orders/tmpl/show.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/orders/tmpl/show.php	(revision 20)
@@ -474,6 +474,7 @@
 <tr class = "bold">
  <td colspan = "4" class = "right">
     <?php echo _JSHOP_COUPON_DISCOUNT?>
+    <?php if ($order->coupon_id){?>(<?php print $order->coupon_code?>)<?php }?>
  </td>
  <td class = "left">
    <?php echo formatprice(-$order->order_discount, $order->currency_code);?><?php print $this->_tmp_ext_discount?>
@@ -491,6 +492,16 @@
  </td>
 </tr>
 <?php } ?>
+<?php if (!$this->config->without_shipping || $order->order_package > 0){?>
+<tr class = "bold">
+ <td colspan = "4" class = "right">
+    <?php echo _JSHOP_PACKAGE_PRICE?>
+ </td>
+ <td class = "left">
+   <?php echo formatprice($order->order_package, $order->currency_code);?><?php print $this->_tmp_ext_shipping_package?>
+ </td>
+</tr>
+<?php } ?>
 
 <?php if ($order->order_payment > 0){?>
 <tr class = "bold">
@@ -550,9 +561,12 @@
     <?php if (!$this->config->without_shipping){?>
     <td valign="top">
         <div style="padding-bottom:4px;"><?php echo $order->shipping_info?></div>
-        <?php if ($this->config->show_delivery_time){?>
+        <?php if ($order->delivery_time_name){?>
         <div><?php echo _JSHOP_DELIVERY_TIME.": ".$order->delivery_time_name?></div>
         <?php }?>
+        <?php if ($order->delivery_date_f){?>
+        <div><?php echo _JSHOP_DELIVERY_DATE.": ".$order->delivery_date_f?></div>
+        <?php }?>
     </td>
     <?php } ?>
     <?php if (!$this->config->without_payment){?>
Index: Z:/home/jshop/INSTALL/pack/admin/views/orders/tmpl/edit.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/orders/tmpl/edit.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/orders/tmpl/edit.php	(revision 20)
@@ -18,9 +18,18 @@
 <form action = "index.php?option=com_jshopping" method = "post" name = "adminForm">
 <?php if (!$this->display_info_only_product){?>
 <?php if (!$order->order_created){?>
-    <?php print _JSHOP_FINISHED?>: <input type="checkbox" name="order_created" value="1">
+    <?php print _JSHOP_FINISHED?>: <input type="checkbox" name="order_created" value="1"><br/>
 <?php }?>
-<table width="100%">
+	<script type="text/javascript">
+		var userinfo_fields = {};
+		<?php foreach ($config_fields as $k=>$v) {
+			if ($v['display']) echo "userinfo_fields['".$k."']='';";
+		} ?>
+		var userinfo_ajax = null;
+		var userinfo_link = "<?php print SEFLink("index.php?option=com_jshopping&controller=users&task=get_userinfo&ajax=1", 1, 1);?>";
+	</script>
+	<?php print _JSHOP_USER?>: <?php echo $this->users_list_select;?>
+<table class="jshop_address" width="100%">
 <tr>
     <td width="50%" valign="top">
         <table width = "100%" class = "adminlist">
@@ -351,6 +360,14 @@
     <input type="text" name="order_shipping" value="<?php echo $order->order_shipping;?>" onkeyup="updateOrderTotalValue();"/> <?php echo $order->currency_code;?> 
  </td>
 </tr>
+<tr class="bold">
+ <td class = "right">
+    <?php echo _JSHOP_PACKAGE_PRICE?>
+ </td>
+ <td class = "left">
+    <input type="text" name="order_package" value="<?php echo $order->order_package;?>" onkeyup="updateOrderTotalValue();"/> <?php echo $order->currency_code;?> 
+ </td>
+</tr>
 <?php }?>
 <?php if (!$this->config->without_payment){?>
 <tr class="bold">
Index: Z:/home/jshop/INSTALL/pack/admin/views/payments/view.html.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/payments/view.html.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/payments/view.html.php	(revision 20)
@@ -2,18 +2,19 @@
 defined( '_JEXEC' ) or die( 'Restricted access' );
 jimport( 'joomla.application.component.view');
 
-class JshoppingViewPayments extends JView
-{
-    function displayList($tpl = null){        
+class JshoppingViewPayments extends JView{
+
+    function displayList($tpl = null){
         JToolBarHelper::title( _JSHOP_LIST_PAYMENTS, 'generic.png' ); 
         JToolBarHelper::addNewX();
         JToolBarHelper::publishList();
         JToolBarHelper::unpublishList();
-        JToolBarHelper::deleteList();        
+        JToolBarHelper::deleteList();
         parent::display($tpl);
 	}
+
     function displayEdit($tpl = null){
-        JToolBarHelper::title( $temp = ($this->edit) ? (_JSHOP_EDIT_PAYMENT) : (_JSHOP_NEW_PAYMENT), 'generic.png' ); 
+        JToolBarHelper::title( $this->payment->payment_id ? (_JSHOP_EDIT_PAYMENT) : (_JSHOP_NEW_PAYMENT), 'generic.png' ); 
         JToolBarHelper::save();
         JToolBarHelper::spacer();
         JToolBarHelper::apply();
Index: Z:/home/jshop/INSTALL/pack/admin/views/payments/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/payments/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/payments/tmpl/list.php	(revision 20)
@@ -3,41 +3,44 @@
 $payments = $this->rows;
 $count = count($payments);
 $i = 0;
+$saveOrder = $this->filter_order_Dir=="asc" && $this->filter_order=="payment_ordering";
 ?>
 <form action = "index.php?option=com_jshopping&controller=payments" method = "post" name = "adminForm">
 <table class = "adminlist" width = "70%">
 <thead>
-  <tr>
-    <th class = "title" width  = "10">
-      #
-    </th>
-    <th width = "20">
-	  <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count;?>);" />
-    </th>
-    <th align = "left">
-      <?php echo _JSHOP_TITLE;?>
-    </th>
-    <th width = "200" align = "left">
-      <?php echo _JSHOP_CODE; ?>
-    </th>
-    <th width = "200" align = "left">
-      <?php echo _JSHOP_ALIAS;?>
-    </th>
-    
-    <th width = "40" colspan = "3">
-      <?php echo _JSHOP_ORDERING?>
-      <a class="saveorder" href="javascript:saveorder(<?php echo ($count-1);?>, 'saveorder')"></a>
-    </th>
-    <th width = "50">
-      <?php echo _JSHOP_PUBLISH; ?>
-    </th>
-    <th width="50">
-    	<?php print _JSHOP_EDIT; ?>
-    </th>
-    <th width = "40">
-        <?php echo _JSHOP_ID; ?>
-    </th>
-  </tr>
+    <tr>
+        <th class = "title" width  = "10">
+            #
+        </th>
+        <th width = "20">
+            <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count;?>);" />
+        </th>
+        <th align = "left">
+            <?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'name', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+        <th width = "200" align = "left">
+            <?php echo JHTML::_('grid.sort', _JSHOP_CODE, 'payment_code', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+        <th width = "200" align = "left">
+            <?php echo JHTML::_('grid.sort', _JSHOP_ALIAS, 'payment_class', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+
+        <th width = "40" colspan = "3">
+            <?php echo JHTML::_('grid.sort', _JSHOP_ORDERING, 'payment_ordering', $this->filter_order_Dir, $this->filter_order); ?>
+            <?php if ($saveOrder){?>
+            <a class="saveorder" href="javascript:saveorder(<?php echo ($count-1);?>, 'saveorder')"></a>
+            <?php }?>
+        </th>
+        <th width = "50">
+            <?php echo _JSHOP_PUBLISH; ?>
+        </th>
+        <th width="50">
+            <?php print _JSHOP_EDIT; ?>
+        </th>
+        <th width = "40">
+            <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'payment_id', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+    </tr>
 </thead>
 <?php
  $count = count($payments);
@@ -62,16 +65,16 @@
    </td>
    <td align = "right" width = "20">
     <?php
-      if ($i != 0) echo '<a href = "index.php?option=com_jshopping&controller=payments&task=order&id=' . $payment->payment_id . '&order=up&number=' . $payment->payment_ordering . '"><img alt="' . _JSHOP_UP . '" src="components/com_jshopping/images/uparrow.png"/></a>';
+      if ($i != 0 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=payments&task=order&id=' . $payment->payment_id . '&order=up&number=' . $payment->payment_ordering . '"><img alt="' . _JSHOP_UP . '" src="components/com_jshopping/images/uparrow.png"/></a>';
     ?>
    </td>
    <td align = "left" width = "20">
       <?php
-        if ($i != $count - 1) echo '<a href = "index.php?option=com_jshopping&controller=payments&task=order&id=' . $payment->payment_id . '&order=down&number=' . $payment->payment_ordering . '"><img alt="' . _JSHOP_DOWN . '" src="components/com_jshopping/images/downarrow.png"/></a>';
+        if ($i != $count - 1 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=payments&task=order&id=' . $payment->payment_id . '&order=down&number=' . $payment->payment_ordering . '"><img alt="' . _JSHOP_DOWN . '" src="components/com_jshopping/images/downarrow.png"/></a>';
       ?>
    </td>
    <td align = "center" width = "10">
-    <input type="text" name="order[]" id = "ord<?php echo $payment->payment_id;?>" size="5" value="<?php echo $payment->payment_ordering?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />
+    <input type="text" name="order[]" id = "ord<?php echo $payment->payment_id;?>" size="5" value="<?php echo $payment->payment_ordering?>" <?php if (!$saveOrder) echo 'disabled'?> class="text_area" style="text-align: center" />
    </td>
    <td align = "center">
      <?php
@@ -91,6 +94,8 @@
 ?>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/currencies/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/currencies/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/currencies/tmpl/list.php	(revision 20)
@@ -1,41 +1,41 @@
 <?php
 displaySubmenuOptions("currencies");
-
 $currencies = $this->rows;
 $i = 0;
+$saveOrder = $this->filter_order_Dir=="asc" && $this->filter_order=="currency_ordering";
 ?>
 <form action = "index.php?option=com_jshopping&controller=currencies" method = "post" name = "adminForm">
 <table class = "adminlist">
 <thead>
-  <tr>
-    <th class = "title" width  = "10">
-      #
-    </th>
-    <th width = "20">
-      <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $currencies );?>);" />
-    </th>
-    <th align = "left">
-      <?php echo _JSHOP_TITLE; ?>
-    </th>
-    <th width = "60">
-        <?php echo _JSHOP_DEFAULT;?>    
-    </th>
-    <th width = "60">
-        <?php echo _JSHOP_VALUE_CURRENCY;?>    
-    </th>    
-    <th colspan = "2" width = "40">
-      <?php echo _JSHOP_ORDERING; ?>
-    </th>    
-    <th width = "30">
-      <?php echo _JSHOP_PUBLISH; ?>
-    </th>
-    <th width = "50">
-        <?php print _JSHOP_EDIT; ?>
-    </th>
-    <th width = "40">
-        <?php echo _JSHOP_ID; ?>
-    </th>
-  </tr>
+    <tr>
+        <th class = "title" width  = "10">
+            #
+        </th>
+        <th width = "20">
+            <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $currencies );?>);" />
+        </th>
+        <th align = "left">
+            <?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'currency_name', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+        <th width = "60">
+            <?php echo _JSHOP_DEFAULT;?>    
+        </th>
+        <th width = "100">
+            <?php echo JHTML::_('grid.sort', _JSHOP_VALUE_CURRENCY, 'currency_value', $this->filter_order_Dir, $this->filter_order); ?> 
+        </th>    
+        <th colspan = "3" width = "80">
+            <?php echo JHTML::_('grid.sort', _JSHOP_ORDERING, 'currency_ordering', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>    
+        <th width = "30">
+            <?php echo _JSHOP_PUBLISH; ?>
+        </th>
+        <th width = "50">
+            <?php print _JSHOP_EDIT; ?>
+        </th>
+        <th width = "40">
+            <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'currency_id', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+    </tr>
 </thead>  
 <?php
  $count = count($currencies);
@@ -61,14 +61,17 @@
    </td>
    <td align = "right" width = "20">
     <?php
-      if ($i != 0) echo '<a href = "index.php?option=com_jshopping&controller=currencies&task=order&id=' . $currency->currency_id . '&order=up&number=' . $currency->currency_ordering . '"><img alt="' . _JSHOP_UP . '" src="components/com_jshopping/images/uparrow.png"/></a>';
+      if ($i != 0 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=currencies&task=order&id=' . $currency->currency_id . '&order=up&number=' . $currency->currency_ordering . '"><img alt="' . _JSHOP_UP . '" src="components/com_jshopping/images/uparrow.png"/></a>';
     ?>
    </td>
    <td align = "left" width = "20">
       <?php
-        if ($i != $count - 1) echo '<a href = "index.php?option=com_jshopping&controller=currencies&task=order&id=' . $currency->currency_id . '&order=down&number=' . $currency->currency_ordering . '"><img alt="' . _JSHOP_DOWN . '" src="components/com_jshopping/images/downarrow.png"/></a>';
+        if ($i != $count - 1 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=currencies&task=order&id=' . $currency->currency_id . '&order=down&number=' . $currency->currency_ordering . '"><img alt="' . _JSHOP_DOWN . '" src="components/com_jshopping/images/downarrow.png"/></a>';
       ?>
    </td>
+    <td align = "center" width = "10">
+        <input type="text" size="5" value="<?php echo $currency->currency_ordering; ?>" <?php echo 'disabled'?> class="text_area" style="text-align: center" />    
+    </td>
    
    <td align="center">
      <?php
@@ -88,6 +91,8 @@
 ?>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "<?php echo JRequest::getVar('task')?>" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/currencies/tmpl/edit.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/currencies/tmpl/edit.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/currencies/tmpl/edit.php	(revision 20)
@@ -1,26 +1,26 @@
 <?php
-$row = $this->currency;
-$lists = $this->lists;
-$edit = $this->edit;
+$row=$this->currency;
+$lists=$this->lists;
+$edit=$this->edit;
 ?>
-<form action = "index.php?option=com_jshopping&controller=currencies" method = "post"name = "adminForm">
+<form action="index.php?option=com_jshopping&controller=currencies" method="post"name="adminForm">
 
 <div class="col100">
 <fieldset class="adminform">
-    <table class="admintable" width = "100%" >
+    <table class="admintable" width="100%" >
    <tr>
-     <td class="key" width = "30%">
+     <td class="key" width="30%">
        <?php echo _JSHOP_PUBLISH;?>
      </td>
      <td>
-       <input type = "checkbox" name = "currency_publish" value = "1" <?php if ($row->currency_publish) echo 'checked = "checked"'?> />
+       <input type="checkbox" name="currency_publish" value="1" <?php if ($row->currency_publish) echo 'checked="checked"'?> />
      </td>
    </tr>
    <tr>
      <td  class="key">
        <?php echo _JSHOP_ORDERING; ?>
      </td>
-     <td id = "ordering">
+     <td id="ordering">
        <?php echo $lists['order_currencies']?>
      </td>
    </tr>
@@ -29,7 +29,7 @@
        <?php echo _JSHOP_TITLE;?>*
      </td>
      <td>
-       <input type = "text" class = "inputbox" id = "currency_name" name = "currency_name" value = "<?php echo $row->currency_name;?>" />
+       <input type="text" class="inputbox" id="currency_name" name="currency_name" value="<?php echo $row->currency_name;?>" />
      </td>
    </tr>
    <tr>
@@ -37,7 +37,7 @@
        <?php echo _JSHOP_CODE;?>*
      </td>
      <td>
-       <input type = "text" class = "inputbox" id = "currency_code" name = "currency_code" value = "<?php echo $row->currency_code;?>" />
+       <input type="text" class="inputbox" id="currency_code" name="currency_code" value="<?php echo $row->currency_code;?>" />
      </td>
    </tr>
    <tr>
@@ -45,26 +45,34 @@
        <?php echo _JSHOP_CODE." (ISO)";?>*
      </td>
      <td>
-       <input type = "text" class = "inputbox" name = "currency_code_iso" value = "<?php echo $row->currency_code_iso;?>" />
+       <input type="text" class="inputbox" name="currency_code_iso" value="<?php echo $row->currency_code_iso;?>" />
      </td>
    </tr>
    <tr>
      <td  class="key">
+       <?php echo _JSHOP_CODE." ("._JSHOP_NUMERIC.")";?>
+     </td>
+     <td>
+       <input type="text" class="inputbox" name="currency_code_num" value="<?php echo $row->currency_code_num;?>" />
+     </td>
+   </tr>
+   <tr>
+     <td  class="key">
        <?php echo _JSHOP_VALUE_CURRENCY;?>*
      </td>
      <td>
-       <input type = "text" class = "inputbox" id = "currency_value" name = "currency_value" value = "<?php echo $row->currency_value;?>" />
+       <input type="text" class="inputbox" id="currency_value" name="currency_value" value="<?php echo $row->currency_value;?>" />
      </td>
    </tr>
-   <?php $pkey = "etemplatevar";if ($this->$pkey){print $this->$pkey;}?>
+   <?php $pkey="etemplatevar";if ($this->$pkey){print $this->$pkey;}?>
  </table>
 </fieldset>
 </div>
 <div class="clr"></div>
 
-<input type = "hidden" name = "task" value = "<?php echo JRequest::getVar('task')?>" />
-<input type = "hidden" name = "edit" value = "<?php echo $edit;?>" />
+<input type="hidden" name="task" value="" />
+<input type="hidden" name="edit" value="<?php echo $edit;?>" />
 <?php if ($edit) {?>
-  <input type = "hidden" name = "currency_id" value = "<?php echo $row->currency_id?>" />
+<input type="hidden" name="currency_id" value="<?php echo $row->currency_id?>" />
 <?php }?>
 </form>
\ No newline at end of file
Index: Z:/home/jshop/INSTALL/pack/admin/views/taxes_ext/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/taxes_ext/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/taxes_ext/tmpl/list.php	(revision 20)
@@ -8,10 +8,10 @@
 <thead>
   <tr>
     <th class = "title" width  = "10">
-      #
+        #
     </th>
     <th width = "20">
-      <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count = count( $taxes );?>);" />
+        <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count = count( $taxes );?>);" />
     </th>
     <th align = "left">
         <?php echo _JSHOP_TITLE; ?>
@@ -20,21 +20,21 @@
         <?php echo _JSHOP_COUNTRY; ?>
     </th>
     <th width = "60">
-        <?php echo _JSHOP_TAX; ?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_TAX, 'ET.tax', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th width = "60">
         <?php 
         if ($this->config->ext_tax_rule_for==1) 
-            echo _JSHOP_USER_WITH_TAX_ID_TAX;
+            echo JHTML::_('grid.sort', _JSHOP_USER_WITH_TAX_ID_TAX, 'ET.firma_tax', $this->filter_order_Dir, $this->filter_order);
         else
-            echo _JSHOP_FIRMA_TAX;
+            echo JHTML::_('grid.sort', _JSHOP_FIRMA_TAX, 'ET.firma_tax', $this->filter_order_Dir, $this->filter_order);
         ?>
     </th>
     <th width = "50">
         <?php echo _JSHOP_EDIT; ?>
     </th>
     <th width = "40">
-        <?php echo _JSHOP_ID; ?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'ET.id', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
   </tr>
 </thead>  
@@ -72,6 +72,8 @@
 ?>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/config/tmpl/adminfunction.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/config/tmpl/adminfunction.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/config/tmpl/adminfunction.php	(revision 20)
@@ -114,7 +114,15 @@
         <input type="checkbox" name="tax" value="1" <?php if ($jshopConfig->tax) echo 'checked = "checked"';?> />
     </td>
 </tr>
-
+<tr>
+    <td class="key">
+        <?php echo _JSHOP_STOCK?>
+    </td>
+    <td>
+        <input type="hidden" name="stock" value="0"/>
+        <input type="checkbox" name="stock" value="1" <?php if ($jshopConfig->stock) echo 'checked = "checked"';?> />
+    </td>
+</tr>
 </table>
 </fieldset>
 </div>
Index: Z:/home/jshop/INSTALL/pack/admin/views/config/tmpl/categoryproduct.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/config/tmpl/categoryproduct.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/config/tmpl/categoryproduct.php	(revision 20)
@@ -37,6 +37,7 @@
         <input type="checkbox" name="show_plus_shipping_in_product" value="1" <?php if ($jshopConfig->show_plus_shipping_in_product) echo 'checked="checked"';?> />
     </td>
 </tr>
+<?php if ($jshopConfig->stock){?>
 <tr>
     <td class="key">
         <?php echo _JSHOP_HIDE_PRODUCT_NOT_AVAIBLE_STOCK?>
@@ -61,7 +62,8 @@
         <input type="checkbox" name="hide_text_product_not_available" value="1" <?php if ($jshopConfig->hide_text_product_not_available) echo 'checked="checked"';?> />
     </td>
 </tr>
-
+<?php }?>
+<?php if ($jshopConfig->admin_show_delivery_time){?>
 <tr>
     <td class="key">
         <?php echo _JSHOP_SHOW_DELIVERY_TIME?>
@@ -70,7 +72,7 @@
         <input type="checkbox" name="show_delivery_time" value="1" <?php if ($jshopConfig->show_delivery_time) echo 'checked="checked"';?> />
     </td>
 </tr>
-
+<?php }?>
 <tr>
     <td class="key">
         <?php echo _JSHOP_SHOW_DEFAULT_PRICE?>
@@ -290,7 +292,7 @@
     </td>
 </tr>
 <?php }?>
-
+<?php if ($jshopConfig->stock){?>
 <tr>
     <td class="key">
         <?php echo _JSHOP_QTY_IN_STOCK?>
@@ -300,7 +302,7 @@
         <input type="checkbox" name="product_list_show_qty_stock" value="1" <?php if ($jshopConfig->product_list_show_qty_stock) echo 'checked="checked"';?> />
     </td>
 </tr>
-
+<?php }?>
 <tr>
     <td></td>
     <td><?php print _JSHP_SEOPAGE_tophitsproducts?></td>
@@ -490,7 +492,7 @@
       <input type="checkbox" name="display_button_print" value="1" <?php if ($jshopConfig->display_button_print) echo 'checked="checked"';?> />
     </td>
 </tr>
-
+<?php if ($jshopConfig->stock){?>
 <tr>
     <td class="key">
         <?php echo _JSHOP_QTY_IN_STOCK?>
@@ -500,7 +502,7 @@
         <input type="checkbox" name="product_show_qty_stock" value="1" <?php if ($jshopConfig->product_show_qty_stock) echo 'checked="checked"';?> />
     </td>
 </tr>
- 
+<?php }?>
 <tr>
     <td class="key">
       <?php echo _JSHOP_REVIEW_MAX_MARK;?>
Index: Z:/home/jshop/INSTALL/pack/admin/views/config/tmpl/checkout.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/config/tmpl/checkout.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/config/tmpl/checkout.php	(revision 20)
@@ -26,9 +26,10 @@
       <?php echo _JSHOP_NEXT_ORDER_NUMBER;?>
     </td>
     <td>
-      <input type="text" name="next_order_number" value="<?php echo $jshopConfig->next_order_number;?>" />
+      <input type="text" name="next_order_number" value="" /> (<?php echo $jshopConfig->next_order_number?>)
     </td>
 </tr>
+<?php if (!$jshopConfig->without_shipping){?>
 <tr>
     <td class="key">
         <?php echo _JSHOP_HIDE_SHIPPING_STEP?>
@@ -37,6 +38,8 @@
         <input type="checkbox" name="hide_shipping_step" value="1" <?php if ($jshopConfig->hide_shipping_step) echo 'checked="checked"';?> />
     </td>
 </tr>
+<?php }?>
+<?php if (!$jshopConfig->without_payment){?>
 <tr>
     <td class="key">
         <?php echo _JSHOP_HIDE_PAYMENT_STEP?>
@@ -45,6 +48,8 @@
         <input type="checkbox" name="hide_payment_step" value="1" <?php if ($jshopConfig->hide_payment_step) echo 'checked="checked"';?> />
     </td>
 </tr>
+<?php }?>
+<?php if (!$jshopConfig->without_shipping){?>
 <tr>
     <td class="key">
       <?php echo _JSHOP_NULL_SIHPPING;?>
@@ -54,6 +59,7 @@
       <?php echo JHTML::tooltip(_JSHOP_NULL_SIHPPING_INFO);?>
     </td>
 </tr>
+<?php }?>
 <tr>
     <td class="key">
         <?php echo _JSHOP_ORDER_SEND_PDF_CLIENT?>
@@ -213,7 +219,7 @@
         <input type="checkbox" name="use_decimal_qty" value="1" <?php if ($jshopConfig->use_decimal_qty) echo 'checked="checked"';?> />
     </td>
 </tr>
-
+<?php if ($jshopConfig->admin_show_delivery_time){?>
 <tr>
     <td class="key">
         <?php echo _JSHOP_DELIVERY_ORDER_DEPENDS_DELIVERY_PRODUCT?>
@@ -223,19 +229,45 @@
         <input type="checkbox" name="delivery_order_depends_delivery_product" value="1" <?php if ($jshopConfig->delivery_order_depends_delivery_product) echo 'checked="checked"';?> />
     </td>
 </tr>
-
 <tr>
     <td class="key">
-        <?php echo _JSHOP_SHOW_DELIVERY_TIME." ("._JSHOP_ORDER_FINISH.")"?>
+        <?php echo _JSHOP_SHOW_DELIVERY_TIME?>
     </td>
     <td>
+        <input type="hidden" name="show_delivery_time_checkout" value="0" />
+        <input type="checkbox" name="show_delivery_time_checkout" value="1" <?php if ($jshopConfig->show_delivery_time_checkout) echo 'checked="checked"';?> />
+    </td>
+</tr>
+<tr>
+    <td class="key">
+        <?php echo _JSHOP_SHOW_DELIVERY_TIME." ("._JSHOP_PRODUCT.")"?>
+    </td>
+    <td>
         <input type="hidden" name="show_delivery_time_step5" value="0" />
         <input type="checkbox" name="show_delivery_time_step5" value="1" <?php if ($jshopConfig->show_delivery_time_step5) echo 'checked="checked"';?> />
     </td>
 </tr>
-
 <tr>
     <td class="key">
+        <?php echo _JSHOP_OC_display_delivery_time_for_product_in_order_mail?>
+    </td>
+    <td>
+        <input type="hidden" name="display_delivery_time_for_product_in_order_mail" value="0" />
+        <input type="checkbox" name="display_delivery_time_for_product_in_order_mail" value="1" <?php if ($jshopConfig->display_delivery_time_for_product_in_order_mail) echo 'checked="checked"';?> />
+    </td>
+</tr>
+<tr>
+    <td class="key">
+        <?php echo _JSHOP_SHOW_DELIVERY_DATE?>
+    </td>
+    <td>
+        <input type="hidden" name="show_delivery_date" value="0" />
+        <input type="checkbox" name="show_delivery_date" value="1" <?php if ($jshopConfig->show_delivery_date) echo 'checked="checked"';?> />
+    </td>
+</tr>
+<?php }?>
+<tr>
+    <td class="key">
         <?php echo _JSHOP_INVOICE_DATE?>
     </td>
     <td>
Index: Z:/home/jshop/INSTALL/pack/admin/views/product_fields/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/product_fields/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/product_fields/tmpl/list.php	(revision 20)
@@ -1,47 +1,48 @@
 <?php 
 displaySubmenuOptions();
 $rows = $this->rows; $count = count ($rows); $i = 0;
+$saveOrder = $this->filter_order_Dir == "asc" && $this->filter_order == "F.ordering";
 ?>
 <form action = "index.php?option=com_jshopping&controller=productfields" method = "post" name = "adminForm">
 <table class = "adminlist">
 <thead>
-  <tr>
-    <th class = "title" width  = "10">
-      #
-    </th>
-    <th width = "20">
-	  <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count;?>);" />
-    </th>
-    <th width = "200" align = "left">
-      <?php echo _JSHOP_TITLE; ?>
-    </th>
-    <th align = "left">
-      <?php echo _JSHOP_TYPE; ?>
-    </th>
-    <th align = "left">
-      <?php echo _JSHOP_OPTIONS; ?>
-    </th>
-    <th align = "left">
-      <?php echo _JSHOP_CATEGORIES; ?>
-    </th>
-    <th align = "left">
-      <?php echo _JSHOP_GROUP; ?>
-    </th>
-    <th colspan = "3" width = "40">
-      <?php echo _JSHOP_ORDERING; ?>
-      <a class="saveorder" href="javascript:saveorder(<?php echo ($count-1);?>, 'saveorder')" title="Save Order"></a>
-    </th>
-    <th width = "50">
-        <?php echo _JSHOP_EDIT; ?>
-    </th>
-    <th width = "40">
-        <?php echo _JSHOP_ID; ?>
-    </th>
-  </tr>
+    <tr>
+        <th class = "title" width  = "10">
+            #
+        </th>
+        <th width = "20">
+            <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count;?>);" />
+        </th>
+        <th width = "200" align = "left">
+            <?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'name', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+        <th align = "left">
+            <?php echo JHTML::_('grid.sort', _JSHOP_TYPE, 'F.type', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+        <th align = "left">
+            <?php echo _JSHOP_OPTIONS; ?>
+        </th>
+        <th align = "left">
+            <?php echo _JSHOP_CATEGORIES; ?>
+        </th>
+        <th align = "left">
+            <?php echo JHTML::_('grid.sort', _JSHOP_GROUP, 'groupname', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+        <th colspan = "3" width = "40">
+            <?php echo JHTML::_('grid.sort', _JSHOP_ORDERING, 'F.ordering', $this->filter_order_Dir, $this->filter_order); ?>
+            <?php if ($saveOrder){?>
+                <a class="saveorder" href="javascript:saveorder(<?php echo ($count-1);?>, 'saveorder')" title="Save Order"></a>
+            <?php }?>
+        </th>
+        <th width = "50">
+            <?php echo _JSHOP_EDIT; ?>
+        </th>
+        <th width = "40">
+            <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'id', $this->filter_order_Dir, $this->filter_order); ?>
+        </th>
+    </tr>
 </thead>
-<?php
- foreach ($rows as $row){
- ?>
+<?php foreach ($rows as $row) { ?>
   <tr class = "row<?php echo $i % 2;?>">
    <td>
      <?php echo $i + 1;?>
@@ -72,16 +73,16 @@
    </td>
    <td align = "right" width = "20">
     <?php
-        if ($i != 0) echo '<a href = "index.php?option=com_jshopping&controller=productfields&task=order&id='.$row->id.'&move=-1"><img alt="'._JSHOP_UP.'" src="components/com_jshopping/images/uparrow.png"/></a>';
+        if ($i != 0 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=productfields&task=order&id='.$row->id.'&move=-1"><img alt="'._JSHOP_UP.'" src="components/com_jshopping/images/uparrow.png"/></a>';
     ?>
    </td>
    <td align = "left" width = "20">
     <?php
-        if ($i != $count - 1) echo '<a href = "index.php?option=com_jshopping&controller=productfields&task=order&id='.$row->id.'&move=1"><img alt="'._JSHOP_DOWN.'" src="components/com_jshopping/images/downarrow.png"/></a>';
+        if ($i != $count - 1 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=productfields&task=order&id='.$row->id.'&move=1"><img alt="'._JSHOP_DOWN.'" src="components/com_jshopping/images/downarrow.png"/></a>';
     ?>
    </td>
    <td align = "center" width = "10">
-    <input type="text" name="order[]" id = "ord<?php echo $row->id;?>"  size="5" value="<?php echo $row->ordering; ?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />    
+    <input type="text" name="order[]" id = "ord<?php echo $row->id;?>"  size="5" value="<?php echo $row->ordering; ?>" <?php if (!$saveOrder) echo 'disabled'?> class="text_area" style="text-align: center" />    
    </td>
    <td align="center">
         <a href='index.php?option=com_jshopping&controller=productfields&task=edit&id=<?php print $row->id;?>'><img src='components/com_jshopping/images/icon-16-edit.png'></a>
@@ -96,6 +97,8 @@
 ?>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/attributesvalues/tmpl/list.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/attributesvalues/tmpl/list.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/attributesvalues/tmpl/list.php	(revision 20)
@@ -2,9 +2,9 @@
 displaySubmenuOptions("attributes");
 $rows = $this->rows;
 $attr_id = $this->attr_id;
-$attr_name = $this->attr_name;
 $count = count ($rows);
 $i = 0;
+$saveOrder = $this->filter_order_Dir=="asc" && $this->filter_order=="value_ordering";
 ?>
 <form action = "index.php?option=com_jshopping&controller=attributesvalues&attr_id=<?php echo $attr_id?>" method = "post" name = "adminForm">
 
@@ -18,20 +18,22 @@
 	  <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count;?>);" />
     </th>
     <th width = "200" align = "left">
-      <?php echo _JSHOP_NAME_ATTRIBUT_VALUE;?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_NAME_ATTRIBUT_VALUE, 'name', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
     <th align = "left">
-      <?php echo _JSHOP_IMAGE_ATTRIBUT_VALUE;?>
+        <?php echo _JSHOP_IMAGE_ATTRIBUT_VALUE;?>
     </th>
     <th colspan = "3" width = "40">
-    	<?php echo _JSHOP_ORDERING;?>
-        <a class="saveorder" href="javascript:saveorder(<?php echo ($count-1);?>, 'saveorder')"></a>
+    	<?php echo JHTML::_('grid.sort', _JSHOP_ORDERING, 'value_ordering', $this->filter_order_Dir, $this->filter_order); ?>
+        <?php if ($saveOrder){?>
+            <a class="saveorder" href="javascript:saveorder(<?php echo ($count-1);?>, 'saveorder')"></a>
+        <?php }?>
     </th>
 	<th width = "50">
         <?php echo _JSHOP_EDIT;?>
     </th>
     <th width = "40">
-        <?php echo _JSHOP_ID;?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_ID, 'value_id', $this->filter_order_Dir, $this->filter_order); ?>
     </th>
   </tr>
 </thead>
@@ -55,16 +57,16 @@
    </td>
    <td align = "right" width = "20">
     <?php
-      if ($i != 0) echo '<a href = "index.php?option=com_jshopping&controller=attributesvalues&task=order&id=' . $row->value_id . '&order=up&number=' . $row->value_ordering . '&attr_id=' . $attr_id . '"><img alt="' . _JSHOP_UP . '" src="components/com_jshopping/images/uparrow.png"/></a>';
+      if ($i != 0 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=attributesvalues&task=order&id=' . $row->value_id . '&order=up&number=' . $row->value_ordering . '&attr_id=' . $attr_id . '"><img alt="' . _JSHOP_UP . '" src="components/com_jshopping/images/uparrow.png"/></a>';
     ?>
    </td>
    <td align = "left" width = "20">
       <?php
-        if ($i++ != $count - 1) echo '<a href = "index.php?option=com_jshopping&controller=attributesvalues&task=order&id=' . $row->value_id . '&order=down&number=' . $row->value_ordering . '&attr_id=' . $attr_id . '"><img alt="' . _JSHOP_DOWN . '" src="components/com_jshopping/images/downarrow.png"/></a>';
+        if ($i++ != $count - 1 && $saveOrder) echo '<a href = "index.php?option=com_jshopping&controller=attributesvalues&task=order&id=' . $row->value_id . '&order=down&number=' . $row->value_ordering . '&attr_id=' . $attr_id . '"><img alt="' . _JSHOP_DOWN . '" src="components/com_jshopping/images/downarrow.png"/></a>';
       ?>
    </td>
    <td align = "center" width = "10">
-    <input type="text" name="order[]" id = "ord<?php echo $row->value_id;?>" size="5" value="<?php echo $row->value_ordering?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />
+    <input type="text" name="order[]" id = "ord<?php echo $row->value_id;?>" size="5" value="<?php echo $row->value_ordering?>" <?php if (!$saveOrder) echo 'disabled'?> class="text_area" style="text-align: center" />
    </td>
    <td align="center">
         <a href="index.php?option=com_jshopping&controller=attributesvalues&task=edit&value_id=<?php echo $row->value_id; ?>&attr_id=<?php echo $attr_id?>"><img src='components/com_jshopping/images/icon-16-edit.png'></a>
@@ -77,6 +79,8 @@
 ?>
 </table>
 
+<input type="hidden" name="filter_order" value="<?php echo $this->filter_order?>" />
+<input type="hidden" name="filter_order_Dir" value="<?php echo $this->filter_order_Dir?>" />
 <input type = "hidden" name = "task" value = "" />
 <input type = "hidden" name = "hidemainmenu" value = "0" />
 <input type = "hidden" name = "boxchecked" value = "0" />
Index: Z:/home/jshop/INSTALL/pack/admin/views/product_list/tmpl/default.php
===================================================================
--- Z:/home/jshop/INSTALL/pack/admin/views/product_list/tmpl/default.php	(revision 19)
+++ Z:/home/jshop/INSTALL/pack/admin/views/product_list/tmpl/default.php	(revision 20)
@@ -42,7 +42,7 @@
       <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo $count;?>);" />
     </th>
     <th width="93">
-        <?php print _JSHOP_IMAGE; ?>
+        <?php echo JHTML::_('grid.sort', _JSHOP_IMAGE, 'product_name_image', $this->filter_order_Dir, $this->filter_order)?>
     </th>
     <th>
       <?php echo JHTML::_('grid.sort', _JSHOP_TITLE, 'name', $this->filter_order_Dir, $this->filter_order)?>
@@ -65,9 +65,11 @@
     <th width="80">
         <?php echo JHTML::_( 'grid.sort', _JSHOP_EAN_PRODUCT, 'ean', $this->filter_order_Dir, $this->filter_order);?>
     </th>
+    <?php if ($this->config->stock){?>
     <th width="60">
         <?php echo JHTML::_( 'grid.sort', _JSHOP_QUANTITY_PRODUCT, 'qty', $this->filter_order_Dir, $this->filter_order);?>
     </th>
+    <?php }?>
     <th width="80">
         <?php echo JHTML::_( 'grid.sort', _JSHOP_PRICE, 'price', $this->filter_order_Dir, $this->filter_order);?>
     </th>
@@ -145,6 +147,7 @@
    <td>
     <?php echo $row->ean?>
    </td>
+   <?php if ($this->config->stock){?>
    <td>
     <?php if ($row->unlimited){
         print _JSHOP_UNLIMITED;
@@ -153,6 +156,7 @@
     }
     ?>
    </td>
+   <?php }?>
    <td>
     <?php echo formatprice($row->product_price, sprintCurrency($row->currency_id));?>
    </td>
