Replace ADD_TO_CART by a cart icon in product list

  • Posts: 639
  • Thank you received: 16
  • Hikashop Business
10 years 7 months ago #187370

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.x

I found many old 2 years+ threads about this topic with a wide range of solution, the next more complicated than the preceeding...

Is there a simple "switch" or CSS Trick way to replace the ADD_TO_CART button text for a Cart Icon wether it is an image or a Symbol font?

I mean, for HikaShop 2.3.5. And for Product listings and product page views.

Please Log in or Create an account to join the conversation.

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 7 months ago #187378

Hi,

By using the CSS mode for the button, you can set a background picture on the "a.hikashop_cart_button" and specify the height and the width for the element.
You can also change the translation for the "add to cart" text to something empty ; or change the color to "transparent", change the font-size to something really tiny...

There is no really a switch ; but there are a lot of CSS solutions.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 639
  • Thank you received: 16
  • Hikashop Business
10 years 7 months ago #187459

Thank you Jerome, this sounds good.

But could you enlight me a little bit with this?

By using the CSS mode for the button


Is this a setting in the configuration? I'm not familiar with a "CSS mode"

Please Log in or Create an account to join the conversation.

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 7 months ago #187462

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: PeterChain

Please Log in or Create an account to join the conversation.

  • Posts: 639
  • Thank you received: 16
  • Hikashop Business
10 years 7 months ago #187711

Have added the code for an image to this in frontend_custom.css:

a.hikashop_cart_button, a.hikashop_compare_button, .hikashop_cart_input_button, .hikashop_nostock_button{

and here

a.hikashop_cart_button:hover, a.hikashop_compare_button:hover, .hikashop_cart_input_button:hover{

but I'm not successful. I get the extra room for the icon but no way to show the icon. Have tried with both png and jpg.

This is the code taken from a thread in the forum:

background-image: url(../images/cart.png);
background-repeat: no-repeat;
background-position: right;
height: 32px;
padding-right: 40px !important;
background-color: transparent;
cursor: pointer;

also tried the path inside url() with ' ' and " ".

Nothing shows, only the reserved 40px padding right

Any clue?

Please Log in or Create an account to join the conversation.

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 7 months ago #187734

Hi,

Best is to use the browser development tools in order to see what CSS rules are applied ; you can also tweak them dynamically in order to find the good CSS rule (or good image path).
www.hikashop.com/support/support/documen...ize-the-display.html

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: PeterChain

Please Log in or Create an account to join the conversation.

  • Posts: 639
  • Thank you received: 16
  • Hikashop Business
10 years 7 months ago #187760

Right, did this the whole time, the CSS rules look coherent but the screen result didn't. I tried all ways to get into the image folder but the image never renders.

Maybe I will have to reask for help once the site is online.

Thank you anyway.

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum