In the invoice template, I would like to hide the discount column if there are no discounts on the order. Is $this->order_discount the total discount applied to the order and if not, is there a single value that I could test against for whether or not any discount has been applied to the order (coupon, quantity, etc.)?
Hi,
You could create a template override for the the components\com_virtuemart\views\invoice\tmpl\invoice_items.php and just comment out the code you are don't need to displayed on invoices.
Regards
Quote from: bytelord on December 22, 2012, 00:32:15 AM
Hi,
You could create a template override for the the components\com_virtuemart\views\invoice\tmpl\invoice_items.php and just comment out the code you are don't need to displayed on invoices.
Regards
Hi bytelord,
I'm already there. What I am trying to do in my override is test for whether any discounts exist. I assume that the discount column would show any quantity discounts, coupon discounts, shopper group discounts, etc. Correct?
If that is the case, instead of having to code a test for all the potential discount values before the output, I'm looking to see if a value already exists in the object that sums all the discounts to be applied. If there is a single value that is the sum of all the potential discounts, than I can simply test against that and hide the discount column if that value is zero.
Is order_discount a sum of all the discounts in the cart, or is there some other value that is the sum of all the discounts in the cart?
Thanks.
Hello,
You have options in there, like per item
$item->product_subtotal_discount
$this->orderDetails['details']['BT']->order_discountAmount
$this->orderDetails['details']['BT']->coupon_discount
$this->orderDetails['details']['BT']->order_billDiscountAmount
use some if's over there to designed it as you wish
Quote from: bytelord on December 22, 2012, 13:15:43 PM
Hello,
You have options in there, like per item
$item->product_subtotal_discount
$this->orderDetails['details']['BT']->order_discountAmount
$this->orderDetails['details']['BT']->coupon_discount
$this->orderDetails['details']['BT']->order_billDiscountAmount
use some if's over there to designed it as you wish
Do any of these values contain the sum of all discounts applied to the order? I know $this->order_discount is used and I do not see that in your list.
$this->orderDetails['details']['BT']->order_billDiscountAmount)
Quote from: bytelord on December 22, 2012, 20:09:56 PM
$this->orderDetails['details']['BT']->order_billDiscountAmount)
Perfect. Thanks.