5 Replies Latest reply: Feb 15, 2013 3:46 AM by 989426 RSS

    ItemDiscountCalculator Customization Error

    989426
      Hi,

      I am trying to customize the calculator following below link.
      http://docs.oracle.com/cd/E23507_01/Platform.20073/ATGCommProgGuide/html/s0707addinganewpricingcalculator01.html

      getting below error.
      10:21:26,276 ERROR [ProfileTools]
      atg.commerce.pricing.PricingException: No pricing model was found for the promotion {0}
      at atg.commerce.pricing.Qualifier.findQualifyingItems(Qualifier.java:1213)
      at atg.commerce.pricing.ItemDiscountCalculator.findQualifyingItems(ItemDiscountCalculator.java:513)
      at atg.commerce.pricing.ItemDiscountCalculator.priceItems(ItemDiscountCalculator.java:314)
      at atg.commerce.pricing.ItemPricingEngineImpl.applyCalculator(ItemPricingEngineImpl.java:996)
      at atg.commerce.pricing.ItemPricingEngineImpl.priceItems(ItemPricingEngineImpl.java:592)
      at atg.commerce.pricing.PricingTools.priceItemsForOrderTotal(PricingTools.java:2774)
      at atg.commerce.pricing.PricingTools.priceOrderSubtotal(PricingTools.java:1908)
      at atg.commerce.pricing.PricingTools.priceOrderSubtotal(PricingTools.java:1839)
      at atg.commerce.pricing.PricingTools.performPricingOperation(PricingTools.java:3412)
      at atg.commerce.profile.CommerceProfileTools.repriceOrder(CommerceProfileTools.java:1935)
      at atg.commerce.profile.CommerceProfileTools.repriceShoppingCarts(CommerceProfileTools.java:1871)
      at atg.commerce.profile.CommerceProfileTools.loadUserShoppingCartForLogin(CommerceProfileTools.java:1623)
      at atg.commerce.profile.CommerceProfileTools.postLoginUser(CommerceProfileTools.java:2538)
      at atg.commerce.profile.CommerceProfileFormHandler.postLoginUser(CommerceProfileFormHandler.java:477)
      at atg.userprofiling.ProfileForm.handleLogin(ProfileForm.java:2067)
      at atg.scenario.userprofiling.ScenarioProfileFormHandler.handleLogin(ScenarioProfileFormHandler.java:563)
                
      I think the above error is beacause I am unable to set a pricing model’s pricingCalculatorService property to
      the Nucleus path of an instance of the new calculator.

      I have created a pricingModel.xml

      <item-descriptor name="Item Discount - Percent Off">
      <table name="dcs_discount_promo" type="auxiliary" id-column-name="promotion_id">
      <property name="pricingCalculatorService" data-type="string" default="/atg/commerce/pricing/HalfPlusOneItemDiscountCalculator" column-name="calculator"
      category-resource="categoryACCOnly" display-name-resource="pricingCalculatorService">
      <attribute name="uiwritable" value="false"/>
      <attribute name="propertySortPriority" value="100"/>
      </property>
      </table>
      </item-descriptor>

      when I run
      startSQLRepository -m Test -repository /atg/commerce/pricing/pricingModel /Repository/pricingModels.xml
      I get below error
      unable to find GSARepository component: /atg/commerce/pricing/pricingModel

      Kindly let me know where I am wrong?
      Thanks in advance.

      Edited by: AshishC on Feb 13, 2013 10:25 PM
        • 1. Re: ItemDiscountCalculator Customization Error
          Praveer.Rai
          Hi ,

          1- If you are not using ATG 2007 , refer to the oracle docs corresponding to your version..
          2 - Can you disable all your promotions fro timebeing and verify once.

          In this example of calculator - i dont think we require a promotion , as we are manually setting the price in findAdjustedPrice method.


          ~ Praveer
          • 2. Re: ItemDiscountCalculator Customization Error
            989426
            Hi,

            Thanks for reply.
            I have disable the promotion but still getting same error. I am using ATG10.1.1

            16:53:51,131 ERROR [ProfileTools]
            atg.commerce.pricing.PricingException: No pricing model was found for the promotion {0}
            at atg.commerce.pricing.Qualifier.findQualifyingItems(Qualifier.java:1213)
            at atg.commerce.pricing.ItemDiscountCalculator.findQualifyingItems(ItemDiscountCalculator.java:513)
            at atg.commerce.pricing.ItemDiscountCalculator.priceItems(ItemDiscountCalculator.java:314)
            at atg.commerce.pricing.ItemPricingEngineImpl.applyCalculator(ItemPricingEngineImpl.java:996)
            at atg.commerce.pricing.ItemPricingEngineImpl.priceItems(ItemPricingEngineImpl.java:592)
            at atg.commerce.pricing.PricingTools.priceItemsForOrderTotal(PricingTools.java:2774)
            at atg.commerce.pricing.PricingTools.priceOrderSubtotal(PricingTools.java:1908)
            at atg.commerce.pricing.PricingTools.priceOrderSubtotal(PricingTools.java:1839)
            at atg.commerce.pricing.PricingTools.performPricingOperation(PricingTools.java:3412)
            at atg.commerce.profile.CommerceProfileTools.repriceOrder(CommerceProfileTools.java:1935)
            at atg.commerce.profile.CommerceProfileTools.repriceShoppingCarts(CommerceProfileTools.java:1871)
            at atg.commerce.profile.CommerceProfileTools.loadUserShoppingCartForLogin(CommerceProfileTools.java:1623)
            at atg.commerce.profile.CommerceProfileTools.postLoginUser(CommerceProfileTools.java:2538)
            at atg.commerce.profile.CommerceProfileFormHandler.postLoginUser(CommerceProfileFormHandler.java:477)
            at atg.userprofiling.ProfileForm.handleLogin(ProfileForm.java:2067)
            at atg.scenario.userprofiling.ScenarioProfileFormHandler.handleLogin(ScenarioProfileFormHandler.java:563)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at atg.droplet.EventSender.sendEvent(EventSender.java:639)
            • 3. Re: ItemDiscountCalculator Customization Error
              Praveer.Rai
              Once verify your steps from here :

              http://docs.oracle.com/cd/E24152_01/Platform.10-1/ATGCommProgGuide/html/s1004addinganewpricingcalculator01.html
              • 4. Re: ItemDiscountCalculator Customization Error
                Gustavo.Recio
                The way to create custom promotions has changed dramatically between 2007.1 and 10.1.

                Check the appropriate documentation, and redo your steps. The calculator service is not specified anymore in the promotion item-descriptor definition (as far as I know)
                • 5. Re: ItemDiscountCalculator Customization Error
                  989426
                  Hi All,

                  I am able to resolve the issue by extending Customcalculator with ItemListPriceCalculator and overriding priceItem method.
                  Thanks all of you for your suggestion.