Jump to content

Showing prices before and after group discount on product list


thn_

Recommended Posts

I'm setting up B2B platform for our shop on PS 1.7, it's basically multistore, but with different prices and discounts for client groups. I've managed to show % of group discount, price without price discount, and amount of discount in product details by adding code:

{if $product.customer_group_discount > 0}
    <p>Your discount <strong>{$product.customer_group_discount*100}%</strong><br>
    Price before discount: <strong>{( $product.price_amount/(1-$product.customer_group_discount) )|round:2} $</strong><br>
	Discount amount: <strong>{( $product.price_amount/(1-$product.customer_group_discount)*$product.customer_group_discount )|round:2} $</strong></p>
{/if}

But I can't figure it out how to do the same on product list/categories, it seems that $product.customer_group_discount doesn't work there. Is there any way to make it work?

Link to comment
Share on other sites

18 hours ago, Prestashop Addict said:

You can use:

Group::getReductionByIdGroup($customer.id_default_group)

 

I've tried this, but in result I'm getting 0.

Link to comment
Share on other sites

On 3/15/2024 at 1:11 PM, Prestashop Addict said:

This only works if user affected to group is connected.

to be specific - it only works when discount is set for all products, not only for certain categories

Link to comment
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
×
×
  • Create New...