New hook: cart item removed because of hash change
This commit is contained in:
parent
af3c2732c1
commit
db6f6f22ca
|
@ -146,7 +146,9 @@ final class WC_Cart_Session {
|
|||
} elseif ( ! empty( $values['data_hash'] ) && ! hash_equals( $values['data_hash'], wc_get_cart_item_data_hash( $product ) ) ) { // phpcs:ignore PHPCompatibility.PHP.NewFunctions.hash_equalsFound
|
||||
$update_cart_session = true;
|
||||
/* translators: %1$s: product name. %2$s product permalink */
|
||||
wc_add_notice( sprintf( __( '%1$s has been removed from your cart because it has since been modified. You can add it back to your cart <a href="%2$s">here</a>.', 'woocommerce' ), $product->get_name(), $product->get_permalink() ), 'notice' );
|
||||
$message = sprintf( __( '%1$s has been removed from your cart because it has since been modified. You can add it back to your cart <a href="%2$s">here</a>.', 'woocommerce' ), $product->get_name(), $product->get_permalink() );
|
||||
$message = apply_filters( 'woocommerce_cart_item_removed_because_modified_message', $message, $product );
|
||||
wc_add_notice( $message, 'notice' );
|
||||
do_action( 'woocommerce_remove_cart_item_from_session', $key, $values );
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue