Email ,Update a Email .

Eg: [47329] [EMP-115345] Urgent Regulators requirements - addition of Pharmacist and Reg to orders

1 Add new tag
ExtendedOrderConfirmationHelper >  GetReplaceTags





2update OrderConfimation.cshtml

replaceTags.Add("ORDER_PHARMACIST_INFO", Html.Partial(@"Order\PharmacistInformation", orderDetailsModel).ToString());




3 update mail template.resx with new tag or update  by Admin section mail template > template name (eg : order confimation)



How to Modify Current Basket


Eg : Emp 
  [47329] [EMP-115345] Urgent Regulators requirements - addition of Pharmacist and Reg to orders


From controller:-
((ExtendedBasketApi)ShopApi.Basket).SetAdditinalInfoMethod(contactName, registrationNo, isConfirm);




From ExtendedBasketApi :-
public virtual void SetAdditinalInfoMethod(string contactName, string registrationNo, bool isConfirm)
        {
            ModifyCurrentBasket(basket =>
            {
                ((Basket)basket).Pharmacist_ContactName = contactName;
                ((Basket)basket).Pharmacist_RegistrationNo = registrationNo;
                ((Basket)basket).Pharmacist_IsConfirm = isConfirm;               
                return true;
            });
        }




Create Sub Accounts on ShopAdmin Section


[Diversey] 3.2. MANAGER SHOP ACCOUNT ASSIGNED TO MULTIPLE CHILD CUSTOMER ACCOUNTS

Versalert Project

Calculate Basket Saving

Divercy Project 3.1 

ERP To Database


ExtendedOrderProvider.cs  > UpdateCalculatedBasket






Sana DB to ERP

ExtendedSyncBasketsStep.cs >  Execute

public override void Execute(BasketCalculationContext context)
        {
            base.Execute(context);

            //Ticket 70914: 3.8. TOTAL BASKET/ORDER VOLUME & WEIGHT
            ((Basket)context.SourceBasket).TotalVolume = ((Basket)context.CalculatedBasket).TotalVolume;
            ((Basket)context.SourceBasket).TotalWeight = ((Basket)context.CalculatedBasket).TotalWeight;
            OnSourceBasketChanged(context);
        }



Date picker ,delivery date set disable dates

HM-111027 - 3.2. USE CUSTOM QUANTITY AND UOM FIELDS ON THE ORDER LINES -

[48670] [Diversey] 3.1. DELIVERY BASED ON ERP FACTORY CALENDARS

Versalert project


1. we keep disabled dates on model

ExtendedAdditionalInfoModel




public class ExtendedAdditionalInfoModel : AdditionalInfoModel
    {
        //RFC01_v1.4:[Ticket 48670] 3.1.DELIVERY BASED ON ERP FACTORY CALENDARS
        [Required]
        [LookupPeriodDateValidation(ErrorMessageResourceName = SanaTextKeys.InvalidField)]
        [DisableDateValidation(ErrorMessageResourceName = SanaTextKeys.InvalidField)]
        public override Date? DeliveryDate { get; set; }
        public List<string> DisableDays { get; set; }
        public string NextPossibleDeliveryDate { get; set; }
        public int DeliveryLookupPeriod { get; set; }
    }



2. Update the model and pass to view

((ExtendedAdditionalInfoModel)model.AdditionalInfo).DisableDays = combindedDeliveryDatesList;((ExtendedAdditionalInfoModel)model.AdditionalInfo).NextPossibleDeliveryDate = GetNextPossibleDeliveryDate(holidays).ToShortDateString();
ExtendedCheckoutController > 
private void SetDeliveryDatesToModel(OrderOverviewModel model, List<string> deliveryDates, int deliveryCalendarLookupPeriod)
        {
            List<Date> holidays = new List<Date>();
            var combindedDeliveryDatesList = new List<string>();
 
            if (deliveryDates != null)
            {
                foreach (var item in deliveryDates)
                {
                    DateTime oDate = DateTime.Parse(item);
 
                    // Remove dates greater than deliveryCalendarLookupPeriod 
                    if ((oDate - DateTime.Now).TotalDays >= deliveryCalendarLookupPeriod)
                        continue;
 
                    string strDate = oDate.ToShortDateString();
                    combindedDeliveryDatesList.Add(strDate);
 
                    // Check current date is on list
                    holidays.Add(Date.Parse(oDate.ToShortDateString()));
                }
                ((ExtendedAdditionalInfoModel)model.AdditionalInfo).DisableDays = combindedDeliveryDatesList;
            }
            ((ExtendedAdditionalInfoModel)model.AdditionalInfo).NextPossibleDeliveryDate = GetNextPossibleDeliveryDate(holidays).ToShortDateString();
 
            if (((ExtendedOrderManager)CommerceFrameworkBase.Orders).DeliveryCalendarLookupPeriod > 0)
            {
                // Remove one date from Lookup Period to indlude current date.
                ((ExtendedAdditionalInfoModel)model.AdditionalInfo).DeliveryLookupPeriod = ((ExtendedOrderManager)CommerceFrameworkBase.Orders).DeliveryCalendarLookupPeriod - 1;
            }
        }

get Language formate and culture info, to support Langage switch.

Simple ajax get method


ACTEN-108915 - Popup warning

 var showAddtoCartVersionPopup = function (type) {

            var data = getLines(type);
            if (data.length > 0) {
                return $.ajax({
                    url: Sana.Urls.Home() + 'Basket/IsShowVirsionPopup',
                    type: 'GET',
                    data: { IsPopupShow: "true" },
                    dataType: 'json',
                    success: function (data) { 
                        if (data === "True") {
                            var popup = $('#SparePartVirstionPopup');
                            Sana.Popup.open('#SparePartVirstionPopup');
                            return;
                        }
                        else if (data === "False") {
                            addToBasket(type);
                        }                       
                    },
                    error: function (request, error) {
                        return;                       
                    }
                });
            }
        };



public class ExtendedBasketController : BasketController
    {

protected override void RegisterSystemRoutes(SanaRouteCollection routes)
        {
            routes.MapActionRoute(controller: Name, action: "IsShowVirsionPopup", urlPath: "/Basket/IsShowVirsionPopup");
            base.RegisterSystemRoutes(routes);
        }




[HttpGet]
        public ActionResult IsShowVirsionPopup(string IsPopupShow)
        {  your Code }


}