- Posts: 61
- Thank you received: 3
Total discounts amount
- demoisellegol
-
Topic Author
- Offline
Less
More
1 year 11 months ago #364120
by demoisellegol
Total discounts amount was created by demoisellegol
-- HikaShop version -- : 5.1.1
-- Joomla version -- : 5.2.0
-- PHP version -- : 8.2
Hi
suppose that I have 3 products in my cart, which I have $2 discount on each
how can I display the total discount (which will be $6 in this example) in my cart summery ?
-- Joomla version -- : 5.2.0
-- PHP version -- : 8.2
Hi
suppose that I have 3 products in my cart, which I have $2 discount on each
how can I display the total discount (which will be $6 in this example) in my cart summery ?
Please Log in or Create an account to join the conversation.
1 year 11 months ago #364122
by nicolas
Replied by nicolas on topic Total discounts amount
Hi,
There is no option for such a display. You would need to edit the checkout / show_block_cart view file via the menu Display>Views to add custom PHP code to calculate that total discount amount and then display it.
There is no option for such a display. You would need to edit the checkout / show_block_cart view file via the menu Display>Views to add custom PHP code to calculate that total discount amount and then display it.
Please Log in or Create an account to join the conversation.
- demoisellegol
-
Topic Author
- Offline
Less
More
- Posts: 61
- Thank you received: 3
1 year 11 months ago #364128
by demoisellegol
Replied by demoisellegol on topic Total discounts amount
I used print_r and fount somewhere that total_price_without_discount
if i could echo this number somewhere in that file, i can get total discount amount by subtracting total price wiout discout and total price
but i cant get that total without dicount
if i could echo this number somewhere in that file, i can get total discount amount by subtracting total price wiout discout and total price
but i cant get that total without dicount
Please Log in or Create an account to join the conversation.
1 year 11 months ago #364130
by nicolas
Replied by nicolas on topic Total discounts amount
Hi,
The "total_price_without_discount" is the subtotal without coupons added, not discounts. So, it's not what you want.
You need to loop through the $cart->products array and in each product object, if there is a "discount" attribute object then the discount_flat_amount can be summed.
This will give you the total discount amount.
The "total_price_without_discount" is the subtotal without coupons added, not discounts. So, it's not what you want.
You need to loop through the $cart->products array and in each product object, if there is a "discount" attribute object then the discount_flat_amount can be summed.
This will give you the total discount amount.
Please Log in or Create an account to join the conversation.
Time to create page: 0.187 seconds