Pus
Pus

Reputation: 799

Changing quantity label in woocommerce cart page

How can i change the quantity label appear in table header in woocommerce cart page ? I need to change the header label of quantity to something else.

Upvotes: 4

Views: 11724

Answers (1)

Tom Green
Tom Green

Reputation: 305

You need to edit the template file for the cart page.

Does your theme already have a /woocommerce/ folder with each template? If not you should copy the /cart/ folder from /wp-content/plugins/woocommerce/templates/ to /your-theme/woocommerce/ then edit /cart/cart.php and search for "Quantity".

You could also use this trick in your functions.php file to replace everything that says "Quantity" on your site:

add_filter('gettext', 'translate_reply');
add_filter('ngettext', 'translate_reply');

function translate_reply($translated) {
$translated = str_ireplace('Quantity', 'New Label', $translated);
return $translated;
}

Just change "New Label" to whatever you want to call it.

Upvotes: 8

Related Questions