Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1143082

    Hi,

    1. I want to change the header cart icon (= shopping cart) to another icon (in my case: calculator).

    Where do I find the file for the cart icon to replace it? Is it possible to replace this icon or do you see any problems.

    2. I want to change on the “Add to cart” button to “Add to Calculation”. Is this possible? Where can I do that?

    Any help would be welcome.

    Best regards
    Jorg

    #1143191

    Hey Jörg,
    To change the woocommerce cart icon, please open your functions.php and look for this on about line 259:

    	//woocomemrce    
    	'cart' 			=> array( 'font' =>'entypo-fontello', 'icon' => 'ue859'),
    	'details'		=> array( 'font' =>'entypo-fontello', 'icon' => 'ue84b'),
    

    then replace the icon codes with yours from the shortcode wand tool, I would have done it for you but I didn’t see a calculator as an option.
    To change the woocommerce add to cart button, Try adding this code to the end of your functions.php file in Appearance > Editor:

     add_filter('woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text');
     
     function woo_custom_cart_button_text() {
     return __('Book Now', 'woocommerce');
     }

    just change the Book Now to suit

    Best regards,
    Mike

    #1144078

    Hi Mike,

    can you please help me with that? I’ve never used a “Wand Tool”.

    I tried hard, but didn’t succeed.

    The easyest could be if you tell me where I find the cart icon. Then I could replace the file.

    Best regards
    Jorg

    • This reply was modified 5 years, 1 month ago by hartgen.
    #1144866

    Hi,
    I added this to your functions.php to change your “add to cart buttons”:

    add_filter('woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text');
     
    function woo_custom_cart_button_text() {
    return __('Add to Calculation', 'woocommerce');
    }

    I also added this css to your child theme styles.css to replace the woocommerce cart icon:

    a.cart_dropdown_link > span:before {
        opacity: 0;
    }
    a.cart_dropdown_link > span:nth-child(1) {
        background-image: url(https://your-site/wp-includes/images/media/calculator_32px.png)!important;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: 50% 50%;
    }

    These are both now working.
    Please clear your browser cache and check.

    Best regards,
    Mike

    #1145554

    Dear Mike,

    thanks a lot for doing this. You helped me a lot.

    Best regards
    Jorg

    #1145556

    Hi,
    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 in the Enfold forum and we will gladly try to help you :)

    Best regards,
    Mike

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Change header cart icon / Change "Add to cart" button Text’ is closed to new replies.