on 11-20-2016 11:31 AM
Is there a way to limit a Free shipping promotion to specific countries ? how to do it ?
Hi, Can the above code be used for hybris 6.2 version? I was able to see the restriction in hmc, but was getting "PromotionDeliveryCountryRestriction not supported" error. Please help.
Thanks, V
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi RT,
Did you find your answer ? Can you please guide me in details? I have the same scenario in 6.2 promotions
Please help. Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am not sure about earlier versions, but if you want achieve this in hybris 6.x versions then write custom restriction like below, 1. Define restriction
<itemtype code="PromotionDeliveryCountryRestriction"
extends="AbstractPromotionRestriction"
jaloclass="de.hybris.platform.commerceservices.jalo.promotions.PromotionDeliveryCountryRestriction"
autocreate="true"
generate="true">
<attributes>
<attribute qualifier="supportedCountries" type="java.lang.String">
<persistence type="property" />
</attribute>
</attributes>
</itemtype>
Then override evaluate method with follow logic in your new jalo class PromotionDeliveryCountryRestriction
,
@Override
public RestrictionResult evaluate(final SessionContext ctx, final Collection<Product> products, final Date date,
final AbstractOrder order)
{
if (order != null && order.getDeliveryAddress()!=null && order.getDeliveryAddress().getCountry()!=null && this.supportedCountries.contains(order.getDeliveryAddress().getCountry().getIsocode()))
{
return RestrictionResult.ALLOW;
}
return RestrictionResult.DENY;
}
Then for your promotion configure this restriction.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you want to create country restriction for the same website or different country based websites? If its the first case, you have to custom implement a restriction/condition based on the promotion engine you use
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.