Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>10.4.34</Version>
<Version>10.4.35</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Title>Live Integration</Title>
<Description>Live Integration</Description>
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"]))
Expand All @@ -46,6 +48,6 @@ public override void OnNotify(string notification, NotificationArgs args)
Context.Current.Items["IsWebServiceConnectionAvailable"] = isWebServiceConnectionAvailable;
Context.Current.Items["IsLazyLoadingForProductInfoEnabled"] = isLazyLoadingForProductInfoEnabled;
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Loading