Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Message Box


Recommended Posts

This addon provides a quick way to display messages in the header of a Bootstrap shop. It is a vert simple installation.

Edited by Jack_mcs

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi Jack, testing this out.  php version 5.6 Got this notice:

Notice: Use of undefined constant TEXT_MESSAGE_PLACEHOLDER - assumed 'TEXT_MESSAGE_PLACEHOLDER' in ......

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

I'm not seeing that here but it is probably due to the strict error setting in that php version. But, regardless, the code causing the problem should not even be there. Please edit the includes/modules/content/header/cm_header_messagebox.php file and remove the following. Please let me know if there are any other problems and, if not, I will get a revised version uploaded.

      $message_box = '<div class="messagebox-margin">';
      $message_box .= tep_draw_form('quick_find', tep_href_link('advanced_message_result.php', '', $request_type, false), 'get', 'class="form-horizontal"');
      $message_box .= '  <div class="input-group">' .
                          tep_draw_input_field('keywords', '', 'required placeholder="' . TEXT_MESSAGE_PLACEHOLDER . '"', 'message') . '<span class="input-group-btn"><button type="submit" class="btn btn-info"><i class="fa fa-message"></i></button></span>' .
                      '  </div>';
      $message_box .=  tep_hide_session_id() . '</form>';
      $message_box .= '</div>';

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs After modifying as above, that notice does not appear now.  This is in a uniserver test shop, with the php as above and error reporting as follows:

 

// set the level of error reporting
//  error_reporting(E_ALL & ~E_NOTICE);
error_reporting(E_ALL);

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Are you just letting me know the error has gone or is there still a problem?

Errors gone, I was just showing the error checking setting in case you wanted to try something else to test it.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Oh, I see. Thanks. The problem is that the php developers changed what error_reporting shows in the latest versions of php. I don't develop using those versions so unless I enable strict reporting, such errors won't show up. It's usually not a problem but silly mistakes like the one I made here will trigger it.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 weeks later...

@@Jack_mcs, I have this addon on a live site, works ok and very useful, thanks.

however , I've just noticed that on mobile devices the message box appears slightly to the right of it's location, see attached image.

 

Can you advise? running 2.34.BS gold

 

Thanks

Mike

post-328457-0-32462000-1467283052_thumb.jpg

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

@@Mikepo In the user.css file, find this code

.message-box {margin-top:14px; margin-left:40px; padding:5px 4px; border:1px solid red; 
background:#FEE60A;
-moz-box-shadow: 0 0 5px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 0 5px rgba(0,0,0,0.5);
box-shadow: 0 0 15px rgba(0,0,0,0.5);}
 

And add this below it

@[member=media] (max-width: 640px) {
.message-box {margin-left:0px}
 } 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 6 months later...

A new version has been uploaded with these changes:

 

  • Added a second message option.
  • Added code to rotate the messages.
  • Changed css to better display with mobile devices - found by member Mikepo.
  • Removed unnecessary code.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thank you Jack!

Although mine is not working the way you intended, it is perfect for my purpose.

Just FYI, in your original version, I had a few lines of HTML followed by a line of plain text.

In the latest version I put the HTML in box one & plain text in box two. It would fade and message two never showed, fade back to one.

I put my whole original string in box one and other plain text in box two. Box one HTML fades, plain text stays, message two never shows. Leave box two empty and it doesn't fade.

I'm happy with the results of the blue line configuration with long show, quick fade out-in as it brings attention to the important part. 

Link to comment
Share on other sites

I setup my test shop here to have the messages as you describe and it works as expected. Please make sure the first delay setting is at least twice the fade delay setting, as mentioned in the settings. If not, it will cause problems like that.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs @@Big Bear

I noticed the same scenario, when I used £

the text (html) in the second box wouldn't appear,

so instead of £ I used £, now everything works as it should.

Hope this helps

Mike

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

In the user.css file, change the .message-box class to include height:XXpx; where XX is the height. Note that there are two instances of that class, one for desktop and one for mobile. You need to change them both to what works in each case.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...

Just FYI, in your original version, I had a few lines of HTML followed by a line of plain text.

In the latest version I put the HTML in box one & plain text in box two. It would fade and message two never showed, fade back to one.

I put my whole original string in box one and other plain text in box two. Box one HTML fades, plain text stays, message two never shows. Leave box two empty and it doesn't fade.

I ran across this in a new installation. The problem was that the previous messages used a closed br ( <br /> ) and the / was preventing the code from working as it should. Change that to <br> allowed it to work. I haven't looked at why that fails but if you, anyone, has this problem, try removing the / to see if it helps.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

This addon provides a quick way to display messages in the header of a Bootstrap shop. It is a vert simple installation.

Jack;

I have installed the latest version of the message box (01/04/2017) and I love it, but the second box feature does not work.

If I set up the second box, I get the first box over and over.

I use just one box (first or second) and it works fine

Link to comment
Share on other sites

@@stevenlemon Did you make sure about the time settings and use closing slashes? Both are mentioned above. If you are not sure, change both messages to plain text and see if that works. Then, assuming it does, add some of the changes back in until it fails to find the problem.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 years later...

A new version has been uploaded with these changes:

  • Added code to automatically handle all languages so it is now possible to have a different message for each language.
  • Added code to allow messages to be loaded from the Information Pages SEO addon Just use INP_X, where X is the message ID.
  • Added an entry for the message text class so the font color can be changed.
  • Added an entry for the message text class so the font background color can be changed.
  • Added an option to allow the messages to be displayed in a box, as before, or in a circle.
  • Changed the code to use a textarea for the messages.
  • Changed the code to make it compatible with Phoenix.
  • Moved the css to the template file.

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

This is really useful as I can use it to display festive messages with nice pictures now. In our multi-racial home country, there are simply many occasions we need to greet the customers.  Thanks, Jack!

Link to comment
Share on other sites

@Jack_mcs

On 7/7/2019 at 11:22 AM, Jack_mcs said:

A new version has been uploaded with these changes:

  • Added code to automatically handle all languages so it is now possible to have a different message for each language.
  • Added code to allow messages to be loaded from the Information Pages SEO addon Just use INP_X, where X is the message ID.
  • Added an entry for the message text class so the font color can be changed.
  • Added an entry for the message text class so the font background color can be changed.
  • Added an option to allow the messages to be displayed in a box, as before, or in a circle.
  • Changed the code to use a textarea for the messages.
  • Changed the code to make it compatible with Phoenix.
  • Moved the css to the template file.

 

Thank you for your support of the Phoenix project!

M

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...