Alerts for reaching maximum orders

  • Posts: 120
  • Thank you received: 14
  • Hikashop Business
1 year 3 hours ago #356865

-- HikaShop version -- : 5.0.0 [2311031727]
-- Joomla version -- : 4.0.0

Seeking to change the styles and timing of the popups when the number sought to be ordered exceeds the maximum number allowed

This is in two two places

Immediately above the item being over ordered
Text says ... Quantity Change Impossible


Top Right Corner
This can be sorta updated but not completely in media/com_hikashop/js/notify.js

Looking for some pointers
Thanks

Last edit: 11 months 3 weeks ago by yerg55. Reason: Resolved edit to subject

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 months 4 weeks ago #356871

Hi,

You can add normal CSS code, either in the HikaShop CSS or in your template CSS. You don't need to edit the JS file directly. In fact I would recommend you don't because you'll loose your changes when you update HikaShop.
You can add such CSS for example:

body .notifyjs-metro-base.notifyjs-metro-warning {
    background-color: red;
    color: white !important;
}
www.hikashop.com/support/documentation/1...ize-the-display.html

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

  • Posts: 120
  • Thank you received: 14
  • Hikashop Business
11 months 4 weeks ago #356877

Thanks Nicholas

Interested to see where that style came from to reference it in a custom CSS.
Where is the text drawn from?
Also the timing settings for those popups to disappear

Thanks

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 months 4 weeks ago #356881

Hi,

I'm not sure what you mean ?
You don't need to have existing CSS code to add custom CSS to an HTML element.
As long as the HTML element has a class or an id unique to it, you can use that class / id to add your custom CSS for it, in any CSS file on the page.
The text of course comes from a translation key of HikaShop's translation file. So if you need to change the wording of the text, you can use a normal translation override: www.hikashop.com/download/languages.html#modify
The timing is fixed by the javascript in HikaShop, and we didn't made any plan to allow for easy modification of this.
The popup is displayed by the code:

hkjQuery(el).notify({title:trans[0],text:trans[1].replace('%s', max), image:'<i class="fa fa-3x fa-exclamation-circle"></i>'},{style:"metro",className:"warning",arrowShow:true,position:"top left"});
in media/com_hikashop/js/hikashop.js
I think that adding a parameter to the json with the name autoHideDelay and the value in milliseconds should allow you to change the default from 5 seconds to something else.

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

  • Posts: 120
  • Thank you received: 14
  • Hikashop Business
11 months 4 weeks ago #356896

Thanks Nicholas

Timing delay is critical given over 70% of our customers are in their later years and the popups disappear before they realise they are there.

May be doing the wrong CSS override.
Will review again

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

  • Posts: 120
  • Thank you received: 14
  • Hikashop Business
11 months 4 weeks ago #356898

The alerts saga continues.
No matter what what I add to any css be it in the shop (hikashop admin general display options) or elsewhere in any css it is over ridden with an inline.css
What I am entering / editing into the files

.notifyjs-metro-warning {
  color: #CD0000 !important;
  background-color: #fafafa;
  border: 1px solid #CD0000; 
}

What's over riding everything is the inline style.



Line 16 is
.notifyjs-metro-warning {
	color: #8a6d3b !important;
	background-color: #fcf8e3;
	border: 1px solid #faebcc;
}

Which generates


Where can I find thte file where I can hard code a reference to the custom style?
Happy to keep that reference to the change externally when anything gets updated.

Apologies Nicholas but this has me totally stumped

Oh I got the timing sorted with some pretty crude coding. It works ;)

Attachments:
Last edit: 11 months 4 weeks ago by yerg55. Reason: Forgot something

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 months 4 weeks ago #356906

Hi,

I think the problem is not where you add your CSS but the CSS code you're using.
Your CSS doesn't have enough priority against the default CSS of the notify JS library.
Did you try the CSS I gave you in my previous message ?
I specifically used the selector "body .notifyjs-metro-base.notifyjs-metro-warning" in order to override the priority of the default CSS, and in my tests it worked fine.

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

  • Posts: 120
  • Thank you received: 14
  • Hikashop Business
11 months 3 weeks ago #356945

.notifyjs-metro-base.notifyjs-metro-warning rather than just .notifyjs-metro-warning makes ALL the difference. :ohmy:

All sorted

The following user(s) said Thank You: Philip

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

Time to create page: 0.069 seconds
Powered by Kunena Forum