I use the following code to capture an image of each option for a particular product:
$product = new WC_Product_Variable( $product_id );
$variations = $product->get_available_variations();
foreach ( $variations as $variation ) {
echo "<img src=" . $variation['image']['url'] .">";
}
This returns a full size image.
Can someone tell me how I would change this to return the sketch url? (or any other size)
I'm sure these are pretty simple changes, but I just can't figure it out.
source
share