Skip to Content
author's profile photo Former Member
Former Member

Free shipping

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Posted on Nov 21, 2016 at 03:10 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 25, 2016 at 06:58 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2017 at 03:49 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 31, 2017 at 06:40 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.