Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1466577

    Hello everyone,

    We are currently testing Enfold with Woocommerce and have encountered a problem with the buttons.

    We would like the buttons on the website to look uniform (color, font, etc.).
    Unfortunately, I can’t find a solution for this use case in the documentation.
    Is there a kind of global style that can be defined?

    The buttons on the store page look completely different from those on the product page itself. The entire styling here is “wrong” or Enfold Standard as it seems.

    Here it also looks to me that there are two buttons.
    “To product” and ‘Show details’.
    There should only be one standard button here.

    Thank you for your help.

    #1466606

    Hey Martin,

    I’m not sure I fully understand what you are looking to change. Could you share a screenshot highligting your intentions please?

    Best regards,
    Rikard

    #1466610
    This reply has been marked as private.
    #1466698

    Hi,

    Thank you for the screenshots.

    You can use this css code to adjust the style of the product buttons in the shop page.

    #top .main_color .avia_cart_buttons .button {
        color: white;
    }
    
    #top .main_color .avia_cart_buttons {
        background: rgb(195, 26, 57);
    }

    If you’d like to adjust the initial opacity of the buttons, please add the following css code:

    .avia_cart_buttons {
        opacity: 0.8;
    }

    You may need to toggle or temporarily disable the Enfold > Performance > File Compression settings after adding the modifications.

    Best regards,
    Ismael

    #1466758
    This reply has been marked as private.
    #1466777

    Hi,

    Thank you for the update.

    thanks for your answer. but I don’t quite understand the button yet

    The first button allows the users to add the products directly to the cart, while the second button should redirect to the actual product page with all the details and information.

    Best regards,
    Ismael

    #1468229

    Hello Ismael,

    Thank you for your reply. Unfortunately, both buttons refer to the product. That is exactly the error or my problem.
    I would like to have only one button, preferably with the text “Show product”.

    And on the subject of styling. I have the button styling in the theme – can this also be used for the cart button?

    #1468245

    Hi,

    Thank you for the info.

    You can try this hook in the functions.php file to remove the theme’s modifications to the product buttons.

    function ava_custom_remove_woocommerce_action() {
        remove_action( 'woocommerce_after_shop_loop_item', 'avia_add_cart_button', 16 );
    }
    add_action( 'after_setup_theme', 'ava_custom_remove_woocommerce_action' );
    

    Best regards,
    Ismael

    #1468266

    Hi Ismael,

    with this code – there es no more Button :-(

    #1468321

    Hi,

    We modified the code a bit. Please try it again:

    function ava_custom_remove_woocommerce_action()
    {
        remove_action('woocommerce_after_shop_loop_item', 'avia_add_cart_button', 16);
        add_action('woocommerce_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30);
        add_action('woocommerce_grouped_add_to_cart', 'woocommerce_grouped_add_to_cart', 30);
        add_action('woocommerce_variable_add_to_cart', 'woocommerce_variable_add_to_cart', 30);
        add_action('woocommerce_external_add_to_cart', 'woocommerce_external_add_to_cart', 30);
        add_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
    }
    add_action('after_setup_theme', 'ava_custom_remove_woocommerce_action');
    

    Best regards,
    Ismael

    #1468357

    Hi ismael,

    now it looks very good :-) Thanks for that.
    Two more questions:

    – How can I change the button text?
    – Is it possible to change the button to a “add to cart” function? At the Moment it points to te product page…

    Best
    Martin

    #1468391

    Hi,

    Thank you for the update.

    You can use this filter in the functions.php file to change the text of the add to cart button:

    function ava_custom_woocommerce_add_to_cart_text() {
        return __( 'Your Custom Text', 'woocommerce' );
    }
    add_filter( 'woocommerce_product_single_add_to_cart_text', 'ava_custom_woocommerce_add_to_cart_text' );
    add_filter( 'woocommerce_product_add_to_cart_text', 'ava_custom_woocommerce_add_to_cart_text' );       
    

    Best regards,
    Ismael

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.