-
AuthorPosts
-
July 23, 2018 at 12:10 pm #988661
Hi
is there a way to replace the cart-icon and the text “Choose an option” on the product-overview page (variable products)
Please see the private field.
To me this icon does not make sense as it suggests “add-to-cart”, which it doesn’t.– I would like to replace the “cart-icon” icon with the “icons-shop-options.png” icon from the folder “wp-content/themes/enfold/config-woocommerce/images”.
– At the same time I would like to change its text to “Details ansehen” [“Show details”] – on hover..
Of course: without changing the button’s action.Thanks,
BrunoJuly 23, 2018 at 9:26 pm #988914Hey bruwa,
Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
BasilisJuly 24, 2018 at 10:59 pm #989414Hi Basilis
the text “Select options” can be customized by adding the following to the theme’s functions.php (unfortunately it doesn’t work in the enfold-child functions.php)
add_filter( 'woocommerce_product_add_to_cart_text', function( $text ) { global $product; if ( $product->is_type( 'variable' ) ) { $text = $product->is_purchasable() ? __( 'Custom options text', 'woocommerce' ) : __( 'Read more', 'woocommerce' ); } return $text; }, 10 );
https://wpexplorer-themes.com/total/snippets/woocommerce-select-options-text/
Or:
add_filter('catalog_visibility_alternate_add_to_cart_button', 'my_alternate_button', 10, 1); function my_alternate_button($content) { return 'My Alternate Content'; }
https://docs.woocommerce.com/document/catalog-visibility-options/
I have yet to find a way to remove (or change) the cart icon.
Would maybe Dude have an idea?Regards,
Bruno- This reply was modified 6 years, 4 months ago by bruwa.
July 26, 2018 at 4:24 am #990023Hi,
To remove the icon, please try this css in the WordPress > Customize > Additional CSS:.inner_product .avia_cart_buttons.single_button .product_type_variable.add_to_cart_button span[data-av_icon=""] { display: none !important; }
To change the text, Try adding this code to the end of your functions.php file in Appearance > Editor:
function custom_text_script(){ ?> <script> jQuery(window).load(function(){ jQuery("a.button.product_type_variable.add_to_cart_button").text("Details ansehen"); }); </script> <?php } add_action('wp_footer', 'custom_text_script');
Best regards,
MikeJuly 26, 2018 at 7:54 am #990095Hi Mike
I’m happy to report that your suggestions both perfectly work!
Problem solved. Thank you!Best regards,
Bruno- This reply was modified 6 years, 4 months ago by bruwa.
July 26, 2018 at 1:16 pm #990233Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘How to replace an icon and the related text?’ is closed to new replies.