Skip to content

Instantly share code, notes, and snippets.

@ideadude
Created September 25, 2018 18:51
Show Gist options
  • Save ideadude/dfb8ed2bb957bf96ab26516dc1cde88e to your computer and use it in GitHub Desktop.
Save ideadude/dfb8ed2bb957bf96ab26516dc1cde88e to your computer and use it in GitHub Desktop.
Change the default text for the one-membership-product-per-cart warning in PMPro WooCommerce.
<?php
/**
* Change the default text for the one-membership-product-per-cart warning in PMPro WooCommerce.
* Add this code to a custom plugin. https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_gettext_pmprowc_changes( $translated_text, $text, $domain ) {
if( $domain == "pmpro-woocommerce" && $text == "You may only add one membership to your %scart%s." ) {
$translated_text = "Include the %stwo percent-s strings%s, which will add the start and end a tags.";
}
return $translated_text;
}
add_filter('gettext', 'my_gettext_pmprowc_changes', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment