Custom promotion not work when recycle app pool

Vote:
 

Hi,

I create two custom promotions but i don't why each time i recycle app pool all promotions not work, if i publish promotion again and it work again

I try to disable one of the two custom promotion => every thing work fine

So, Is it possible that when running two custom promotions at the same time, they conflict?

namespace ABC.Models.Commerce.Promotions
{
    [ContentType(GUID = "A6D54BB8-3AA5-4FFA-B7A9-605736EE83CC", GroupName = "Beef Promotions",
         DisplayName = "Buy Items and Get Free Gifts",
         Description = "Buy Quantity (X) Items and Get Free Gifts", Order = 5100)]
    public class CustomBuyQuantityGetFreeItems : EntryPromotion
    {
        /// <summary>
        /// The condition for the promotion that needs to be fulfilled before the discount is applied.
        /// </summary>
        [Display(Order = 10)]
        [PromotionRegion("Condition")]
        public virtual PurchaseQuantity Condition { get; set; }

        [PromotionRegion("Reward")]
        [AllowedTypes(typeof(VariationContent))]
        [Display(Name = "Gift Item(s)", Order = 20)]
        public virtual IList<ContentReference> GiftItems { get; set; }
    }
}


namespace ABC.Models.Commerce.Promotions
{
    [ContentType(GUID = "E836722F-5974-4209-8066-33D3059D6156", GroupName = "StaffSales Promotions",
        DisplayName = "Buy Products and Get Discount on Order and Shipping",
        Description = "Buy Quantity (X) Items and Get Discount on Order and Shipping", Order = 6100)]
    [ImageUrl("/EPiServer/Commerce/Images/BuyQuantityGetOrderDiscount.png")]
    public class CustomBuyQuantityGetOrderDiscount : OrderPromotion, IMonetaryDiscount
    {
        [Display(Order = 10)]
        [PromotionRegion("Condition")]
        public virtual PurchaseQuantity Condition { get; set; }

        [Display(Order = 20)]
        [PromotionRegion("Discount")]
        public virtual MonetaryReward Discount { get; set; }

        public override void SetDefaultValues(ContentType contentType)
        {
            base.SetDefaultValues(contentType);
            RedemptionLimits.PerOrderForm = 1;
        }
	}
}

#259974
Edited, Aug 03, 2021 7:29
Vote:
 

There should be no problem with running multiple custom promotions at the same time. it sounds like your site has a problem with content model sync. Did you contact developer support service?

#259977
Aug 03, 2021 8:50
Vote:
 

Hi Quan,

It not only occured on DXC but also occurred on my local. I mean i am able to reproduce on my local. So i don't think site has a problem with content model sync

I even delete all promotions related to those custom promotions and i also delete custom promotion type in table [tableContentType] in order to init its again. But  issue still occurs

Regards,

Thang Le

#259981
Aug 03, 2021 11:14
Vote:
 

Hi Thang,

In your SetDefaultValues() method you've specified a redemption limit:

RedemptionLimits.PerOrderForm = 1;

Is this the problem?

#260449
Aug 11, 2021 10:05
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.