Jump to content
dbmaulana

Menunjukkan Harga Awal pada Produk yang Memiliki Diskon pada Invoice Prestashop 1.6

Recommended Posts

Mari kita lihat invoice default dari prestashop 1.6 adalah seperti gambar dibawah ini :

 
Harga "Unit Price" yang tertera pada bagian tersebut harusnya SGD$35.00, namun entah mengapa pada presatshop value yang di munculkan adalah harga product setelah di discount, sehingga jika sepintas kita melihat invoice di atas, itu akan terlihat sedikit aneh. ^_^
 
Oke untuk merubah/memperbaiki bugs tersebut mari ikut langkah berikut :
  • Buka file invoice.tpl pada folder pdf
  • Coba perhatikan baris 152-156, atau kurang lebih scriptnya sebagai berikut :
 {if $tax_excluded_display}
      {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl}
 {else}
      {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_incl}
  {/if}
  • Ganti script tersebut dengan script berikut :
{if $tax_excluded_display && (isset($order_detail.reduction_percent) && $order_detail.reduction_percent > 0)}
                        {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl*100/$order_detail.reduction_percent}
                    {elseif $tax_excluded_display && (isset($order_detail.reduction_amount) && $order_detail.reduction_amount > 0)}
                        {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl+$order_detail.reduction_amount}
                    {elseif $tax_excluded_display}
                        {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl}
                    {elseif (isset($order_detail.reduction_percent) && $order_detail.reduction_percent > 0)}
                        {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_incl*100/$order_detail.reduction_percent}
                    {elseif (isset($order_detail.reduction_amount) && $order_detail.reduction_amount > 0)}
                        {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_incl+$order_detail.reduction_amount}
                    {else}
                        {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_incl} 
                    {/if}
  • Kemudia save file tersebut dan hasilnya kurang lebih seperti gambar dibawah ini 
 result-invoice.jpg
 
 

Share this post


Link to post
Share on other sites

Hehe iya, tapi sih ini lebih ke Bugs juga, jadi saya sengaja posting di Laporan Bugs. :D

 

 

Thanks

 

-- 

Best regards,
Debe
Prestashop Developer

Phone    :   +689606112344
Skype   :   dbmaulana

Website :   http://debemaulana.com

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More