bedford Posted April 3, 2020 Share Posted April 3, 2020 (edited) Hi, This is my second module development, I'm trying to override the core function (Context::getContext()->currentLocale->formatPrice(123.45, 'EUR');) I can't find a solution to override core with a module. Can anyone point me where to look at ? In my case I want the price calculated by some rules, no based on value inserted in product's table Thank you for your help. Edited April 3, 2020 by bedford (see edit history) Link to comment Share on other sites More sharing options...
joseantgv Posted April 3, 2020 Share Posted April 3, 2020 Do you want to modify the price amount or the price format? Link to comment Share on other sites More sharing options...
bedford Posted April 3, 2020 Author Share Posted April 3, 2020 9 minutes ago, joseantgv said: Do you want to modify the price amount or the price format? thank you for quick answer. I want to modify price amount. In fact the price amount in my case is a sort of calculation (provider price, provider currency change, margin). Also for some currencies I've to round to 5 cents (10.00, 10.05, 10.10, etc...) and I think I can do at the same place Thank you for your help Link to comment Share on other sites More sharing options...
joseantgv Posted April 3, 2020 Share Posted April 3, 2020 Then you'd better override Product::priceCalculation(). 1 Link to comment Share on other sites More sharing options...
bedford Posted April 3, 2020 Author Share Posted April 3, 2020 Just now, joseantgv said: Then you'd better override Product::priceCalculation(). OK thank you for pointing me to this. I'll have grouped products, do you think it's the correct place to do it anyway ? Link to comment Share on other sites More sharing options...
joseantgv Posted April 3, 2020 Share Posted April 3, 2020 What do you mean with "grouped products"? Link to comment Share on other sites More sharing options...
bedford Posted April 3, 2020 Author Share Posted April 3, 2020 2 minutes ago, joseantgv said: What do you mean with "grouped products"? I'll have a product which is a group of other products: Example 2 distincts products, chair and office desk, car be purchased separately but also as a grouped product (combined product) at a special discounted price. with 2 physical products I'll have 3 product for sale on my store. If chair is 50.50€ and office desk 150.50€ (but calculated 50.52 and 150.52), will the grouped price be 201 or 201.05 ? Link to comment Share on other sites More sharing options...
joseantgv Posted April 3, 2020 Share Posted April 3, 2020 Oh I don't, I suppose you will get the price for each product, but you would need to test it. Link to comment Share on other sites More sharing options...
bedford Posted April 3, 2020 Author Share Posted April 3, 2020 1 minute ago, joseantgv said: Oh I don't, I suppose you will get the price for each product, but you would need to test it. Ok doing module, will return back if not ok. Thanks a lot Sir Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now