Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Shop action " Read More"
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Shop action " Read More"
- This topic has 17 replies, 3 voices, and was last updated 9 years by Mohammad – SUPPORT.
-
Posted in: Neighborhood
-
December 16, 2014 at 8:50 pm #136067
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,
KristofferAttachments:
You must be logged in to view attached files.December 16, 2014 at 11:45 pm #136109Hi,
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.December 17, 2014 at 7:05 pm #136389exactly ๐ !
/Kristoffer
December 17, 2014 at 8:51 pm #136408Hi,
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.December 18, 2014 at 5:14 pm #136617Hey ๐
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
December 18, 2014 at 6:38 pm #136632I know it’s much to ask, but can you make one that does the same to the “Choose variation” ?
Best regards,
KristofferDecember 19, 2014 at 9:33 am #136707Hi,
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
MohammadDecember 19, 2014 at 4:29 pm #136812hey 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,
KristofferDecember 19, 2014 at 6:52 pm #136873Hi,
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
December 19, 2014 at 7:31 pm #136888I’m really sorry to says this, but it dosen’t work…
here is a link for the site..
/Kristoffer
December 20, 2014 at 9:00 pm #136975This reply has been marked as private.December 21, 2014 at 10:19 pm #137041Hi,
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.January 6, 2015 at 7:31 pm #139490hey ๐
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,
KristofferJanuary 6, 2015 at 11:33 pm #139524Hi,
After putting the code I gave, comment this code http://take.ms/JHj5T in js/functions.js file
Let us know,
Thanks,
laranz.January 10, 2015 at 11:21 pm #140588Hey.
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 -
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.