Skip to main content

Total discounts amount

More
1 year 11 months ago #364120 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 ?

Please Log in or Create an account to join the conversation.

More
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.

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #364128 by demoisellegol
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 :(

Please Log in or Create an account to join the conversation.

More
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.

Please Log in or Create an account to join the conversation.

Time to create page: 0.173 seconds
Powered by Kunena Forum