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]
- How to add fee_lines using woocommerce rest API v3?
- Update a server-side render Block when woocommerce cart block changed
- Woocommerce add extra field to variation product
- single-product.php template not working for single products [closed]
- How to execute a javascript function just before saving a woocommerce post or a post?
- Change Meta Title seperator and remove on homepage
- WooCommerce Description and Short Description tags removal
- Woocommerce 2.5.5 get billing email from order instance
- Woocommerce products are not displayed on front-end . No products were found matching your selection [closed]
- Custom Text on Product Page based on Shipping Class [closed]
- Shipping Location based on IP (Geolocation)
- How to set a minimum length for username in Woocommerce? [closed]
- How to get term name with link for specific ids
- woocommerce “publish “”product”” webhook
- Creating woocommerce product using WordPress REST API
- Image is not displayed in overridden woocommerce email
- remove categories from product
- woo commerce get all orders item given category
- Add Stripe Connect data to wc_stripe_payment_request
- WooCommerce get default shipping rate & conditions
- Using WooCommerce for payments only?
- Programatically Remove Item from Cart Not Working – Needs Page Refresh
- Set default value field meta_Value [closed]
- WooCommerce Cart Link based on Cookie Values
- woocommerce – customise notice error in checkout page
- Woocommerce, prevent login after registration and redirect to custom URL
- How to add product filter dropdown in woo commerce order page?
- Unable to paste google analytics con header.php [closed]
- Add Attribute to Woocommerce programatically, doesn’t display front end [closed]
- Woocommerce – Add additional item if some item wants to be added to the cart?
- Hook “wp_trash_post” executing multiple time in case of bulk trash products
- WooCommerce Subscriptions: Hide one variation subscription
- Contact form 7 send product PDF after submit
- Add sub variations in product page
- Woo commerce product quantity wise SKU
- Override une fonction dans une class Woocommerce
- What to do if images are not displayed in mob. versions of the online store on wordpress?
- validation field form registration vendor dokan woocommerce
- Delete unpublished woocommerce products
- List of JS events in the WooCommerce frontend
- Redirecting orders by company field
- WooCommerce Product Search box with 3 dropdown menus
- Split taxonomies on different pages
- woocommerce REST api on the website’s front-end
- How can I change field values of posts before displaying
- How to customize product at cart page
- WooCommerce Storefront site-header padding
- How to check which shortcode is using my template?
- woocommerce: when adding or removing items to cart , it takes cart a few seconds to read changes?
- How to get woocommerce integration instance?
- Create woocommerce order on new user registration
- Redirect whole website or pages to /wp-admin in wordpress
- Product atributes in title of order (not in description)
- How to create custome pdf file of my invioice in wordpress
- How to get sub items of parent menu item?
- WordPress and WooCommerce How to Assign Attribute Based Pricing
- Storefront Child Theme show product attribute [closed]
- Critical error on woocommerce checkout page
- Optimizing or rewriting core queries