• Resolved perlastudio

    (@perlastudio)


    Hello,

    this plugin is amazing. Thank you very much for great job!

    I have one question. How to change button text “add to cart” on mobile? I tried with below code, but showing error…

    add_filter('pvtfw_row_cart_btn_is', function( $text, $product_id, $cart_url, $product_url, $variant_id){
    	$new_text = __('TEST', 'product-variant-table-for-woocommerce');
    	$btn = sprintf(
    		'<button data-product-id="%s" data-url="%s" data-product="%s" data-variant="%s" class="pvtfw_variant_table_cart_btn button alt">
            <span class="pvtfw-btn-text">%s</span> 
            <div class="spinner-wrap"><span class="flaticon-spinner-of-dots"></span></div>
            </button>',
    	   $new_text
    	);
       return $btn;
    }, 10, 5);

    Thanks for help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WPXtension

    (@wpxteam)

    Hi,

    Thanks for reaching out to us. Please try the following:

    add_filter('pvtfw_row_cart_btn_is', function( $text, $product_id, $cart_url, $product_url, $variant_id){
    	$new_text = __('TEST', 'product-variant-table-for-woocommerce');
    	$btn = sprintf(
    		'<button data-product-id="%s" data-url="%s" data-product="%s" data-variant="%s" class="pvtfw_variant_table_cart_btn button alt">
            <span class="pvtfw-btn-text">%s</span> 
            <div class="spinner-wrap"><span class="flaticon-spinner-of-dots"></span></div>
            </button>'
    	   , $product_id, $cart_url, $product_url, $variant_id, sprintf( _x( '%s', 'Button Text: Add To Cart', 'product-variant-table-for-woocommerce' ), $new_text )
    	);
       return $btn;
    }, 10, 5);

    If you found our support helpful and like our plugin. My humble request, please leave your good words here to inspire us.

    Thanks

    Thread Starter perlastudio

    (@perlastudio)

    Hi,

    this code working! Thank you!

    Plugin Author WPXtension

    (@wpxteam)

    Glad to know it helped. Thanks a lot for your good words.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change button text ‘add to cart’ on mobile’ is closed to new replies.