diff --git a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Dynamicweb.Ecommerce.DynamicwebLiveIntegration.csproj b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Dynamicweb.Ecommerce.DynamicwebLiveIntegration.csproj index a9debb9..8365b8a 100644 --- a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Dynamicweb.Ecommerce.DynamicwebLiveIntegration.csproj +++ b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Dynamicweb.Ecommerce.DynamicwebLiveIntegration.csproj @@ -1,6 +1,6 @@  - 10.4.34 + 10.4.35 1.0.0.0 Live Integration Live Integration diff --git a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/NotificationSubscribers/PageLoaded.cs b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/NotificationSubscribers/PageLoaded.cs index fd5cfd4..6ea5548 100644 --- a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/NotificationSubscribers/PageLoaded.cs +++ b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/NotificationSubscribers/PageLoaded.cs @@ -1,7 +1,6 @@ using Dynamicweb.Ecommerce.DynamicwebLiveIntegration.Configuration; using Dynamicweb.Ecommerce.DynamicwebLiveIntegration.Connectors; using Dynamicweb.Extensibility.Notifications; -using Dynamicweb.Frontend; using System; namespace Dynamicweb.Ecommerce.DynamicwebLiveIntegration.NotificationSubscribers @@ -30,7 +29,10 @@ public override void OnNotify(string notification, NotificationArgs args) var settings = SettingsManager.GetSettingsByShop(Global.GetShopId(loadedArgs.PageViewInstance)); if (settings != null && Global.IsIntegrationActive(settings)) { - isWebServiceConnectionAvailable = Connector.IsWebServiceConnectionAvailable(settings, SubmitType.Live); + if (settings.EnableLivePrices || settings.CartCommunicationType != Constants.CartCommunicationType.None || !string.IsNullOrEmpty(settings.WebServiceConnectionStatusGlobalTagName)) + { + isWebServiceConnectionAvailable = Connector.IsWebServiceConnectionAvailable(settings, SubmitType.Live); + } isLazyLoadingForProductInfoEnabled = Global.IsLazyLoadingForProductInfoEnabled(settings); if (Context.Current.Session != null && Convert.ToBoolean(Context.Current.Session["DynamicwebLiveIntegration.OrderExportFailed"])) @@ -46,6 +48,6 @@ public override void OnNotify(string notification, NotificationArgs args) Context.Current.Items["IsWebServiceConnectionAvailable"] = isWebServiceConnectionAvailable; Context.Current.Items["IsLazyLoadingForProductInfoEnabled"] = isLazyLoadingForProductInfoEnabled; } - } + } } } \ No newline at end of file diff --git a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/NotificationSubscribers/PageOnGlobalTags.cs b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/NotificationSubscribers/PageOnGlobalTags.cs index f95295f..4ac28ce 100644 --- a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/NotificationSubscribers/PageOnGlobalTags.cs +++ b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/NotificationSubscribers/PageOnGlobalTags.cs @@ -22,16 +22,15 @@ public override void OnNotify(string notification, NotificationArgs args) if (pageviewNotificationArgs != null) { var settings = SettingsManager.GetSettingsByShop(Global.GetShopId(pageviewNotificationArgs.Pageview)); - if (settings != null && EnabledAndActive(settings, SubmitType.Live)) - { + if (settings != null) + { string globalTagName = settings.WebServiceConnectionStatusGlobalTagName; - if (!string.IsNullOrEmpty(globalTagName)) + if (!string.IsNullOrEmpty(globalTagName) + && pageviewNotificationArgs.Template.TagExists(globalTagName) + && EnabledAndActive(settings, SubmitType.Live)) { - if (pageviewNotificationArgs.Template.TagExists(globalTagName)) - { - pageviewNotificationArgs.Template.SetTag(globalTagName, Connector.IsWebServiceConnectionAvailable(settings, SubmitType.Live).ToString().ToLower()); - pageviewNotificationArgs.Template.SetTag("Global:LiveIntegration.IsLazyLoadingForProductInfoEnabled", Global.IsLazyLoadingForProductInfoEnabled(settings).ToString().ToLower()); - } + pageviewNotificationArgs.Template.SetTag(globalTagName, Connector.IsWebServiceConnectionAvailable(settings, SubmitType.Live).ToString().ToLower()); + pageviewNotificationArgs.Template.SetTag("Global:LiveIntegration.IsLazyLoadingForProductInfoEnabled", Global.IsLazyLoadingForProductInfoEnabled(settings).ToString().ToLower()); } } } diff --git a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/NotificationSubscribers/VariantListBeforeRender.cs b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/NotificationSubscribers/VariantListBeforeRender.cs index d1ba415..c452a9a 100644 --- a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/NotificationSubscribers/VariantListBeforeRender.cs +++ b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/NotificationSubscribers/VariantListBeforeRender.cs @@ -48,7 +48,7 @@ public override void OnNotify(string notification, NotificationArgs args) private static bool CanCheckPrice(Settings settings) { - return EnabledAndActive(settings, SubmitType.Live) && settings.EnableLivePrices && + return settings.EnableLivePrices && EnabledAndActive(settings, SubmitType.Live) && (settings.LiveProductInfoForAnonymousUsers || Helpers.GetCurrentExtranetUser() != null) && (Helpers.GetCurrentExtranetUser() == null || !Helpers.GetCurrentExtranetUser().IsLivePricesDisabled) && !Global.IsProductLazyLoad(settings); diff --git a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Orders/LiveCartCalculationProvider.cs b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Orders/LiveCartCalculationProvider.cs index b5c3eca..a5089b7 100644 --- a/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Orders/LiveCartCalculationProvider.cs +++ b/src/Dynamicweb.Ecommerce.DynamicwebLiveIntegration/Orders/LiveCartCalculationProvider.cs @@ -17,10 +17,10 @@ public override bool CalculateCart(Order cart) var settings = SettingsManager.GetSettingsByShop(cart.ShopId); SubmitType submitType = SubmitType.LiveOrderOrCart; - if (Global.IsIntegrationActive(settings) && - Connector.IsWebServiceConnectionAvailable(settings, submitType)) + if (Global.IsIntegrationActive(settings)) { - if (Global.EnableCartCommunication(settings, cart.Complete)) + if (Global.EnableCartCommunication(settings, cart.Complete) && + Connector.IsWebServiceConnectionAvailable(settings, submitType)) { var contextCurrency = Context.Current?.Request?.GetString("CurrencyCode"); if (!string.IsNullOrEmpty(contextCurrency) && !string.Equals(cart.CurrencyCode, contextCurrency, System.StringComparison.OrdinalIgnoreCase))