Prime cache to reduce queries per cart item
This commit is contained in:
parent
114cbdd450
commit
8fd336cb0e
|
@ -223,6 +223,9 @@ class WC_Cart {
|
|||
}
|
||||
|
||||
if ( is_array( $cart ) ) {
|
||||
// Prime meta cache to reduce future queries
|
||||
update_meta_cache( 'post', wp_list_pluck( $cart, 'product_id' ) );
|
||||
|
||||
foreach ( $cart as $key => $values ) {
|
||||
$_product = wc_get_product( $values['variation_id'] ? $values['variation_id'] : $values['product_id'] );
|
||||
|
||||
|
|
Loading…
Reference in New Issue