• alexdebeer

    (@alexdebeer)


    Hello,

    We have a custom backend system separate from our WordPress/WooCommerce backend, which handles orders. We are looking to implement a feature that allows us to update product information from our custom backend directly into the WooCommerce system.

    Typically, product updates can be performed by calling the WooCommerce API endpoint for the specific product and providing the necessary data. For example, updating the product name and price can be done as follows:

     $this->client->post(
    'products/1191116',

    [
    'name' => 'update123',
    'price' => '100.25',
    ]
    );

    However, we also need to update the tiered pricing rules for our products, which isn't as straightforward. The desired format for tiered pricing is as follows:

    $this->client->post(
    'products/1191116',

    [
    'name' => 'update123',
    'price' => '100.25',
    'tiered_pricing_fixed_rules' => [
    '2' => '10',
    '3' => '9',
    '5' => '8',
    '10' => '7',
    '25' => '6'
    ]
    ]
    );

    Could you please guide us on how to properly structure the data for tiered_pricing_fixed_rules when making a request to the WooCommerce API?

    Thx!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author WP Developer

    (@bycrik)

    Hello @alexdebeer,

    We are currently working on the new API for our plugin to be compatible with the new WooCommerce react-based product editor. This API will be also available for 3rd-party usage.

    The new plugin version will be available in 1-2 months.

    Currently, you can update this value as a regular meta field. Here is the documentation from WooCommerce: https://woocommerce.github.io/woocommerce-rest-api-docs/#product-meta-data-properties

    Fixed rules is stored under the “_fixed_price_rules” meta key and contains an array where keys are quantity and values are prices.

    I hope this helps.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.