Merge pull request #8490 from justinshreve/remove-from-cart-attributes
Add ID & SKU attributes to the remove from cart link
This commit is contained in:
commit
474a11f036
|
@ -44,7 +44,13 @@ do_action( 'woocommerce_before_cart' ); ?>
|
|||
|
||||
<td class="product-remove">
|
||||
<?php
|
||||
echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf( '<a href="%s" class="remove" title="%s">×</a>', esc_url( WC()->cart->get_remove_url( $cart_item_key ) ), __( 'Remove this item', 'woocommerce' ) ), $cart_item_key );
|
||||
echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf(
|
||||
'<a href="%s" class="remove" title="%s" data-product_id="%s" data-product_sku="%s">×</a>',
|
||||
esc_url( WC()->cart->get_remove_url( $cart_item_key ) ),
|
||||
__( 'Remove this item', 'woocommerce' ),
|
||||
esc_attr( $product_id ),
|
||||
esc_attr( $_product->get_sku() )
|
||||
), $cart_item_key );
|
||||
?>
|
||||
</td>
|
||||
|
||||
|
|
|
@ -33,7 +33,15 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
$product_price = apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key );
|
||||
?>
|
||||
<li class="<?php echo esc_attr( apply_filters( 'woocommerce_mini_cart_item_class', 'mini_cart_item', $cart_item, $cart_item_key ) ); ?>">
|
||||
<?php echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf( '<a href="%s" class="remove" title="%s">×</a>', esc_url( WC()->cart->get_remove_url( $cart_item_key ) ), __( 'Remove this item', 'woocommerce' ) ), $cart_item_key ); ?>
|
||||
<?php
|
||||
echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf(
|
||||
'<a href="%s" class="remove" title="%s" data-product_id="%s" data-product_sku="%s">×</a>',
|
||||
esc_url( WC()->cart->get_remove_url( $cart_item_key ) ),
|
||||
__( 'Remove this item', 'woocommerce' ),
|
||||
esc_attr( $product_id ),
|
||||
esc_attr( $_product->get_sku() )
|
||||
), $cart_item_key );
|
||||
?>
|
||||
<?php if ( ! $_product->is_visible() ) : ?>
|
||||
<?php echo str_replace( array( 'http:', 'https:' ), '', $thumbnail ) . $product_name . ' '; ?>
|
||||
<?php else : ?>
|
||||
|
|
Loading…
Reference in New Issue