# Extended Price Agent Item Factory not triggering

**URL:** <https://forum.litium.com/t/extended-price-agent-item-factory-not-triggering/628>\
**Category:** Questions\
**Tags:** litium-6\
**Created:** [February 26, 2019, 3:58pm UTC](https://forum.litium.com/t/extended-price-agent-item-factory-not-triggering/628 "2019-02-26T15:58:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dannyboy](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/dannyboy/32/55_2.png) [@dannyboy](https://forum.litium.com/u/dannyboy)\
**Post date:** [February 26, 2019, 3:58pm UTC](https://forum.litium.com/t/extended-price-agent-item-factory-not-triggering/628/1 "2019-02-26T15:58:12Z")

</div>

Hey,

I 've extended the default PriceAgentItemFactory as the instructions say in Litium Docs but for some reason the PriceAgentScheduler is ignoring my extension and only running the default factory every time it runs. Am I missing something? Do I need to refer my extension of the factory somewhere?

Litium version: 6.2.2

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [February 26, 2019, 4:21pm UTC](https://forum.litium.com/t/extended-price-agent-item-factory-not-triggering/628/2 "2019-02-26T16:21:28Z")

</div>

Can you provide any code about your extended factory so it is possible to test?

---

<div class="post-metadata">

**Author:** ![dannyboy](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/dannyboy/32/55_2.png) [@dannyboy](https://forum.litium.com/u/dannyboy)\
**Post date:** [February 27, 2019, 7:47am UTC](https://forum.litium.com/t/extended-price-agent-item-factory-not-triggering/628/3 "2019-02-27T07:47:40Z")

</div>

Here it comes.

```
  public class SamplePriceAgentItemFactory : PriceAgentItemFactory
    {
        private readonly ModuleCMS _moduleCms;

        public SamplePriceAgentItemFactory(IPriceCalculator priceCalculator, IStockStatusCalculator stockStatusCalculator, ICampaignPriceCalculator campaignPriceCalculator, IOrderFactory orderFactory, ModuleCMS moduleCms, LanguageService languageService, UrlService urlService, CategoryService categoryService, CurrencyService currencyService, FieldDefinitionService fieldDefinitionService, Litium.Foundation.Settings.ISettingService settingService)
            : base(priceCalculator, stockStatusCalculator, campaignPriceCalculator, orderFactory, moduleCms, languageService, urlService, categoryService, currencyService, fieldDefinitionService, settingService)
        {
            _moduleCms = moduleCms;
        }

        public override PriceAgentItemResult Create(PriceAgentItemArgs priceAgentItemArgs)
        {
            var website = _moduleCms.WebSites.GetWebSite(priceAgentItemArgs.WebSiteSystemId);
            var result = base.Create(priceAgentItemArgs);

            //custom code

            return result;
        }
    }
```

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [March 1, 2019, 7:27pm UTC](https://forum.litium.com/t/extended-price-agent-item-factory-not-triggering/628/4 "2019-03-01T19:27:03Z")

</div>

Check the output from `Litium.IoC.Container.RegistratedComponents` when you are debugging and see that your factory is registered before the default one.

---

<div class="post-metadata">

**Author:** ![dannyboy](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/dannyboy/32/55_2.png) [@dannyboy](https://forum.litium.com/u/dannyboy)\
**Post date:** [March 4, 2019, 11:54am UTC](https://forum.litium.com/t/extended-price-agent-item-factory-not-triggering/628/5 "2019-03-04T11:54:02Z")

</div>

My factory comes after `Litium.Web.Products.PriceAgents.PriceAgentItemFactory` in the list of `Litium.IoC.Container.RegistratedComponents`.

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [March 4, 2019, 12:09pm UTC](https://forum.litium.com/t/extended-price-agent-item-factory-not-triggering/628/6 "2019-03-04T12:09:07Z")

</div>

Try to add the assembly with the `add` node in the `web.config` regarding to [https://docs.litium.com/documentation/get-started/web\_config#plugins](https://docs.litium.com/documentation/get-started/web_config#plugins)

---

<div class="post-metadata">

**Author:** ![dannyboy](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/dannyboy/32/55_2.png) [@dannyboy](https://forum.litium.com/u/dannyboy)\
**Post date:** [March 4, 2019, 1:18pm UTC](https://forum.litium.com/t/extended-price-agent-item-factory-not-triggering/628/7 "2019-03-04T13:18:59Z")

</div>

Adding the assembly in the web.config put my factory before the default in the RegistratedComponents list and it is now triggered. Thanks!

---

<div class="post-metadata">

**Author:** ![dannyboy](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/dannyboy/32/55_2.png) [@dannyboy](https://forum.litium.com/u/dannyboy)\
**Post date:** [March 4, 2019, 5:13pm UTC](https://forum.litium.com/t/extended-price-agent-item-factory-not-triggering/628/8 "2019-03-04T17:13:01Z")

</div>

While the factory is now triggered successfully I still get zero products on the price agent .axd plugins.  
I get this error in the log.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/e0ebe56dc42e8cbd231edef9f9e1deedf2420a84.png)

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [March 4, 2019, 5:51pm UTC](https://forum.litium.com/t/extended-price-agent-item-factory-not-triggering/628/9 "2019-03-04T17:51:02Z")

</div>

See [https://docs.litium.com/support/bugs/bug\_details?id=44256](https://docs.litium.com/support/bugs/bug_details?id=44256)
