Copied to clipboard

Flag this post as spam?

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


  • Tito 314 posts 623 karma points
    Oct 08, 2015 @ 16:00
    Tito
    0

    Whats the correct aproach for this project?

    Hi there! at last i am going to start a project using Merchello :) Its an ecommerce site for a seller of car supplies and it has about 50.000 products organized by type, categories, brands, etc. I think about using Umbraco 7.3 and Merchello 1.13 with an SQL Server Express 2012 database. I have some questions:

    • How will it manage such a large amount of products?
    • I see the last version of Merchello manages products inside Merchello's backoffice. I was thinking about creating categories, brands, etc inside Umbraco content section and then, asign them in the Merchello product page via a Multinode tree picker. Is it correct? How could then query the products in a category or brand page?
    • I want to understand Merchello structure (Product, ProductVariant, Extended data, etc) but i cant see it clearly on the wiki pages and surfing on the Baazar code will take me ages. Is there an updated documentation or web site to getting introduced?

    Last year i translated Merchello's spanish language file but i see it is very outdated. As soon as i start with this project i will update it and make a pull request :D

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Oct 08, 2015 @ 16:43
    Rusty Swayne
    0

    @Tito

    I know people have used Mercchello with large number of products. Most queries are already paged.

    Merchello introduced collections in 1.11.0 and a collection picker in 1.12.0 which will allow you to manage things right in Merchello and then add the collections to content pages (categories).

    1.12.0 also introduced IProductContent (virtual IPublishedContent). The PropertyValueConverter for the collection picker, returns a IEnumerable

    I really appreciate the help on the translations!

  • Tito 314 posts 623 karma points
    Oct 09, 2015 @ 08:48
    Tito
    0

    Hi Rusty, I guess i can not use collections. I need to store information in each category, brand.. so its better to use umbraco content for this info.

    So i would need to create a tree content picker in the product document type. Then could i query products for a determined brand or supplier, etc from Merchello using de IProductContent and querying the tree content picker property? how? That would be slow? I think it is a need to relate merchello product to Umbraco content without using collections.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Oct 09, 2015 @ 19:31
    Rusty Swayne
    0

    @Tito - I am not quite following you here. Could you write up what your trying to do a bit more. I think there is probably a good solution ....

  • Tito 314 posts 623 karma points
    Oct 13, 2015 @ 13:05
    Tito
    0

    Hi Rusty.

    I need to create a tree like this on the content section:

    Categories      
          Category A
               -Subcategory A1
               -Subcategory A2
               -.....
           Category B
               -Subcategory B1
               -Subcategory B2
               -.....
    
    Brands
          - Brand A
                  -Model A1
                  -Model A2
          - Brand B
          -....
    

    Then, create a product document type with this properties:

       - Picture
       - Description
       -  Brand (content picker from brands)
       - Model (Content picker for the models)
       - Categories (Multinode tree picker for categories and subcategories, each product can be on multiple categories or  subcategories)
    

    In merchello i could use this product document type for the merchello product and a collection for each category (there will be 4 or 5) and i guess i could map the category content node with the collection guid. I could create each product under each collection. Then i could map each product with the subcategories, brands and models using the pickers.

    My question is, how could i search for products querying by category/subcategory, brand o or model? there will be a page for each brand listing the products under this brand. Note that under a category may be up to 25,000-30,000 products.

    How could i search for a product by name or description? i guess using examine?

    My client has sent me a csv file with the products so i have to programatically create each brand, model, product and map them all.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Oct 13, 2015 @ 16:07
    Rusty Swayne
    0

    Hey Tito,

    Collections are pretty versatile. You could also use a product collection for each of the sub-categories and add them to your category pages which could be either collections themselves or simply Umbraco content with have multiple collection pickers - so there would be no need to use pickers for this one. The MerchelloHelper.Query.Product has a get by collection which returns a paged set of results.

    You could use the Manufacturer field on the product for brand (assuming each product can be assigned to a single brand). If you can do this, the MerchelloHelper.Query.Product does have a search by manufacturer query which returns a paged set of results.

  • Tito 314 posts 623 karma points
    Oct 13, 2015 @ 16:24
    Tito
    0

    I need to store an image, description, etc for each category, subcategory, brand... Do collections, manufacturers, allow this? if not, i would have to create all the collections and subcollections, manufacturers on Merchello and then replicate this on the Umbraco content and relate them? it seems a lot of work and not very usable isnt it? I cant tell my client to create a manufacturer there and then in the umbraco content.. I think i can go for collections for the main categories that are not manageable but i guess the rest of subcategories, brands/models, create them in the content section and use the pickers... For query i could go with Chris solution? (retrieving paged results): https://our.umbraco.org/projects/collaboration/merchello/merchello/72029-querying-products-in-1120

  • Tito 314 posts 623 karma points
    Oct 14, 2015 @ 17:25
    Tito
    0

    Hi @Rusty, I am trying this out. Have an Umbraco 7.3 with Merchello 1.13 installed. I have created a product document type and created some products for testing. Then, I am trying the search as Chris posted:

     var products = merchelloHelper.Query.Product.Search(1, 10).Items
            .Select(x => (ProductDisplay)x)
            .Where(x => x.Available && x.DetachedContents.Any(y => y.CanBeRendered));
    

    I dont understand what DetachedContents is. I guess it is the content saved as the custom product document type? How can i retrieve the data to search for a property? How is it related to the new IProductContent?

    Also, i cant find any documentation about the Merchello helper, Queries, Search, IProductContent, ProductDisplay, DetachedContents... i have downloaded the Baazar source and search for that terms in the code but i am stucked on this.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Oct 14, 2015 @ 21:47
    Rusty Swayne
    0

    Hi Tito,

    I got the detached content idea from Nested Content. It is the way, Merchello associates property data with a product. What happens is, when IProductContent is constructed, the associated content type is looked up and the property values are filled in from a key value pair data (JSON) stored in the merchProductVariantDetachedContent table.

    So you want to return IProductContent, not ProductDisplay.

      var products = merchelloHelper.Query.Product.Search(1, 10).Items
                     .Select(x => ((ProductDisplay)x).AsProductContent());
    
  • Tito 314 posts 623 karma points
    Oct 15, 2015 @ 08:46
    Tito
    0

    Thanks Rusty.

    So i can get IProductContent as this:

    var products = merchelloHelper.Query.Product.Search(1, 10).Items
                 .Select(x => ((ProductDisplay)x).AsProductContent())
                 .Where(x=>x.Available);
    

    And i get the test products, but i can access to product.Name but if i try to get some custom property like:

    @foreach (var item in products)
    {
        <div>
            @item.Name
            @item.GetPropertyValue("descripcion")
        </div>
    }
    

    I get null in description, may be it is a language issue? how can i access property content for current culture language?

    By the way, is there any documentation out there about IProductContent, ProductContentFactory, MerchelloHelper, etc? I cant find it in the official documentation page.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Oct 15, 2015 @ 21:06
    Rusty Swayne
    0

    Tito - Unfortunately I am way behind on documentation, it is going to be my next big push =)

    I usually set the culture by handling an event in the ProductContentFactory

        protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {
    
            ProductContentFactory.Initializing += ProductContentFactoryOnInitializing;
        }
    
    
              /// <summary>
        /// Sets the parent of Merchello virtual product content to the Home node.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private static void ProductContentFactoryOnInitializing(ProductContentFactory sender, VirtualContentEventArgs e)
        {
            e.Parent = [Your root node];
        }
    
  • Tito 314 posts 623 karma points
    Oct 16, 2015 @ 09:52
    Tito
    0

    Thanks Rusty,

    I have put this:

    private static void ProductContentFactoryOnInitializing(ProductContentFactory sender, VirtualContentEventArgs e)
            {
                var umbracoHelper = new Umbraco.Web.UmbracoHelper(Umbraco.Web.UmbracoContext.Current);
                e.Parent = umbracoHelper.TypedContentAtRoot().First();
            }
    

    But i cant retrieve a custom property, it still gets null. Edit: i see the english version of the property, but home node is set as spanish

    @{
    var products = merchelloHelper.Query.Product.Search(1, 10).Items
                     .Select(x => ((ProductDisplay)x).AsProductContent())
                     .Where(x=>x.Available);
    }
        @foreach (var item in products)
        {
            <div>
    @*Merchello property*@
                @item.Name
    @*Custom property from document type*@    
                @item.GetPropertyValue("descripcion")
            </div>
        }
    
  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Oct 20, 2015 @ 16:08
    Rusty Swayne
    0

    Can you check the umbracoLanguage table and see what the language culture name is? It may be it does not match the name associated in the merchProductVariantDetachedContent table.

    There is an extension method on IProductContent "SpecifiyCulture" maybe try that?

  • Tito 314 posts 623 karma points
    Oct 21, 2015 @ 09:41
    Tito
    0

    The language iso code is es-ES and the culture name "Spanish (Spain)" The culture name in merchProductVariantDetachedContent is es-ES. I guess you are comparing it to culture name in umbracoLanguage table and should be compared to languageISOCode column instead.

    item.SpecifyCulture("es-ES") works ok to retrieve the language, but i think the first option is the correct to not specify the culture each time and automatically take the current culture (ie for searching inside the items in a query)

  • skp 12 posts 80 karma points
    Dec 17, 2018 @ 06:00
    skp
    0

    I am new in Merchello, and I want to use multi languages and multiple currencies in Merchello, Could you please help me.

  • Tito 314 posts 623 karma points
    Dec 18, 2018 @ 09:53
    Tito
    0

    Hi there. In my ecommerce projects i mostly use Merchello only for storing products sku and prices. I have my own structure of Umbraco nodes for the content and for each product i create a Merchello product automatically using the Umbraco saving event.

    This way you manage different languages as you do usually in Umbraco. I personally use Vorto package for this.

    For multicurrency i dont have done it with Merchello, and think it does not manage it. I would change the price on the fly. For instance, i would store prices in euros and if currency is dollar i would calculate this on the fly for the frontend. You will have to code your own frontend logic and use Merchello for backoffice and modify the notification provider, the basket and checkout logic.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Oct 21, 2015 @ 15:47
    Rusty Swayne
    0

    Thanks Tito,

    I agree, you should not need to specify the culture on each item.

    I'll have to go back and double check that the languageISOCode column is being used - it should be.

  • Marco Teodoro 2 posts 71 karma points
    Sep 02, 2017 @ 09:42
    Marco Teodoro
    0

    Hi Tito, i've the same problem with culture. How did you solve it exactly? does't metter if i'm open a slug for PT or for en at the end the culture is always EN.

Please Sign in or register to post replies

Write your reply to:

Draft