• could you please tell me how could i change add to cart hover text on product listing widget 1
    i want that to become readmore text help me please

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author Access Keys

    (@access-keys)

    Hi there,
    You can add this code in your function.php.

    add_filter( ‘woocommerce_product_add_to_cart_text’ , ‘custom_woocommerce_product_add_to_cart_text’ );
    function custom_woocommerce_product_add_to_cart_text() {
    global $product;
    $product_type = $product->product_type;
    switch ( $product_type ) {
    case ‘external’:
    return __( ‘Buy product’, ‘accesspress-store’ );
    break;
    case ‘grouped’:
    return __( ‘View products’, ‘accesspress-store’ );
    break;
    case ‘simple’:
    return __( ‘Add to cart’, ‘accesspress-store’ );
    break;
    case ‘variable’:
    return __( ‘Select options’, ‘accesspress-store’ );
    break;
    default:
    return __( ‘Read more’, ‘accesspress-store’ );
    }
    }

    This should work.

    Thanks

    Thread Starter alihaider166

    (@alihaider166)

    thank you very much for this code its work fine !!
    i want that if a user click on add to cart button it will take him to that same product detail page

    Theme Author Access Keys

    (@access-keys)

    For this you can use following steps :
    PUT THIS IN YOUR CHILD THEME FUNCTIONS FILE*/
    /*STEP 1 – REMOVE ADD TO CART BUTTON ON PRODUCT ARCHIVE (SHOP) */
    function remove_loop_button(){
    remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 10 );
    }
    add_action(‘init’,’remove_loop_button’);
    /*STEP 2 -ADD NEW BUTTON THAT LINKS TO PRODUCT PAGE FOR EACH PRODUCT */
    add_action(‘woocommerce_after_shop_loop_item’,’replace_add_to_cart’);
    function replace_add_to_cart() {
    global $product;
    $link = $product->get_permalink();
    echo do_shortcode(‘View Product‘);
    }

    Thanks

    Thread Starter alihaider166

    (@alihaider166)

    its not working still saying view cart

    Thread Starter alihaider166

    (@alihaider166)

    i think you can’t understand what am i saying i want that when a person click on product slider 1 addtocart/read more(which we change on hover) button it will redirect it to that same product page !! help me

    [several bumps moderated]

    Please create a new ticket through [email protected] and post your issue there

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘change add to cart hover’ is closed to new replies.