• Resolved philipatnedi

    (@philipatnedi)


    When a customer places an order with a product, (SKU123), the initial order is processed just fine. If the customer selects the product for Autoship an order will be generated automatically in 4 weeks with the same product. The issue is that we need to identify the product differently than the first order when it comes to inventory. Any subsequent orders placed with Autoship, every 4 weeks, need to identify the product as (SKU123REFILL) instead of (SKU123).

    The SKU isn’t currently being placed into the order as data – it looks like it’s being retrieved based on the product id. First can someone confirm that’s what WooCommerce does by default. Second is there a way that we can save this new sku, (SKU123REFILL), with the order in such a way that other attempts to retrieve this data will show the new sku? We are using DEAR to manage inventory which uses the Woo API to get at the JSON data.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    Hey there!

    This sounds like you are using the WooCommerce Subscriptions plugin, which is supported by the team at Prospress that makes it. With your license, you get the ability to submit a ticket directly to them from your WooCommerce.com account and they’ll be able to help you further – here’s how: ?https://woocommerce.com/my-account/create-a-ticket/?form=ticket

    Thread Starter philipatnedi

    (@philipatnedi)

    Hey there, Andrew!

    Thanks for responding back! We are actually using Autoship Cloud, (https://autoship.cloud/), to handle the subscriptions.

    My first question is just about how base WooCommerce processes orders – if it saves the SKUs with the order or if it just retrieves it based on product. I can’t find any meta or any other field to indicate that the SKU is actually saved with the order.

    My second question is if there’s a way in WooCommerce to override/change this SKU on order and not actually change the SKU for the product.

    Plugin Support Ryan Ray, a11n

    (@ryanr14)

    Hi @philipatnedi,

    My first question is just about how base WooCommerce processes orders – if it saves the SKUs with the order or if it just retrieves it based on product. I can’t find any meta or any other field to indicate that the SKU is actually saved with the order.

    I’m not 100% certain, but I believe the order pulls in the SKU based on the product(s) in the order. So it’s likely not something that is saved as ordermeta, rather pulled in with something like the snippet below.

    foreach ($order->get_items() as $item) {
        $product = wc_get_product($item->get_product_id());
        $item_sku[] = $product->get_sku();

    That then says to me it’s likely the Autoship extension gets a product for the next recurring order but doesn’t also use get_sku() in that order for said product(s).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Product SKU in WooCommerce Order’ is closed to new replies.