-
AuthorPosts
-
September 9, 2024 at 11:43 pm #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.
September 10, 2024 at 10:01 am #1466606Hey 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,
RikardSeptember 10, 2024 at 10:09 am #1466610This reply has been marked as private.September 11, 2024 at 12:13 pm #1466698Hi,
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,
IsmaelSeptember 11, 2024 at 11:47 pm #1466758This reply has been marked as private.September 12, 2024 at 4:44 am #1466777Hi,
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,
IsmaelOctober 1, 2024 at 11:13 pm #1468229Hello 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?
October 2, 2024 at 5:15 am #1468245Hi,
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,
IsmaelOctober 2, 2024 at 12:16 pm #1468266Hi Ismael,
with this code – there es no more Button :-(
October 3, 2024 at 4:07 am #1468321Hi,
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,
IsmaelOctober 3, 2024 at 12:34 pm #1468357Hi 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
MartinOctober 4, 2024 at 3:44 am #1468391Hi,
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 -
AuthorPosts
- You must be logged in to reply to this topic.