I'm trying to combine Merchello with Peta Poco and UI-O-Matic. What I really want, is use the Merchello Product Picker for my Peta Poco / UI-O-Matic model.
My current code:
[UIOMaticField(
Name = "Product",
Description = "A product.",
View = "~/App_Plugins/Merchello/propertyeditors/productpicker/merchello.productselector.html")]
public string Product { get; set; }
using Merchello.Web;
using Merchello.Web.Models.ContentEditing;
using Merchello.Web.Models.VirtualContent;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi;
namespace CaranteGroep.Catalog.Plender.WebApplication.App_Plugins.CustomMerchelloPicker
{
[PluginController("CustomMerchelloPicker")]
public class CustomMerchelloPickerApiController : UmbracoApiController
{
public IList<CustomMerchelloPickerProduct> GetAll()
{
var merchello = new MerchelloHelper();
var products = merchello.Query
.Product
.Search(1, int.MaxValue)
.Items
.Select(i => GetSmallObject(merchello.Query.Product.TypedProductContent(((ProductDisplay)i).Key)))
.Where(p => (p.Type == "ftProduct"))
.ToList();
return products;
}
protected CustomMerchelloPickerProduct GetSmallObject(IProductContent product)
{
var temp = new CustomMerchelloPickerProduct
{
Key = product.Key.ToString(),
Name = product.Name,
Type = product.DocumentTypeAlias
};
return temp;
}
}
public class CustomMerchelloPickerProduct
{
public string Key;
public string Name;
public string Type;
}
}
Umbraco with Merchello and Peta Poco (UI-O-Matic)
Hey everyone!
I'm trying to combine Merchello with Peta Poco and UI-O-Matic. What I really want, is use the Merchello Product Picker for my Peta Poco / UI-O-Matic model.
My current code:
What I'm getting (which doesn't do anything):
Does anyone have any idea what could work?
For anyone curious as to how a tackled this: I made a Custom Editor View
/App_Plugins/CustomMerchelloPicker/Package.manifest
/App_Plugins/CustomMerchelloPicker/CustomMerchelloPickerApiController.cs
/App_Plugin/CustomMerchelloPicker/CustomMerchelloPicker.js
/App_Plugin/CustomMerchelloPicker/CustomMerchelloPicker.html
On the Peta Poco model
is working on a reply...