Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Calvin Frei 106 posts 314 karma points
    May 04, 2015 @ 09:32
    Calvin Frei
    1

    Some questions before using Merchello for production

    Hi Merchello-Team

    We have some questions which we have to clarify before we want to use Merchello for a production website.

    We tweeted Rusty about our main question: https://twitter.com/rustyswayne/status/593907457715351552

    The problem is, that our customer has over 10'000 products. And if there is only a "Merchello Product Selector"-Datatype we think it gets really messy.

    For example, when the customer creates a new product and has to find it just with a filter input-field in this large list of products. Or when the customer edits the node in the content-section and wants to edit the product as well there is no "jump-to-merchello-product" button. A jump to product button would be useful, or even better a bi-directional control (In this case it would be possible to implement ourselves, but I am giving you an example of the problem).

    Do you have any suggestions how we should handle 10'000+ products, is there a production Merchello-Website with this many products, or do you think Merchello is not made for this many products?

    In Rusty's tweet he talks about adding properties to the product. Is there a date when we can expect this feature? Can you confirm that there will be a migration strategy?

    What are your plans for "Product Listing" in the future. Will you introduce product categories or some other way to structure the products?

    Thank you
    Calvin

  • Eidos 44 posts 66 karma points
    May 04, 2015 @ 17:36
    Eidos
    0

    You can use some external database tables.

    In this way you can use your catalog (with your categories and filter) and attach merchello product for e-commerce activities.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    May 04, 2015 @ 19:33
    Rusty Swayne
    0

    I totally agree that the Merchello Product Selector gets really messy when you get beyond even a few hundred products. However, adding custom properties to a product is not quite as simple as it seems it should be, especially as you start considering the variants and multilingual aspects.

    This update is a ways off as there is a lot of work to be done in order to get it in there correctly - so I'm hoping for the end of summer "ish"

    I've been looking at both the ArcheType and Nested Content packages as inspiration and have identified that we need some properties to be shared across all variants whilst others optionally particular to individual variants. Example, a description may be common and media might be unique.

    There is also a need to create the notion of a "ProductType" that can be associated with a product so that the association between a property set/group can be made once and not have to be defined per product. At the same time, it makes sense that this would be a good time to look at sharing options between various products so that they did not have to be created on every product - (this is mainly UI work and testing though). We will also need to consider the inefficiency of creating an variant for every option as there will be a lot more "noise data" as another community member has put it =) I totally agree.

    Rendering the information will need to be handled differently as we will no longer have a content node per se. The plan here is to introduce the concept of ProductGroups where products can be associated with one or more groups. I'm hoping to then create a Merchello Product Group selector that will then be placed on a content node. Products associated with that group should then be able to be created as virtual content referenced via a product group product list ...

    I still need to work out this best place to generate the virtual content. As a child node of the product group, one would think we'd wind up with duplicate content issues if the product was in more than one group. If we were to assign a particular (singular) place to load the product page, we have additional configurations that would need to be done and thus potentially make things more complicated. There is a balance there somewhere - and I'm certainly open to suggestions.

    Finally, I'd love help with this as well so anyone who has time available and wants to contribute the help would certainly be appreciated.

  • Calvin Frei 106 posts 314 karma points
    May 05, 2015 @ 13:57
    Calvin Frei
    0

    Thank you Rusty for your answer.

    Everything is easier said than done ;-).
    Is there a way we (all) can talk/define/brainstorm about this implementations? We are happy to help you and work with you on this problem. But we don't want to make random pull requests when we have no idea of your long term goals for this project.

    If we are honest, our questions are more about the usability side - but its hard to explain to the customer that he has to create the product twice.

    We would really like to use Merchello and we found a solution this morning to make it easier for our customer.
    Basically we added a sku and price property to the node. Then in the Publishing event we create a product and store the key into the "Merchello Product Selector" property.

    Something like:

    void ContentService_Publishing(IPublishingStrategy sender, PublishEventArgs<IContent> e)
    {
        foreach (IContent content in e.PublishedEntities)
        {
            try
            {
                if (content.ContentType.Alias.Equals(Core.Constants.DocTypeAlias.Product))
                {
                    IProduct product = _productService.CreateProduct(content.Name, content.GetValue("sku"), content.GetValue("price"));
    
                    _productService.Save(product);
    
                    content.SetValue("merchelloProduct", product.Key.ToString());
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error<ContentEvents>("Error publishing product", ex);
            }
        }
    }
    

    I know there are some extra checks missing (e.g. create product only if the values are not null, check if product exists, ...) but it works really well.
    At the end our cusomer has to create the product once and can edit all necessary properties in the same view (except variants, but these will be created once).

  • Biagio Paruolo 1619 posts 1912 karma points c-trib
    May 18, 2015 @ 19:56
    Biagio Paruolo
    0

    Could you made an example?

  • Calvin Frei 106 posts 314 karma points
    May 19, 2015 @ 08:32
    Calvin Frei
    0

    @Biagio, can you clarify, what do you want an example of? Do you not understand the "ContentService_Publishing" example I gave above?

  • Biagio Paruolo 1619 posts 1912 karma points c-trib
    May 19, 2015 @ 08:55
    Biagio Paruolo
    0

    I don't understand because you need to made double product. Why?

  • Calvin Frei 106 posts 314 karma points
    May 22, 2015 @ 11:49
    Calvin Frei
    0

    @Biagio It's because Merchello has it's own database. That means you have to create a node save and publish it, go to merchello create a product go back to the node and assign the Merchello product.

    That's why I created the Save and Publish event. So it creates a Merchello product for you and assigns it "automatically".

  • Biagio Paruolo 1619 posts 1912 karma points c-trib
    May 22, 2015 @ 12:48
    Biagio Paruolo
    0

    That is Merchello has this "not UX friendly" mode to create product. Is't right? I think that this is a base error, I try to think what a potential customer says...

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    May 24, 2015 @ 07:01
    Rusty Swayne
    0

    @Biagio - I do understand that the product entry can be cumbersome with a lot of products =) As mentioned above in this thread there are plans to refactor things to better handle the product to content relationship. The multi-lingual aspects of the implementation still need some consideration. Also, we cannot not break any current implementations with the refactor...

    I know some people have gone ahead and extended the ProductVariant with their own table, something to consider if it's a deal breaker for your client.

  • Biagio Paruolo 1619 posts 1912 karma points c-trib
    May 24, 2015 @ 09:18
    Biagio Paruolo
    0

    Uhm...I wish to use Merchello for incoming two ecommerce websites...one is small , but other is big...and I cannot says to customer put in product here and here...

  • Pantelis 53 posts 107 karma points
    May 27, 2015 @ 10:47
    Pantelis
    0

    @Calvin, hi do you mind sharing where exactly you reference ProductService?

    When I reference the ProductService in the event handler's constructor I get a null reference exception. When I reference it inside my Publishing/Saved event then I have no issues.

  • Calvin Frei 106 posts 314 karma points
    May 27, 2015 @ 11:49
    Calvin Frei
    0

    @Pantelies: I do it in a separate class (the ProductService is set in the ApplicationStarted method):

    This is the class:

    public class ProductWorkflow
    {
    
        private readonly IProductService _productService;
    
        public ProductWorkflow(IMerchelloContext merchelloContext)
        {
            _productService = merchelloContext.Services.ProductService;
        }
    
        public Guid CreateOrUpdateProductAndReturnKey(IContent content)
        {
            if (content.HasProperty("merchelloProduct") &&
                content.HasProperty("sku") &&
                string.IsNullOrWhiteSpace(content.GetValue<string>("sku")) == false)
            {
                string sku = content.GetValue<string>("sku");
                decimal price = content.GetValue<decimal>("price");
                string name = string.Format(CultureInfo.InvariantCulture, "{0} ({1})", content.Name, sku);
    
                return CreateOrUpdateProductAndReturnKey(name, sku, price);
            }
            else
            {
                throw new ArgumentNullException("The document type missing some properties to create a merchello product!");
            }
        }
    
        private Guid CreateOrUpdateProductAndReturnKey(string name, string sku, decimal price)
        {
            IProduct product = _productService.GetBySku(sku);
    
            if(product == null)
            {
                product = _productService.CreateProduct(name, sku, price);
            }
            else
            {
                product.Price = price;
            }
    
            _productService.Save(product, false);
    
            return product.Key;
        }
    }
    

    Here I use it in the event:

    public class ContentEvents : ApplicationEventHandler
    {
        ProductWorkflow _productWorkflow;
    
        protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {
            ContentService.Publishing += ContentService_Publishing;
    
            _productWorkflow = new ProductWorkflow(MerchelloContext.Current); // Here is the answer for your question
        }
    
        void ContentService_Publishing(IPublishingStrategy sender, PublishEventArgs<IContent> e)
        {
            foreach (IContent content in e.PublishedEntities)
            {
                try
                {
                    if (content.ContentType.Alias.Equals(Core.Constants.Conventions.DocTypeAlias.Product))
                    {
                        Guid productKey = _productWorkflow.CreateOrUpdateProductAndReturnKey(content);
    
                        if (productKey == null) continue;
    
                        content.SetValue("merchelloProduct", productKey.ToString());
                    }
                }
                catch (Exception ex)
                {
                    LogHelper.Error<ContentEvents>("Error publishing product", ex);
                }
            }
        }
    }
    
  • Biagio Paruolo 1619 posts 1912 karma points c-trib
    May 27, 2015 @ 15:32
    Biagio Paruolo
    0

    So, you create a node into content tree and the you create merchello product into merchello section by your code. Do you return into content code if you change some product info or associate a variant? 

    Why Do not create a product node into content when I create a Merchello product + plus variant? 

    Is't possible to list catalogs and products without create them into content?

    Some problem:

     - the content node name may be different from Merchello product

    -  manufacturer: better if will be a Merchello section for manufacturer and a drill down into product

    Is't a 

    This is a big problem for Merchello bost and to use it for eshop with a lots products.

  • Pantelis 53 posts 107 karma points
    May 28, 2015 @ 15:22
    Pantelis
    0

    @Calvin, ahh I see :-) I must tell you your code helped me extremely and I appreciate so much you sharing it publicly! Thank you!

    I have one more little thing (probably for Rusty), I don't know if you faced it, but is there a way to prevent a user from deleting products in Merchello?

    Thanks again!

  • Pantelis 53 posts 107 karma points
    May 28, 2015 @ 15:32
    Pantelis
    0

    @Biagio, yes this is what the code does, create a merchello product and link it to the node. Requiring a product is merchello's application design choice (discussed here in the past). All the other things you want like listings and manufacturer's filters are possible using umbraco only.

  • Biagio Paruolo 1619 posts 1912 karma points c-trib
    May 28, 2015 @ 23:12
    Biagio Paruolo
    0

    For Manufacter association: now, must be write the manufacter into the field of the product. How to use a drill down? I think that into Umbraco, must be create a datatype "manufacter" and then associate to product datatype, but product datatype is not accessible by backoffice 

Please Sign in or register to post replies

Write your reply to:

Draft