3. Add Web site to IIS
4. Add binding to IIS
5.Update host file
6.Update ERP connections
Project: Borsig
--------------------------------- When using WebClient-------------------------------------------
ExtendedImageLinkTask
private Stream LoadProductImageStream(IProductImage image) { try { using (WebClient webClient = new WebClient()) { // Download from Particular website expects a User-Agent header to be specified. webClient.Headers["User-Agent"] = "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)"; var result = webClient.DownloadData(image.MediumImagePath); Stream stream = new MemoryStream(result); return stream; } } catch (Exception ex) { TaskLog.Current.Add(this, "Error on image download" + ex.Message, LogPriority.Medium); } return null; } }
--------------------------------- When use HttpClient -------------------------------------------
configure Tag manager
https://www.youtube.com/watch?v=UcJB3UKsFDo&feature=youtu.be
create Analics Home > Admin > Create Account
2
copy id
3 create Tag manager
4 copy the GTM-XXX id and Past it on Sana Admin > setup> markeeting > Analitics
5 Go to Tag manager > Tags > create new > give name and tracking ID of Google Analitics eg :
UA-175XXXXX
6. Then Come to Sana Home And should show new Panel (Google Tag manager )
[HttpPost] public ActionResult SaveNewOrderTemplate(string name) { var existingTemplates = ShopApi.OrderTemplates.GetTemplates(); if (existingTemplates.Any(t => t.Name == name)) { var orderTemplate_SaveFailedInUse = CommerceFrameworkBase.SanaTexts.GetSanaText("OrderTemplate_SaveFailedInUse"); return Json(new { id = 0, error= orderTemplate_SaveFailedInUse }, JsonRequestBehavior.AllowGet);//fail } ShopApi.OrderTemplates.SaveOrderTemplate(name); // Get Template by name var existingTemplates2 = ShopApi.OrderTemplates.GetTemplates(); var template2 = existingTemplates2.Where(x => x.Name == name).FirstOrDefault(); var tempId = template2.Id; //return Json(tempId, JsonRequestBehavior.AllowGet);//Sucess return Json( new { id= tempId }, JsonRequestBehavior.AllowGet);//Sucess }
// on New Order Template popup Save button click var btnSave = document.getElementById('OrderTemplate_Save'); if (btnSave != null) { btnSave.onclick = savenewordertemplate; } function savenewordertemplate() { var newOrderTemplateName = $("#newOrderTemplateName").val(); $.ajax({ url: Sana.Urls.Home() + 'profile/ordertemplates/savenewordertemplate', method: "POST", data: { name: newOrderTemplateName } , //error: function () { // alert("Ajax call failed"); //} }).done(function (data) { if (data != null) { if (data.id == 0) { var error = data.error; $("#template_invalid").append(error); return; } var id = data.id; var retunurl = Sana.Urls.Home() + "profile/ordertemplates/details?templateId=" + id; window.location.replace(retunurl); } }) }
var el = document.getElementById('SaveOrderTemplate_test'); if (el != null) { el.onclick = openRegisterTerms; } function openRegisterTerms() { Sana.Popup.open('#createOrderTemplatePopup'); }
popup view
_CreateOrderTemplate.cshtml
@model NewOrderTemplateModel <div id="createOrderTemplatePopup" style="display: none;"> <div class="cnt-column"> <h2>@Sana.SimpleText("OrderTemplate_SavePopupHeader")</h2> @*@Html.EditorForModel()*@ @*<input type="text" id="newOrderTemplateName" name="OrderTemplateName">*@ @Html.TextBox("newOrderTemplateName", Model.Name) <div id="template_invalid"></div> </div> <div class="ftr-column"> <a class="btn-cancel btn-close-dialog" title="@Sana.SimpleText("ButtonText_Cancel")"> <span class="btn-cnt">@Sana.SimpleText("ButtonText_Cancel")</span> </a> <a id="OrderTemplate_Save" class="btn btn-small">@Sana.SimpleText("save", "save")</a> </div> </div>
//--------------------------
need to try by passinf model .
for Forehand Project
https://sanacommerce.visualstudio.com/Sana%20Projects/_workitems/edit/92470/
https://sanacommerce.visualstudio.com/Sana%20Projects/_workitems/edit/92470/
ExtendedOrdersController
<div id="quotePromotionConfirmationPopup" class="popup-cnt"> @*<form id="quotePromotionForm" onsubmit="return saveQuoteInfo2()">*@ <form id="quotePromotionForm"> <------ <div class="cnt-column"> <h2>@Sana.SimpleText("QuotePromotionConfirmationPopup_Title")</h2> <div>@Sana.RichText("QuotePromotionConfirmationPopup_Description", makeImagesResponsive: false)</div> </div> <div> @Html.Partial("_QuoteInfo", model) </div> <div class="ftr-column"> @cancelBtn @*@promoteBtn*@ @* Ticket 92470: [Forehand] 3.6. Quote-to-order conversion – Requested delivery date and reference no. *@ <input type="submit" id="QuoteInfo_Submit" value="Continue" class="btn btn-small btn-action btn-continue-promote" /> </div> </form> </div>
<div class="tbx tbx-quantity" style="display:none"> @{ string dataBind = @"value: quantity, attr: { 'data-val-regex': validationMessage(), 'data-min': minimumQuantity(), 'data-val-min': minimumValidationMessage(), 'data-max': maximumQuantity(), 'data-val-max': maximumValidationMessage(), 'data-step': quantityStep(), 'data-val-step': validationMessage() }, attributeToObservable: { 'data-min-msg-pattern': 'minimumValidationMessagePattern', 'data-max-msg-pattern': 'maximumValidationMessagePattern', 'data-step-msg-pattern': 'validationMessagePattern' }, numericInputUpdate: selectedUom"; } <input type="text" class="numeric" name="quantity" maxlength="8" data-val="true" data-val-regex-pattern="@Patterns.Quantity" data-min-msg-pattern="@Sana.SimpleText("ProductDetails_MinimumQuantityValidation").Decode()" data-max-msg-pattern="@Sana.SimpleText("ProductDetails_MaximumQuantityValidation").Decode()" data-step-msg-pattern="@Sana.SimpleText("Validation_QuantityValue").Decode()" data-bind="@dataBind" data-spinner-init="event" /> <span class="compact-sign-error field-validation-valid" data-valmsg-for="quantity" data-valmsg-replace="true"></span> </div>
//Validattion need to reset after replacing partial view $("form").removeData("validator"); $("form").removeData("unobtrusiveValidation"); $.validator.unobtrusive.parse("form");
//When Click Add to Template button $(document).on('click', '.btn-add-to-template', function (event) { var url = $(".btn-add-to-template").attr('data-src'); var templateId = $('input[name="TemplatePopupForm_TemplateId"]').val(); url = url + "?templateId=" + templateId; var data = self._getAddedTemplateLines(); var existingData = self._readExistingQuantities(); Sana.UI.LoadingIndicator.show(); return $.ajax({ url: url, type: 'post', data: JSON.stringify(data), contentType: 'application/json', success: function (data) { // window.location.reload(true); debugger; if (data != null && data != '') { if (data.templatePartialView != null) { $('.template-replace-area').replaceWith(data.templatePartialView); } if ($('.template-replace-area').length == 0) { $('.template-popup-form').wrap("<div class='template-replace-area'></div>"); } //When user add new items keep the Previous qty. self._updateQuantities(existingData); $(".btn-add-to-template-area").hide(); $(".gvi-template-lines-added > tbody > tr").remove(); $("#AddLinesToBasket").show(); $("#ClearQuantities").show(); Sana.UI.LoadingIndicator.hide(); //Validattion need to reset after replacing partial view $("form").removeData("validator"); $("form").removeData("unobtrusiveValidation"); $.validator.unobtrusive.parse("form"); Sana.Spinner.init(); } } }); });
HM-111036 - 3.9. SEARCH AND ADD PRODUCTS TO EXISTING TEMPLATES
ExtendedRegisteredUserBasketStorage
public override void SaveBasket(ShopContext shopContext, IBasket basket) { basket.UserKey = GetBasketUserKey(shopContext); basket.ShopAccountType = shopContext.ShopAccount.Type; // Ticket 70924: 4.3. EDITABLE ORDER TEMPLATES ((Basket)basket).CreatedBy = shopContext.ShopAccount.Name; if (shopContext.ShopAccount.Type == ShopAccountType.Contact) {
Sana.Spinner.init(); //Use Quantity box buttons(+,-) initializeation