Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- debug_object(get_post_meta(get_the_ID()));
- $available_variations = $product->get_available_variations();
- foreach($available_variations as $prod_variation) {
- $post_id = $prod_variation['variation_id'];
- $post_object = get_post($post_id);
- // do what you like with the post object here
- // you can add the variation to the product cart by linking to ?add-to-cart={variation_id}&quantity=xxx
- debug_object($post_object->ID);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement