Rename woocommerce product cart label

23 Views Asked by At

I'm looking to rename one label on the woocommerce cart items in the cart page. In this case, I would like to change the text 'Personnes' to 'Quantité'. I have already tried it on the product page and it worked.

enter image description here

This is the code I used in the product page

<?php
add_filter( 'booking_form_fields', 'booking_form_fields' );

function booking_form_fields( $fields ) {
    $fields['wc_bookings_field_persons']['label'] = 'Quantité';
    return $fields;
}
?>

And this is what I used in the cart page. But when I save the code in the snippet I have created, it shows me a fatal error. enter image description here

<?php add_filter('woocommerce_review_order_before_cart_contents', 'cart_person_fields');
function cart_person_fields($fields){
    $fields['variation-Personnes']['label'] = 'Quantité';
    return $fields;
}?>

0

There are 0 best solutions below