Skip Navigation

[Resolved] Add to cart image or icon

This thread is resolved. Here is a description of the problem and solution.

Problem:

I am trying to replace the 'Add to cart' text with an image or an icon but can't figure out how to do it using the shortcode variations.

Solution:

It is not possible to add an icon or text directly inside the add_to_cart_text attribute. Instead, use custom CSS to add it as a background image. Provide the URL where the shortcode is used and the URL of the image for further assistance in creating a CSS starting point.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Christopher Amirian 5 months, 2 weeks ago.

Assisted by: Christopher Amirian.

Author
Posts
#2702028

Hi,

I'm trying to replace the Add to cart text by an image or an icon. I triend many variations of ' or " but I can't figure it out.

[wpv-woo-buy-or-select add_to_cart_text='<img src="hidden link" width="100px">']
or
[wpv-woo-buy-or-select add_to_cart_text='<i class="fa fa-cart-plus">']

Any idea?

Thx

#2702338

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

It is not possible to add an icon or text inside the add_to_cart_text attribute.

Instead, you need to add a custom CSS code to add it as a background image.

If you can give me the URL that you used the shortcode and the URL of the image, I might be able to create a starting point for you in CSS that you can fine-tune later.

Thanks.

#2702855

Many thx for your advice. I'll try to figured by myself how to achieve this, kind of challenge for me.

Thx for all!