diff --git a/classes/order/OrderDetail.php b/classes/order/OrderDetail.php index 9eadd6d5e..58607015e 100644 --- a/classes/order/OrderDetail.php +++ b/classes/order/OrderDetail.php @@ -450,19 +450,8 @@ class OrderDetailCore extends ObjectModel */ protected function setDetailProductPrice(Order $order, Cart $cart, $product) { - $customer = new Customer((int)$order->id_customer); - $customer_address = new Address((int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); - $this->specificPrice = SpecificPrice::getSpecificPrice( - (int)$product['id_product'], - (int)$order->id_shop, - (int)$order->id_currency, - (int)$customer_address->id_country, - (int)$customer->id_default_group, - (int)$product['cart_quantity'], - (int)$product['id_product_attribute'], - (int)$customer->id, - (int)$order->id_cart - ); + Product::getPriceStatic((int)$product['id_product'], true, (int)$product['id_product_attribute'], 6, null, false, true, $product['cart_quantity'], false, (int)$order->id_customer, (int)$order->id_cart, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}, $specific_price); + $this->specificPrice = $specific_price; $this->original_product_price = Product::getPriceStatic($product['id_product'], false, (int)$product['id_product_attribute'], null, null, false, false, 1, false); $this->product_price = (float)$product['price']; diff --git a/themes/default/js/product.js b/themes/default/js/product.js index 06bc27e66..758dc283b 100644 --- a/themes/default/js/product.js +++ b/themes/default/js/product.js @@ -312,7 +312,8 @@ function updateDisplay() $('#reduction_amount').hide(); $('#reduction_percent_display').html('-' + parseFloat(selectedCombination['specific_price'].reduction_percent) + '%'); $('#reduction_percent').show(); - } else if (selectedCombination['specific_price'].reduction_type == 'amount') { + } else if (selectedCombination['specific_price'].reduction_type == 'amount' && selectedCombination['specific_price'].reduction_price != 0) { + $('#reduction_amount_display').html('-' + formatCurrency(selectedCombination['specific_price'].reduction_price, currencyFormat, currencySign, currencyBlank)); $('#reduction_percent').hide(); $('#reduction_amount').show(); } else { diff --git a/themes/default/product.tpl b/themes/default/product.tpl index 6b4e50369..92a8b31c9 100644 --- a/themes/default/product.tpl +++ b/themes/default/product.tpl @@ -395,11 +395,8 @@ var fieldRequired = '{l s='Please fill in all required fields, then save the cus {convertPrice price=$product->getPrice(false, $smarty.const.NULL)} {l s='tax excl.'} {/if} - {if $product->specificPrice AND $product->specificPrice.reduction_type == 'percentage'} -

-{$product->specificPrice.reduction*100}%

- {elseif $product->specificPrice AND $product->specificPrice.reduction_type == 'amount' && $product->specificPrice.reduction|intval !=0} -

-{convertPrice price=$product->specificPrice.reduction|floatval}

- {/if} +

{if $product->specificPrice AND $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}

+

{if $product->specificPrice AND $product->specificPrice.reduction_type == 'amount' && $product->specificPrice.reduction|intval !=0}-{convertPrice price=$product->specificPrice.reduction|floatval}{/if}

{if $product->specificPrice AND $product->specificPrice.reduction}