Snippets Collections
// Get visible variations
$product = wc_get_product($product_id);
$variations = $product->get_available_variations();
$variations_id = wp_list_pluck( $variations, 'variation_id' );

// OR Get all varations regardless of visibility
$product = wc_get_product($product_id);
$current_products = $product->get_children();
Db::getInstance()->executeS("DELETE FROM product_images WHERE id_product NOT IN (" . join($allProductIds,',') . ")")

Wed Apr 27 2022 11:09:33 GMT+0000 (Coordinated Universal Time)

#woocommerce #ids #variations

Tue Mar 02 2021 10:31:38 GMT+0000 (Coordinated Universal Time)

#prestashop #delete #mysql #db #database #ids

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension