This took me a while but i’ve been able to solve this issue through writing in the database directly so i’d share my solution here for others if anyone comes across the same problem.
To get the attributes selected automatically when creating the variations, 2 things need to happen in the database. The variation post title needs to be adjusted in the form of “product-name variation-name”. The second part is adding a new postmeta with the key “attribute_pa_taxonomy” and the meta value being the slug of the selected attribute.
Changing these 2 things in the database directly will assign the selected attribute correctly in the backend overview.
$wpdb->query("UPDATE {$wpdb->prefix}posts SET post_title="$product->name $single_paper" WHERE ID = $id");
$wpdb->query("INSERT INTO {$wpdb->prefix}postmeta(`post_id`, `meta_key`,
`meta_value`) VALUES ('$id', 'attribute_pa_papiersoort', '$slug')");
Related Posts:
- WooCommerce: Can’t use wc_get_products for custom REST API endpoints
- Process checkout using WC REST API
- How to build a plugin that supports authenticated POST requests to the REST API from external servers?
- Extend Woocommerce rest api routes fails
- How to filter Post using Meta Data REST API
- How to stop a Gutenberg Block from firing multiple GET Requests?
- Output JSON object with woocommerce products
- Problem with cURL and rest API
- Woo API REST : product variation price is read-only?
- Category Tree In WooCommerce Product API
- How to upload Woocommerce product images via API? [closed]
- How to handle Woocommerce API credentials
- What will make Woocommerce REST API to issue 401 [closed]
- Woocommerce custom endpoints
- Woocommerce REST API – updating an order changes custom tax calculations
- Woocommerce Rest Api Categories problem [closed]
- API returns blank response after installing & uninstalling WP-rest-api plugin
- woocommerce axios react
- Get specific values in Woocommerce Rest API
- wc_get_products() not return the images details
- WooCommerce – Add product with image via REST API
- Tax are not showing on order while placing order with REST API
- JWT on Woocommerce cannot work with “Customer” role user
- Woocommerce REST API – add filter to set maximum query per page for product brands [closed]
- WooCommerce – Create multiple product tags via rest api endpoint
- Using the WordPress and WooCommerce REST APIs in the same Node app
- Retrieve Data from Custom Endpoint
- How to solve `Error getting remote image` in woocommerce rest api script?
- Getting in an exception for get product detail by id in woocommerce REST api
- Impossible to create a new WooCommerce customer using Rest API
- Woocommerce API security concerns
- How can I send information when a order is completed to my own POS?
- Woocommerce Rest API: woocommerce_product_invalid_image_id
- WC Booking query bookings with date ranges
- “error_message”: “Sorry, you cannot list resources.” using WooCommerce API
- Woocommerce REST API not considering discounts and coupons
- WooCommerce REST API endpoints don’t exist
- Fetch products with filter by similar categories at same time
- Send data to external websites when there is an update or create a post
- Auto generating API keys using the Application Authentication Endpoint [closed]
- GET woocommerce order request is not showing meta data [closed]
- Optimizing Woocommerce order items query
- WooCommerce Template overriding not working with woocommerce.php
- How do you add a custom function to add / update product?
- Is there a Woocommerce hook that fires when applying a coupon but before checking if it’s valid?
- How to search Woo Commerce products with punctuation in title?
- How to unhook a function in Woocommerce Template?
- Disable Woocommerce product tags display by alphabetical order
- Hide Price on one specific Woocommerce Single Product page [closed]
- Woocommerce and Pricing deals plugin total price update with AJAX
- Send a value to woocommerce with a button type submit
- Breadcrumbs on Product Page Always Show Wrong Product [closed]
- Modify SKU for display on product page
- Permalinks contain unwanted space resulting in broken links
- WP_Query with meta_query for children
- Woo commerce+ Stripe – How to associate one account per currency [closed]
- Adding product info for printing to custom Woocommerce Product Display tab [closed]
- Add shipping address to Woocommerce order emails [closed]
- A function to add arguments to a taxonomy
- WC_Customer delete function returns error
- add sub subpage endpoint to woocommerce plugin my-account section
- how to change the “return to shop” button text? [closed]
- Problem while adding the variable product woocommerce
- How do I create a filter to hide the One Click Accessibility plugin button in WordPress?
- customers are not showing up in woocommerce
- Woocommerce : How to automatically input the same email for every order?
- Woocommerce – Change order of products in Confirmed Order
- echo product parent category
- How to edit wc_get_template_part for archive products
- Switch to user link shortcode
- Display WooCommerce product attribute on shop page
- How to get product category ID based on post?
- Jump to Footer On Scroll – Woocommerce Pages Phones Only
- WordPress Development Workflow
- Woocommerce redirection product_name -> product_cat/product_name
- Custom account page that accepts a query parameter
- Custom WooCommerce template for product
- Checkout fr Woocommerce – load default WooCommerce checkout template on the fly
- Loop Through Current Woocommerce Product Categories Sub Categories
- Two types of product categories on shop page
- Remove username and account password field from checkout page
- HTTP Error when uploading pictures and problem with the size of images
- add_rewrite_rule() returns 404 page
- customize src attribute in woocommerce single product image
- How to tell woocommerce slider to use thumbnails
- Add customer name to woocommerce email-header.php heading
- woocommerce sort by dropdown styling
- Mysql query – amount spent by customer
- Integration widget Mondial Relay Js
- Custom Registration Fields woocommerce
- How Do I Access Parameters Emitted by an Action?
- bulk media crop for featured images
- WooCommerce set specific currency on site shop
- WooCommerce shop, my account, cart every page redirect to home page [closed]
- Include customer details in woocommerce 3rd part plugin email
- how to add a page to a plugin?
- Unable to get product category
- How to change “reply to” email address for specific Woocommerce products
- Woocommerce API REST search by multiple keywords
- woocommerce change tax rate with checkbox