1

I am adding active coupon with rule. When I am redeeming coupon, I can set coupon and in storefront writes coupon is applied. But total price of cart is not changed. Also when I publish rule, there is no change in total price of cart.

Thanks for responses and I am writing some details about situation:

First of all I added these extensions:

<extension name='rulebuilderbackoffice' />
<extension name='couponbackoffice' />
<extension name='droolsruleengineservices' />
<extension name='ruledefinitions' />
<extension name='promotionengineservices' />
<extension name='couponfacades' />
<extension name='promotionenginesamplesaddon' />
<extension name='promotionengineatddtests' />

Then I made ant clean all, ant initialize and start hybris.

From backoffice:

Create single code coupon (state is active, no date restriction, max redemption for customer is 10, max total redemption is 100),
Create rule (website is default, set priority 500, set as stackable, set rulegrup orderpromotionrulegroup), 
Add to rule condition as coupon code, set coupon code as created coupon code
Add to rule action as fixed discount on cart as 100 TRY
Publish rule to promotion-module, status is published
Promotion module's version is increased but catolog of promotion module is empty I don't know is it important?

In storefront:

I added an item to bag, its price is 338,28 TRY (there is no other discount)
I entered the coupon, 
In the page, says coupon is applied, but total price is didn't change, still 338,28 TRY.

In command line writes,

INFO  [hybrisHTTP17] [AbstractOrderRaoPopulator] Order discount list is empty, skipping the conversion
Kemal Taskiran
  • 311
  • 5
  • 18
  • can you give more detail about version, coupon type and rule? – mkysoft Oct 01 '17 at 20:48
  • Hi Kemal hocam, you may need to debug controller, check coupon code from backoffice, etc. if you provide more details, it would be better to find solution. do you see any log on terminal? – Winston Oct 01 '17 at 23:59

1 Answers1

1

It's hard to say what is going wrong without more details, but a common thing to forget (I do all the time) is to add the websitegroup to the SourceRule to match the website your promotion is targeted for. You would then have to republish the rule.

Also be aware that after your rule is published you have to modify the cart in order to trigger a re-evaluation of promotions. If you simply reload the cart page nothing will change as the promotion calculation is only done when the cart is modified.

If that's not the solution, could you provide more details? Ideally you could post the corresponding DroolsRule's ruleContent attribute (that contains the actual drools syntax being evaluated). Other information such as hybris version, log output etc would be helpful too.

Sebastian
  • 1,743
  • 1
  • 16
  • 35
  • I am added default to websitegroup for target. But I didn't do anything about cart recalculation. I hope this is done automatically in DefaultCommercePlaceOrderStrategy which is placeOrder and in this method getPromotionsService().transferPromotionsToOrder is called. May I modify some codes? – Kemal Taskiran Oct 02 '17 at 08:41
  • I am still thinking the rule isnt fired properly because of the websitegroup. You could try to install the b2c_acc recipe in a separate installation to see how its done in the sample data. Your CMSSite (e.g. electronics) needs to have the `defaultPromotionGroup` be set to the same value that you specify in your PromotionSourceRule as website. See `DefaultCommerceCartCalculationStrategy.getPromotionGroups()` method. This is being used during rule evaluation to retrieve which promotiongroup/website is active. Only rules with that website set will be eligible for triggering. Hope this helps! – Sebastian Oct 02 '17 at 12:15
  • Thanks for comment, and when I set CMSSite's promotion group as you say,problem is solved. – Kemal Taskiran Oct 04 '17 at 06:03