-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from umbraco/feature/shopify-v9-multi-target
Shopify Property Editor multi-targeted & V9 test site
- Loading branch information
Showing
33 changed files
with
980 additions
and
263 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/Umbraco.Cms.Integrations.Commerce.Shopify/Configuration/ShopifySettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Collections.Specialized; | ||
|
||
namespace Umbraco.Cms.Integrations.Commerce.Shopify.Configuration | ||
{ | ||
public class ShopifySettings | ||
{ | ||
public ShopifySettings() | ||
{ | ||
|
||
} | ||
|
||
public ShopifySettings(NameValueCollection appSettings) | ||
{ | ||
ApiVersion = appSettings[Constants.UmbracoCmsIntegrationsCommerceShopifyApiVersion]; | ||
Shop = appSettings[Constants.UmbracoCmsIntegrationsCommerceShopifyShop]; | ||
AccessToken = appSettings[Constants.UmbracoCmsIntegrationsCommerceShopifyAccessToken]; | ||
} | ||
|
||
public string ApiVersion { get; set; } | ||
|
||
public string Shop { get; set; } | ||
|
||
public string AccessToken { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/Umbraco.Cms.Integrations.Commerce.Shopify/Editors/ShopifyProductPickerConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
...raco.Cms.Integrations.Commerce.Shopify/Editors/ShopifyProductPickerConfigurationEditor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
using Umbraco.Core.PropertyEditors; | ||
#if NETCOREAPP | ||
using Umbraco.Cms.Core.IO; | ||
using Umbraco.Cms.Core.PropertyEditors; | ||
#else | ||
using Umbraco.Core.PropertyEditors; | ||
#endif | ||
|
||
namespace Umbraco.Cms.Integrations.Commerce.Shopify.Editors | ||
{ | ||
public class ShopifyProductPickerConfigurationEditor: ConfigurationEditor<ShopifyProductPickerConfiguration> | ||
{ | ||
#if NETCOREAPP | ||
public ShopifyProductPickerConfigurationEditor(IIOHelper ioHelper) : base(ioHelper) | ||
{ | ||
} | ||
#endif | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
src/Umbraco.Cms.Integrations.Commerce.Shopify/Editors/ShopifyProductPickerValueConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 15 additions & 1 deletion
16
src/Umbraco.Cms.Integrations.Commerce.Shopify/Helpers/HtmlHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,31 @@ | ||
using System.Collections.Generic; | ||
|
||
#if NETCOREAPP | ||
using Microsoft.AspNetCore.Html; | ||
using Microsoft.AspNetCore.Mvc.Rendering; | ||
using Microsoft.AspNetCore.Mvc.ViewFeatures; | ||
#else | ||
using System.Web; | ||
using System.Web.Mvc; | ||
using System.Web.Mvc.Html; | ||
#endif | ||
|
||
using Umbraco.Cms.Integrations.Commerce.Shopify.Models.ViewModels; | ||
|
||
namespace Umbraco.Cms.Integrations.Commerce.Shopify.Helpers | ||
{ | ||
public static class ShopifyHtmlExtensions | ||
{ | ||
public static IHtmlString RenderProductsList(this HtmlHelper htmlHelper, List<ProductViewModel> vm) | ||
#if NETCOREAPP | ||
public static IHtmlContent RenderShopifyProductsList(this HtmlHelper htmlHelper, List<ProductViewModel> vm) | ||
{ | ||
return htmlHelper.Partial($"{Constants.AppPluginFolderPath}/Render/Products.cshtml", vm); | ||
} | ||
#else | ||
public static IHtmlString RenderShopifyProductsList(this HtmlHelper htmlHelper, List<ProductViewModel> vm) | ||
{ | ||
return htmlHelper.Partial($"{Constants.AppPluginFolderPath}/Render/Products.cshtml", vm); | ||
} | ||
#endif | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Umbraco.Cms.Integrations.Commerce.Shopify/Resources/LoggingResources.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
| ||
namespace Umbraco.Cms.Integrations.Commerce.Shopify.Resources | ||
{ | ||
public class LoggingResources | ||
{ | ||
public const string AccessTokenMissing = "Cannot access Shopify - Access Token is missing."; | ||
|
||
public const string FetchProductsFailed = | ||
"Failed to fetch products from Shopify store using access token: {0}"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.