Home / Forums / WoodMart support forum / Products (grid or carousel)
Home › Forums › WoodMart support forum › Products (grid or carousel)
Products (grid or carousel)
- This topic has 7 replies, 2 voices, and was last updated 1 year, 8 months ago by
Aizaz Imtiaz Awan.
-
AuthorPosts
-
November 15, 2024 at 1:36 pm #612399
lemmermannParticipantHello Service Team,
on our new website I want to change the button functionality from select options/add to cart “to go to productpage”.
I think the most people want to see first the details from the produt before putting it to the cart.
Is this possible ?Thanks for a short information.
Best regards
MikeAttachments:
You must be logged in to view attached files.November 15, 2024 at 3:35 pm #612452Hello,
Please try to add the code below in the functions.php file in your child theme.
add_filter( 'woocommerce_loop_add_to_cart_link', 'redirect_variable_to_product_page', 10, 2 ); function redirect_variable_to_product_page( $button, $product ) { // Get the product URL $url = get_permalink( $product->get_id() ); // Check if the product is variable or simple if ( $product->is_type( 'variable' ) ) { $button = '<a href="' . esc_url( $url ) . '" class="button select_options">' . esc_html__( 'Select Options', 'woocommerce' ) . '</a>'; } else { // Keep default for other product types $button = '<a href="' . esc_url( $url ) . '" class="button add_to_cart_button">' . esc_html( $product->add_to_cart_text() ) . '</a>'; } return $button; }Best Regards
November 20, 2024 at 11:47 am #613694
lemmermannParticipantHello Support Team,
thank you for the code, it works !!
Now I want to rename the buttons with loco translate, but it doesnt work. Is it not possible to do this with loco translate ? If not could you rename “Select options” in “Details” for the variable products and for the non variable products from “add to cart” to “Details” ?
Thanks for a short answer.
Best regards
MikeNovember 20, 2024 at 3:36 pm #613820Hello,
Please use the Loco translate plugin on your site. After installing the plugin please Navigate to Loco >> Themes >> Woodmart >> Edit the translation which you are using for the site >> Click the Sync button >> Find the words and add the translation for them and save it.
Also, please Navigate to Loco >> Plugins >> Woocommerce >> Edit the translation which you are using for the site >> Click the Sync button >> Find the words and add the translation for them and save it.
Also, please Navigate to Loco >> Plugins >> Woodmart-Core >> Edit the translation which you are using for the site >> Click the Sync button >> Find the words and add the translation for them and save it.
https://wordpress.org/plugins/loco-translate/
Note:
1. Custom (recommended)
2. This is Loco’s protected folder under “wp-content/languages/loco/” which is safe from automatic updates and provides priority over the above locations.
https://localise.biz/wordpress/plugin/manual/msginit?utm_medium=plugin&utm_campaign=wp&utm_source=admin&utm_content=plugin-msginit#order
If this folder doesn’t exist you may need to create it and ensure it has the correct permissions.
https://localise.biz/wordpress/plugin/manual/filesystemIf the issue still exists then please send me the WP admin login details of your site so I will check and solve the issue for you.
For more information please read the theme documentation here:
https://xtemos.com/docs-topic/translate-woodmart-theme-with-loco-translate/Best Regards.
November 22, 2024 at 12:57 pm #614627
lemmermannParticipantHello Aizaz,
I try to do it like you wrote, but it dos not work. Can you help me ?
And annother request in the product grid: for non variable products you see the SKU number, for variable products not. Is it possible to hide the SKU in the grid ?
November 22, 2024 at 3:10 pm #614706Hello,
01. I have setup the theme translation on the site, please check the site now after removing the browser cache. If you want to change any words, please go to Loco >> Themes >> Edit the German language translation >> find the words >> translate it and save it.
02. Navigate to Theme Settings > Product Archive > Products Styles > Disable the option “Show SKU”.
Best Regards
November 22, 2024 at 4:36 pm #614762
lemmermannParticipantHello,
perfect, thank you. But the translating does not work for the buttons in the product grid (see screenshot in the file). The buttons are different for variable and non variable products.
And please see also the tax line: for non variable it is ok with 19% tax, but for variable products it is 0 % tax.
Thanks for a short feedback.
Mike
Attachments:
You must be logged in to view attached files.November 23, 2024 at 2:53 pm #615028Hello,
Your issue has been solved. Please check the site after removing the browser cache.
Best Regards.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register