Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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("windowType", window.windowstyle.type); // Sash, Transom, FixedTransom, OperatingTransom, FixedHopper, OperatingHopper, SingleHung
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.
is the product "cust-product-sku" shippable?
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?
Do you have shipping method(s) corresponding with the shipping country? Because it shouldn't be any problem the way you're using it.
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();
I wish it was a top level setting.. Seems to be something wrong with those overloads, unless you can think of something more trivial?
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.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted