- Posts: 32
- Thank you received: 1
How to change style of added to cart info message
- jeffmcbiscuit
-
Topic Author
- Offline
-- Joomla version -- : 3.9.22
-- PHP version -- : 7.4
I'm trying to style the "X product has been added to cart" message drop down, but I can't find the CSS for it anywhere, and for some reason you've used !important for the 'color' attribute which is pretty bad practice. I can't override this in my custom.css file.
<style>
.notifyjs-metro-warning {
color: #8a6d3b !important;
background-color: #fcf8e3;
border: 1px solid #faebcc;
}
Please Log in or Create an account to join the conversation.
That CSS is not added by us. It's inside the library notify-js which HikaShop uses to display the notification boxes.
You can find it in the file media/com_hikashop/js/notify.js with the code:
To override it, you would have to add that same javascript modified with the colors you want in a view file used where the notification is displayed.
That way, your javascript would override the "metro" style used by notify-js with your own colors.
Please Log in or Create an account to join the conversation.
- jeffmcbiscuit
-
Topic Author
- Offline
- Posts: 32
- Thank you received: 1
To override it, you would have to add that same javascript modified with the colors you want in a view file used where the notification is displayed.
So I can copy / paste this into one of the Hikashop view files and change the colours to suit myself? That's fine. Do you know which view it needs to be please?
Please Log in or Create an account to join the conversation.
Which view depends on where you have the add to cart button displayed.
If it's only on the product details page, then you can add that code in the product / show.php view file.
Note that you'll need to encapsulate that code in script tags.
Please Log in or Create an account to join the conversation.
- jeffmcbiscuit
-
Topic Author
- Offline
- Posts: 32
- Thank you received: 1
Please Log in or Create an account to join the conversation.
The "Display view files" setting will only work for HikaShop views.
Based on how the add to cart buttons were added to all your pages, it's possible that it won't show anything, which will mean that no HikaShop view is involved. It's worth giving it a shot though.
In case no Hikashop view file is involved, you could add the code in your template, so that it is available on all the pages.
However, you'll have to add a check on the addStyle function to run this code only if this function is present.
Please Log in or Create an account to join the conversation.
- jeffmcbiscuit
-
Topic Author
- Offline
- Posts: 32
- Thank you received: 1
Please Log in or Create an account to join the conversation.
How can I edit the content of this notify?
i want add a button and a link to it?
Life is the unique stage of our art. Everyone sings their own song and leaves the stage. The stage is always permanent. Blessed is that song that people remember.
Please Log in or Create an account to join the conversation.
In order to better understand your need, can you precise the context and be more specific on your need, and so for this :
1. An url link in order to see the context
2. Describe your needs and the changes you want to make
Awaiting your returns to answer you precisely.
Regards
Please Log in or Create an account to join the conversation.
Life is the unique stage of our art. Everyone sings their own song and leaves the stage. The stage is always permanent. Blessed is that song that people remember.
Please Log in or Create an account to join the conversation.
You want to edit the HikaShop cart notification plugin via the Joomla plugins manager.
There, you have an option where you can select the "popup" mode and it will work like what you want.
Please Log in or Create an account to join the conversation.