Skip to content

Instantly share code, notes, and snippets.

View GuruWithin's full-sized avatar

GuruWithin GuruWithin

  • India
  • 01:56 (UTC +05:30)
View GitHub Profile
@GuruWithin
GuruWithin / gist:32d12cc03d5ff3a2dfa8b285890bb029
Created November 12, 2016 07:54 — forked from corsonr/gist:6775121
WooCommerce - Product already in cart, change "add to cart" text
<?php
/**
* Change the add to cart text on single product pages
*/
add_filter('woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text');
function woo_custom_cart_button_text() {
foreach( WC()->cart->get_cart() as $cart_item_key => $values ) {