Copied to clipboard

Flag this post as spam?

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


  • M N 109 posts 186 karma points
    Mar 12, 2018 @ 14:43
    M N
    0

    Fast Track Shipment Rate Step is skipped on Custom Basket Product

    Hey all,

    I'm on 2.5, and I have an angular app that is adding custom products (custom width, height, extra fields) for windows. I have a base product with a sku cust-product-sku

    Oddly enough, when I add those to the cart, and checkout, it skips right over the shipment step right to payment. I do have a normal shop and any of those items work fine, shipment step is resolved. Here is how I am adding custom windows -

            ExtendedDataCollection windowOptions = new ExtendedDataCollection();
    
            windowOptions.SetValue("material", window.material.name);
            windowOptions.SetValue("liteRows", window.rows.ToString());
            windowOptions.SetValue("litesColumns", window.cols.ToString());
            windowOptions.SetValue("windowType", window.windowstyle.type); // Sash, Transom, FixedTransom, OperatingTransom, FixedHopper, OperatingHopper, SingleHung
            windowOptions.SetValue("img", window.img);
    
            basket.AddItem(name, "cust-product-sku", window.orderQuantity, window.singlePrice);
    

    Anyone see any issue with the above? The "cust-product-sku" has no variant or content info.. it's just a dummy product that also holds the Price Per Square inch for the window type.

    Thanks! -Marc

  • Puck Holshuijsen 69 posts 285 karma points
    Mar 12, 2018 @ 14:52
    Puck Holshuijsen
    0

    is the product "cust-product-sku" shippable?

  • M N 109 posts 186 karma points
    Mar 12, 2018 @ 15:03
    M N
    0

    Thanks for your reply, Puck. Appreciate it.

    Unfortunately, yes. But I've set the SKU to something completely arbitrary and get the same result.

    I also thought those basket overloads were for situations like this where you don't want the basket line item tightly coupled with the Product or ProductVariant?

    options

  • Puck Holshuijsen 69 posts 285 karma points
    Mar 12, 2018 @ 15:32
    Puck Holshuijsen
    0

    Do you have shipping method(s) corresponding with the shipping country? Because it shouldn't be any problem the way you're using it.

  • M N 109 posts 186 karma points
    Mar 12, 2018 @ 15:43
    M N
    0

    I do indeed.. I wrote a Easy Post provider so I can use whatever shipping mechanism I need.

    Also, I just confirmed if I manually add a new product, and just tack all the user-driven fields as part of the Sku, like cus-sash-20-30 and then use the overload that accepts a product, it works fine, shipping step during checkout per usual. So this -

        string sku = "cus-" + window.type + "-" + window.width + "-" + window.height;
    
        IProduct product = productService.CreateProductWithKey(name, sku, window.singlePrice);
        product.TrackInventory = false;
        product.Shippable = true;
        product.Available = true;
        product.OnSale = false;
        product.Taxable = false;
        product.Weight = 10;
    
    var warehouse = warehouseService.GetDefaultWarehouse();
    var catalog = warehouse.WarehouseCatalogs.FirstOrDefault();
    product.AddToCatalogInventory(catalog);
    productService.Save(product, true);
    
    basket.AddItem(product, window.orderQuantity);
    

    I wish it was a top level setting.. Seems to be something wrong with those overloads, unless you can think of something more trivial?

    enter image description here

  • Puck Holshuijsen 69 posts 285 karma points
    Mar 13, 2018 @ 08:04
    Puck Holshuijsen
    0

    I can't see why it shouldn't work, but if your workaround works i would go with that.

    The only thing I would do (I think), is trying to get the product first based on the sku. If it already exists, you don't have to create a new one every time and risk adding the same sku (which results in an error).

    If it finds the Product, you can set the Price attribute with you window.singlePrice.

    Puck

Please Sign in or register to post replies

Write your reply to:

Draft