Copied to clipboard

Flag this post as spam?

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


  • Jakob Pless 20 posts 60 karma points
    Apr 29, 2015 @ 12:39
    Jakob Pless
    0

    Edit main product price

    When we have products with variants how do we edit the "base" price of the main product the variants are derived from?

  • Jason Prothero 422 posts 1243 karma points c-trib
    Apr 29, 2015 @ 17:32
    Jason Prothero
    0

    All products have a Product Variant record to hold their price, sku, inventory, etc.  A product with no options still has one variant.  So when you create options on a product that variant simply turns into one of the variants.  So there is no "base product" or "base variant" when options are used.

    Does that help / make sense?

     

    Thanks,
    Jason

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Apr 29, 2015 @ 18:21
    Rusty Swayne
    0

    Jakob is talking about the master variant (which is a product without variants). This is used as the model to construct new variants to populate information.

    We don't have a UI to edit those at the moment - never thought of it - but you're right it would be a good addition. What do you think about adding it to the existing bulk actions dialog ...

    Through code it is pretty straight forward:

     var productService = MerchelloContext.Current.Services.ProductService;
    
     var product = productService.GetByKey(key);  
    
     product.Price = 10M;  // this updates the price on the main product
    
     productService.Save(product);
    
Please Sign in or register to post replies

Write your reply to:

Draft