diff --git a/admin-dev/themes/template/products/informations.tpl b/admin-dev/themes/template/products/informations.tpl index 0b0875ad2..298f02811 100644 --- a/admin-dev/themes/template/products/informations.tpl +++ b/admin-dev/themes/template/products/informations.tpl @@ -531,17 +531,19 @@ $(document).ready(function(){ $(document).ready(function(){ if ($("#is_virtual_good").attr("checked")) { - $("#virtual_good").show("slow"); - $("#virtual_good_more").show("slow"); + $("#virtual_good").show(); + $("#virtual_good_more").show(); } if ( $("input[name=is_virtual_file]:checked").val() == 1) { + $("#virtual_good_more").show(); $("#virtual_good_attributes").show(); $("#is_virtual_file_product").show(); } else { + $("#virtual_good_more").hide(); $("#virtual_good_attributes").hide(); $("#is_virtual_file_product").hide(); } @@ -549,11 +551,13 @@ $(document).ready(function(){ $("input[name=is_virtual_file]").live("change", function() { if($(this).val() == "1") { + $("#virtual_good_more").show(); $("#virtual_good_attributes").show(); $("#is_virtual_file_product").show(); } else { + $("#virtual_good_more").hide(); $("#virtual_good_attributes").hide(); $("#is_virtual_file_product").hide(); } diff --git a/classes/Cart.php b/classes/Cart.php index e7a72175c..18984eb13 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -439,7 +439,7 @@ class CartCore extends ObjectModel // for compatibility with 1.2 themes $row['quantity'] = (int)($row['cart_quantity']); if (isset($row['id_product_attribute']) && (int)$row['id_product_attribute'] && isset($row['weight_attribute'])) - $row['weight'] = $row['weight_attribute']; + $row['weight'] = (float)$row['weight_attribute']; if ($this->_taxCalculationMethod == PS_TAX_EXC) { $row['price'] = Product::getPriceStatic((int)$row['id_product'], false, isset($row['id_product_attribute']) ? (int)($row['id_product_attribute']) : NULL, 2, NULL, false, true, (int)($row['cart_quantity']), false, ((int)($this->id_customer) ? (int)($this->id_customer) : NULL), (int)($this->id), ((int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) ? (int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) : NULL), $specificPriceOutput); // Here taxes are computed only once the quantity has been applied to the product price diff --git a/classes/order/OrderDetail.php b/classes/order/OrderDetail.php index 1d561b678..ef604bdcc 100644 --- a/classes/order/OrderDetail.php +++ b/classes/order/OrderDetail.php @@ -517,7 +517,7 @@ class OrderDetailCore extends ObjectModel $this->product_upc = empty($product['upc']) ? null : pSQL($product['upc']); $this->product_reference = empty($product['reference']) ? null : pSQL($product['reference']); $this->product_supplier_reference = empty($product['supplier_reference']) ? null : pSQL($product['supplier_reference']); - $this->product_weight = (float)$product['id_product_attribute'] ? $product['weight_attribute'] : $product['weight']; + $this->product_weight = (float)($product['id_product_attribute'] ? $product['weight_attribute'] : $product['weight']); $productQuantity = (int)(Product::getQuantity($this->product_id, $this->product_attribute_id)); $this->product_quantity_in_stock = ($productQuantity - (int)($product['cart_quantity']) < 0) ? @@ -549,7 +549,7 @@ class OrderDetailCore extends ObjectModel * @param int $id_order_invoice * @param bool $use_taxes set to false if you don't want to use taxes */ - public function createList(Order $order, Cart $cart, $id_order_state, $product_list, $id_order_invoice, $use_taxes = true) + public function createList(Order $order, Cart $cart, $id_order_state, $product_list, $id_order_invoice = 0, $use_taxes = true) { $this->vat_address = new Address((int)($order->{Configuration::get('PS_TAX_ADDRESS_TYPE')})); $this->customer = new Customer((int)($order->id_customer)); diff --git a/controllers/front/AuthController.php b/controllers/front/AuthController.php index ded9219e8..a0e888f61 100644 --- a/controllers/front/AuthController.php +++ b/controllers/front/AuthController.php @@ -277,6 +277,7 @@ class AuthControllerCore extends FrontController $this->context->cart->setDeliveryOption(null); $this->context->cart->id_address_delivery = Address::getFirstCustomerAddressId((int)($customer->id)); $this->context->cart->id_address_invoice = Address::getFirstCustomerAddressId((int)($customer->id)); + $this->context->cart->secure_key = $customer->secure_key; $this->context->cart->update(); // Add customer to the context $this->context->customer = $customer;