Sana Text ,Rich Text, Simple Text

use Sana Text in C# code:

CommerceFrameworkBase.SanaTexts.GetSanaText("ShopAccountNameLabel", "Shop Account"));

use Static class

ExtendedSanaTextKeys.CutOffTimePassed 
public static class ExtendedSanaTextKeys
    {
        public const string CutOffTimePassed = "Validation_CutOff";
    }
and Add text to SanaText.resx
<data name="Validation_CutOff" xml:space="preserve">
    <value>Requested delivery date is invalid or the cut off time has been missed.</value>
  </data>


Sana Text in Html

@Sana.SimpleText("ViewOrderDetails")


Rich Text

 @Sana.RichText("YouAreCurrentlyEditingOrder")



use with replace tags. 
@Sana.SimpleText("YourFirstPossibleDeliveryDate", "Your first possible delivery date is [FirstPossibleDeliveryDate]").iReplace("[FirstPossibleDeliveryDate]", nextDeleverydate.AsHtml(encode: true))




 string message = CommerceFrameworkBase.SanaTexts.GetSanaText("CustomerSwitchMessage").Replace("[SubAccountEmailAddress]", currentShopAccount.Email)
                .Replace("[CustomerAccountIDorigin]", currentShopAccount.ReferenceId)
                .Replace("[CustomerAccountNameOrigin]", currentCustomer.Name)
                .Replace("[CustomerAccountIDNew]", newCustomerId)
                .Replace("[CustomerAccountNameNew]", newCustomerName);

One Page checkout , normal checkout

One Page Checkout :-  Checkout control > index()

Normal Checkout : Checkout control > OrderOverview()

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 { getset; }
        public List<stringDisableDays getset; }
        public string NextPossibleDeliveryDate { getset; }
        public int DeliveryLookupPeriod { getset; }
    }



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.