cancel
Showing results for 
Search instead for 
Did you mean: 

Free shipping

Former Member
0 Kudos

Is there a way to limit a Free shipping promotion to specific countries ? how to do it ?

bhavirisetty
Active Participant
0 Kudos

Which version of hybris you're using?

Accepted Solutions (0)

Answers (4)

Answers (4)

0 Kudos

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

Former Member
0 Kudos

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.

bhavirisetty
Active Participant
0 Kudos

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

former_member357259
Active Contributor
0 Kudos

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

Former Member
0 Kudos

I work on hybris 5.7 and 6.1 . yes i want to create country restriction for the same website