Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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,
    Bruno

    #988914

    Hey 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,
    Basilis

    #989414

    Hi 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.
    #990023

    Hi,
    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,
    Mike

    #990095

    Hi 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.
    #990233

    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 under Enfold sub forum and we will gladly try to help you :)

    Best regards,
    Mike

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘How to replace an icon and the related text?’ is closed to new replies.