Home > Net >  Add column with product numbering on WooCommerce cart page
Add column with product numbering on WooCommerce cart page

Time:02-22

I'm trying to add numbers to each row in WooCommerce cart page, but i'm unable to get it working or even showing up.

My current code:

add_action( 'woocommerce_before_add_to_cart_quantity', 'quadlayers_woocommerce_hooks');
function quadlayers_woocommerce_hooks() {
global $woocommerce;
    for ($x = 1; $x <= 0; $x  )
{
    foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {

   //$product = $cart_item['data'];
   $product_id = $cart_item['product_id'];
   
}
}
    echo $x;
}

It should be something like this:

enter image description here

Any advice on how to achieve this?

CodePudding user response:

The adjustments you want are not possible via hooks, for this you will have to overwrite the enter image description here

  • Related