Advertisement
developerjustin

Untitled

Jul 10th, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.48 KB | None | 0 0
  1.                     debug_object(get_post_meta(get_the_ID()));
  2.                     $available_variations = $product->get_available_variations();
  3.                       foreach($available_variations as $prod_variation) {
  4.                         $post_id = $prod_variation['variation_id'];
  5.                         $post_object = get_post($post_id);
  6.                         // do what you like with the post object here
  7.                         // you can add the variation to the product cart by linking to ?add-to-cart={variation_id}&quantity=xxx
  8.                         debug_object($post_object->ID);
  9.                       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement