Zen Cart Logo
Forums / General Questions / Prob a bizarre question - sounds

Prob a bizarre question - sounds

Locked

Views: 981

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
27 Jan 2007, 7:17 PM
#1
erica avatar

erica

Zen Follower

Join Date:
Jul 2006
Location:
Rotherham, UK
Posts:
126
Plugin Contributions:
0

Prob a bizarre question - sounds

Hiya,
i know this is probably a bit of a bizarre question, but the lady i am doing a site for has a candy shop in my village. She has one of those old fashioned bells on her door so when you walk into the shop thats the first thing you hear. She wants that sound to ring as you enter her online shop .. is this possible with a zen shop ?
Many Thanks
Erica xx

27 Jan 2007, 8:39 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Prob a bizarre question - sounds

The topic of sounds on a webpage is a delicate thing. They can be very irritating if not tastefully implemented.

You're looking for a case where you want it to appear only on the home page, most likely. And then probably only want it to sound "once" per visit. Or a combination of both ... it can sound on "any" page, but only once per visit. (You could get corny and have it sound on checkout-success too ... but that's stretching things.)

To do something like this would require custom coding, and the support of cookies in the customers' browser:

  • on every page, the system checks for the cookie -- if set, skip playing the sound.
  • if none is set, or exists but is expired, then play the sound

You could alternatively use PHP sessions to do a similar detection, which removes the cookie requirement, making your site more friendly to more security-conscious folks.

To do this, I'd suggest something like this, which you'll have to refine to your needs:

/includes/templates/YOURTEMPLATE/common/tpl_footer.php
at the very bottom, you'd add the code, which would look something like this:

<?php
  if (!isset($_SESSION['play_welcome'])) {
    $_SESSION['play_welcome'] = 1;
?>
.........insert HTML code to play the sound here .......
<?php
  }
?>

You'll need to research the most correct and cross-browser-compatible HTML code to use for playing the sound. Some browsers work well with an EMBED tag. Other browsers ignore those.

Oh ... and be sure the sound isn't too loud or obnoxious when recording it. Otherwise you may wonder why folks don't stick around online.

27 Jan 2007, 9:51 PM
#3
erica avatar

erica

Zen Follower

Join Date:
Jul 2006
Location:
Rotherham, UK
Posts:
126
Plugin Contributions:
0

Re: Prob a bizarre question - sounds

hiya DrByte, and thank you for the reply.
I fully agree with you about the fact that people would leave because of annoying noise .. i know that i do lol .. if i enter a site (any kind of site, not just a shop) and it has music or sounds on actions etc, then i close the site down and mark it as one to never visit again .. but she has asked on more than one occasion for this, so i had to check. I will show her your reply tho, and explain that a lot of people will be turned off by it.
Thanks again
Erica xx