New Landing How can we help? Themeforest Theme Support Neighborhood Shop action " Read More"

Viewing 15 posts - 1 through 15 (of 18 total)
  • #136067
    MarcusF
    Member
    Post count: 75

    Hey ๐Ÿ™‚

    I what the shop action to all ways say “Read More” and the go to the page when you click it ๐Ÿ™‚

    image 1 is how it’s now.

    Best regards,
    Kristoffer

    Attachments:
    You must be logged in to view attached files.
    #136109
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    You mean you want to change that Add to cart button text to change in to read more, and instead add to cart, you want that link to take to the single product page?

    Let us know,

    Thanks,
    laranz.

    #136389
    MarcusF
    Member
    Post count: 75

    exactly ๐Ÿ˜€ !

    /Kristoffer

    #136408
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    I just went an extra mile, just for you ๐Ÿ™‚

    Add this in the functions.php

    add_filter( 'add_to_cart_url', 'woo_more_info_link' );
    function woo_more_info_link( $link ) {
    global $product; // switches link in all cases, i.e. in plugins
    $link = get_permalink( $product->id );  
    return $link;
    }
    
    /* replace add to cart text on button */
    add_filter('add_to_cart_text', 'woo_custom_cart_button_text');
    function woo_custom_cart_button_text() {
    return __('Read more', 'woocommerce');
    }

    Let us know,

    Thanks,
    laranz.

    #136617
    MarcusF
    Member
    Post count: 75

    Hey ๐Ÿ™‚

    You sir, are amazing!
    Thanks!

    There is just one problem, the text is changed but it still adds products to the cart, instead of going to the single product page..

    /Kristoffer

    #136632
    MarcusF
    Member
    Post count: 75

    I know it’s much to ask, but can you make one that does the same to the “Choose variation” ?

    Best regards,
    Kristoffer

    #136707
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please add this code at functions.php file:-

    add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' );
    /**
    * custom_woocommerce_template_loop_add_to_cart
    */
    function custom_woocommerce_product_add_to_cart_text() {
    global $product;
    $product_type = $product->product_type;
    switch ( $product_type ) {
    case 'variable':
    return __( 'Select options', 'woocommerce' );
    break;
    default:
    return __( 'Read more', 'woocommerce' );
    } 

    Thanks
    Mohammad

    #136812
    MarcusF
    Member
    Post count: 75

    hey guys ๐Ÿ™‚

    I have applied the codes and it still dosen’t work :/

    add_filter( ‘add_to_cart_url’, ‘woo_more_info_link’ );
    function woo_more_info_link( $link ) {
    global $product; // switches link in all cases, i.e. in plugins
    $link = get_permalink( $product->id );
    return $link;
    }

    /* replace add to cart text on button */
    add_filter(‘add_to_cart_text’, ‘woo_custom_cart_button_text’);
    function woo_custom_cart_button_text() {
    return __(‘Read more’, ‘woocommerce’);
    }

    add_filter( ‘woocommerce_product_add_to_cart_text’ , ‘custom_woocommerce_product_add_to_cart_text’ );
    /**
    * custom_woocommerce_template_loop_add_to_cart
    */
    function custom_woocommerce_product_add_to_cart_text() {
    global $product;
    $product_type = $product->product_type;
    switch ( $product_type ) {
    case ‘variable’:
    return __( ‘Select options’, ‘woocommerce’ );
    break;
    default:
    return __( ‘Read more’, ‘woocommerce’ );
    }
    }

    The single product text is chanced โˆš
    The rest ain’t working…

    best regards,
    Kristoffer

    #136873
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please try out this code also.

    add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' );
    /**
    * custom_woocommerce_template_loop_add_to_cart
    */
    function custom_woocommerce_product_add_to_cart_text() {
    global $product;
    $product_type = $product->product_type;
    switch ( $product_type ) {
    case 'variable':
    return __( 'Read more', 'woocommerce' );
    break;
    default:
    return __( 'Read more', 'woocommerce' );
    } 
    }

    Thanks

    Mohammad

    #136888
    MarcusF
    Member
    Post count: 75

    I’m really sorry to says this, but it dosen’t work…

    here is a link for the site..

    http://www.rejsegear.dk

    /Kristoffer

    #136975
    MarcusF
    Member
    Post count: 75
    This reply has been marked as private.
    #137041
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    What you are trying to achieve? What do you mean by this?

    I know itโ€™s much to ask, but can you make one that does the same to the โ€œChoose variationโ€ ?

    Let us know,

    Thanks,
    laranz.

    #139490
    MarcusF
    Member
    Post count: 75

    hey ๐Ÿ™‚
    sorry for the late replay..

    I need “read more” on all products ๐Ÿ™‚ not only on the single products but also on variable products.

    The code you gave me changes the text on the single products but it doesn’t create the link to the product. it still adds the product to the cart.

    Best regards,
    Kristoffer

    #139524
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    After putting the code I gave, comment this code http://take.ms/JHj5T in js/functions.js file

    Let us know,

    Thanks,
    laranz.

    #140588
    MarcusF
    Member
    Post count: 75

    Hey.

    Now the text work fine on single products, but the button still adds product to the cart.

    And is it possible to make the solution in the child folder ?

    Best regards,
    Kristoffer

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register