Change Button Text in Cart

December 31, 2019 6:42 pm

Currently, when a user is logged out, the button in the cart says “Purchase Credits.” However, a user may have credits available that just aren’t showing at this stage. Is it possible to change the text on the cart button depending on various cases (for example, for logged out users, we’d like it to say “Checkout or Purchase Credits.”).

I know the code in the plugin file:

if (!$user_credits) {
$label_buy = __(‘Purchase’, ‘mwdcp’);

I’d like this to be:

if (!$user_credits) {
$label_buy = __(‘Checkout or Purchase’, ‘mwdcp’);

But I obviously don’t want to edit plugin files. I’d rather do this with a function if possible or settings built into the plugin.

Published by 3 Comments

3 Replies

Leave a Reply

Your email address will not be published.