Home Forums WoodMart support forum Products (grid or carousel)

Products (grid or carousel)

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #612399

    lemmermann
    Participant

    Hello 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
    Mike

    Attachments:
    You must be logged in to view attached files.
    #612452

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    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

    #613694

    lemmermann
    Participant

    Hello 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
    Mike

    #613820

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    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/filesystem

    If 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.

    #614627

    lemmermann
    Participant

    Hello 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 ?

    #614706

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    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

    #614762

    lemmermann
    Participant

    Hello,

    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.
    #615028

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    Your issue has been solved. Please check the site after removing the browser cache.

    Best Regards.

Viewing 8 posts - 1 through 8 (of 8 total)