• Resolved jviure

    (@jviure)


    Hi people! I am fighting with a rest problem. I ve an script that ve to update stocks of a woocommerce. Simple product there is no problem but variation products.. I can’t update them, I ve this:

    
    ...
        $is_variation = $product instanceof WC_Product_Variation;
    
        $data = [
            'id' => $product->id,
            //'regular_price' => $search_item['price'],
            'stock_quantity' => $units,
            'manage_stock' => true
        ];
    
        if($is_variation){
            $result = $woocommerce->put('products/'.$product->parent_id.'/variations/'.$variation_id, $data);
        }
    ...
    

    Can someone help me in this? thanks! ??

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘api update variation’ is closed to new replies.