H
H
Httdientee2021-12-08 18:45:53
WordPress
Httdientee, 2021-12-08 18:45:53

Problem with woocommerce variation?

I am currently working with the WP ALL IMPORT plugin, everything is fine except for one, I have two attributes transferred differently (one is taken from csv and the second for each product is a list from the function (that is, csv does not have this data) I do them through the function and pass it to the import) - the plugin copes with this, everything is transferred BUT
For some reason, the attribute that I make through the function is not shown on the product page until I go to the product settings in the admin panel and in the variations tab I'll click save changes, after these steps everything appears and works as it should. I started looking for some functions that will do the same as the button does - saves variations, all I found

WC_Meta_Box_Product_Data::save_variations( $product_id, get_post( $product_id ) );

- Not suitable for the reason that a post request is needed here along with some other necessary parameters in it, maybe there is some kind of plugin? Ready solution, can someone tell me?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP Panda, 2021-12-08
@wppanda5

Add to your function after setting the attributes
wc_delete_product_transients( $product_id );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question