@deivnet Yeah, the plugin gets reeaally slow when you have more than 200 variations on a page.
I took a look the the code snippet you posted, tweaked it and got a reduction of ~80% page load speed.
Here’s my code, which I think should be implemented into the plugin: @pixelyoursite
// variations ids
if ( wooProductIsType( $product, 'variable' ) ) {
$product_ids = array_merge($product_ids, $product->get_children());
}
Gives the same result as the current method, but doesn’t hydrate every variation class and load it into memory.
-
This reply was modified 4 years, 3 months ago by Adevade. Reason: Remove typo
I’d like to point out to future users that you since WP 3.9 can set the crop position when you ´add_image_size´
Read more here:
add_image_size in the Codex
add_image_size Change Log