-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[ProductBundle] Question: Different prices for Retailers? #1120
Copy link
Copy link
Closed
Labels
Help WantedIssues needing help and clarification.Issues needing help and clarification.
Description
Hey folks!
First of all I'm fairly new to Symfony and Sylius, hence I'm posting here to get some feedback and a sense of direction from the more experienced users within these realms.
I'm making a Retailers user group with a ROLE_RETAILER role. If the logged in user is a retailer I would like to:
- Show a reduced price; this is a predefined percentage e.g. 20% (configurable)
The price would be displayed correctly on all parts of the site: browsing products, product view and cart. - Show the prices excluding taxes; by default I show prices with taxes included.
Now I'd like to know where I would best "hook" into the Product entity to apply some logic to modify its price. I've read about a postLoad event, which I believe was discouraged for some reason.
I could think of these approaches:
- extend the
Productmodel and modify thegetPrice()method - somehow listen to the
postLoadevent forProductand set its price accordingly (?)
How would you tackle this?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Help WantedIssues needing help and clarification.Issues needing help and clarification.