on 07-10-2019 10:23 AM
Hi Experts,
In our project a single product can have a multiple price row with a valid stnd end date and we wanted that the price row should be returned based on the price row creation time i.e the most recently created price row. So we thought of overriding the Europe1PriceFactory class and its method - matchPriceRowForPrice() in this method we want to put our custom logic. But although we created a custom price factory but still the OOTB price factory class is called only. Below are the steps that i followed for overriding the price factory. 1. Crated a new class that extends Europe1PriceFacotory public class EtradeEurope1PriceFactory extends Europe1PriceFactory { public PriceRow matchPriceRowForPrice() {
} }
This class i have created in CustomeB2BCoreExtension.
Then injected the bean into customb2bcore-spring.xml
Any help is highly appreciated here.
Thanks,
Simply add bean in the spring xml file with your price factory class (I've adde in the CompanyCore extention)
<bean id="europe1.manager" class="com.company.core.price.CompanyCatalogAwareEurope1PriceFactory"
init-method="init" destroy-method="destroy">
<property name="retrieveChannelStrategy" ref="retrieveChannelStrategy"/>
</bean>
Class file:
public class CompanyCatalogAwareEurope1PriceFactory extends CatalogAwareEurope1PriceFactory {
@Override
public PriceValue getBasePrice(AbstractOrderEntry entry) throws JaloPriceFactoryException {
super.getBasePrice(entry);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @kundan
Please override the below property to make your new custom price factory changes being reflected.
Name of an extension used as the default PriceFactory from the list of installed extensions
default.pricefactory=europe1
Please let me know if this helps you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So in my case i need to add below key-value in local.proerties right?
default.pricefactory=customeeurope1
Below is the bean definition in spring.xml file
<bean id="customeeurope1.manager"
class="com.custom.b2b.core.jalo.CustomeEurope1PriceFactory"
init-method="init" destroy-method="destroy">
<property name="retrieveChannelStrategy" ref="retrieveChannelStrategy"/>
</bean>
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.