on 02-25-2019 8:02 AM
Hi,
I need to override DefaultCartFacade class, actually I took some steps but when I debug and open a new cart, and add a new product to cart, my custom class are not triggered at that time.
When I do this, I took advantage from this link : link text
, as test, I needn't any interface but as you said, the class signature is same.
public class KoctasParoDefaultCartFacade extends DefaultCartFacade {
@Override
public CartData getSessionCart() {
return super.getSessionCart();
}
@Override
public boolean hasSessionCart() {
return super.hasSessionCart();
}
@Override
public CartModificationData addToCart(String code, long quantity) throws CommerceCartModificationException {
return super.addToCart(code, quantity);
}
@Override
public CartModificationData addToCart(AddToCartParams addToCartParams) throws CommerceCartModificationException {
return super.addToCart(addToCartParams);
}
}
and, my spring xml looks like that.
<alias name="koctasParoDefaultCartFacade" alias="cartFacade"/>
<bean id="koctasParoDefaultCartFacade" class="com.itelligence.koctas.paro.facade.KoctasParoDefaultCartFacade"
parent="defaultCartFacade" />
What am I doing wrong ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1) Firstly configure like this in your *facade-spring xml:
<bean id="xyzCartFacade" class="com.xyz.facades.cart.facade.impl.DefaultXyzCartFacade" parent="defaultCartFacade">
</bean>
2) If you want to create your own interface, create it. public interface XyzCartFacade extends CartFacade
3) Your class will be like: public class DefaultXyzCartFacade extends DefaultCartFacade implements XyzCartFacade
Do the needful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
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.