Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon} Superfish Categories Box


Recommended Posts

Get a copy of jQuery Migrate here. Upload it to your /ext/jquery/ directory. Add the following line just after the code you posted above in catalog/includes/template_top.php and admin/includes/template_top.php.

 

  <script type="text/javascript" src="ext/jquery/jquery-migrate-1.2.1.min.js"></script>

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Glad to hear that worked. Conflicts between multiple Javascript packages can be tricky to solve.

 

Regards

Jim

 

Hello Jim.

One more minor problem (the last one, I hope).

When I hover the mouse over one of the categories, the sub-categories is blocked by the arrow of my slideshow. How to move the sub-category to the front?

 

Best regards,

 

Wicara

Link to comment
Share on other sites

Hi Wicara,

 

Easiest way would be to change the z-index in the easy-slider css to 90

 

#slider1next, #slider1prev{

display:block;

width:30px;

height:77px;

position:absolute;

left:-30px;

top:53px;

z-index:90;

}

 

Regards

Joli

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi Jim,

 

Thanks for this addon. Unfortunately I have the "Cannot redeclare class language" issue :(

 

A quick fix to get it to install is to remove ALL modules from the "includes/modules/boxes" directory. I did a quick comparison of the accordion categories addon and noticed that you don't build a language array but in Superfish you do. Does anyone have a suggestion of where I can look or what I can remove to fix this issue?

 

My shop isn't heavily modified, I've only installed modular front page, accordion categories, product tabs and info box

 

Thanks

Link to comment
Share on other sites

Both the Accordion Box and the Superfish Box use language arrays, but they do it in different ways. This was a part of a series of attempts to fix the bug you are seeing, which I have never been able to reproduce. This means I'm shooting in the dark. Obviously this approach doesn't work very well.

 

Try installing either the Superfish or the Accordion box, and completely remove the files for the other. If one of them works, I can then concentrate on that as a fix. Otherwise, any additional information would be appreciated.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi Jim,

 

The accordion addon works fine, it's just the superfish one that has a problem with language

 

Something else I noticed is that the module I've selected before I choose the Superfish one throws the error, i.e. If I was on "Facebook All Activity" and then selected Superfish Categorories Box, the error in my www logs will reference bm_fball_activity

 

See below

 

PHP Fatal error:  include(): Cannot redeclare class language in /mywebfolder/includes/languages/english/modules/boxes/languages.php on line 17, referer: http://mywebaddress/admin/modules.php?set=boxes&list=new&module=bm_fball_activity

 

Hope that helps?

 

Thanks so much

Edited by jackhill
Link to comment
Share on other sites

Not really. This error makes no sense, and I can't even make it happen, so I'm working blind. Still, there are a few things I can try. To start, in includes/modules/boxes/bm_categories_superfish.php, find all instances of $this->languages_array and replace them with $languages_array.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Not really. This error makes no sense, and I can't even make it happen, so I'm working blind. Still, there are a few things I can try. To start, in includes/modules/boxes/bm_categories_superfish.php, find all instances of $this->languages_array and replace them with $languages_array.

 

Regards

Jim

 

Thanks, will attempt this tonight

Link to comment
Share on other sites

osCommerce does not handle categories with products differently from categories without products. You can adapt one of the "hidden" categories addons to do this for you.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Not really. This error makes no sense, and I can't even make it happen, so I'm working blind. Still, there are a few things I can try. To start, in includes/modules/boxes/bm_categories_superfish.php, find all instances of $this->languages_array and replace them with $languages_array.

 

Regards

Jim

 

Hi Jim, got it to work :)

 

Not sure if they were supposed to be in my module/boxes folders but removing language.php and currency.php fixed the issue

 

language and currency were the only two modules that didn't start with bm_ so I'm guessing (hoping) they were in the wrong place

 

Thanks for your help

Link to comment
Share on other sites

Hi

 

Just wondered if someine could give me a bit of quick guidance to make minor amendments to this great addon.

 

I'm trying to locate where I can reduce the size of the text on the sliding navigation buttons along with the color and also reduce the height of the buttons. I have a number of categories so the current height does make the user scroll quite a bit to get to the bottom of the list and I would like to reduce this if possible.

 

Many thanks in advance

Link to comment
Share on other sites

@@Digibooks

 

Hi Alan, if you look back through this thread you'll find some specific tips on how to modify your superfish menu. It's done through the stylesheets located here: /ext/jquery/superfish/css/superfish.css

 

For example this is an example of code that is in superfish.css

 

.sf-arrows li .sf-with-ul:after {
border-color: transparent transparent transparent #FFFFFF;
margin-right: -3px;
margin-top: -5px;

 

changing border-color, margin-right and margin-top give various effects. There's a lot you can do in the stylesheets.

 

A nice tool to accomplish this is firebug that you can use with the Firefox browser. The tool helps you find exactly in the code exactly what you need to change. You can do test changes in firebug to see what will happen even before you implement it.

 

Good luck.

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

Hi Alan,

 

When in development I added a bit of style to change the text colour post #76 for category sub category etc ....

 

http://www.oscommerce.com/forums/topic/393249-super-fish-navagation-menu-vertical-superfish/page__st__60

 

It is a bit messy but at the bottom there is extra code to define text colour commented with

 

/**** OSCOMMECE CUSTOMIZATION *****/

 

Now you are using firebug :thumbsup: just copy a bit of the code at the bottom of the superfish css and tweak to suit your site.

 

I believe the text colour is simply not defined so he takes probably from the jquery css files .

 

This is the css statement to define text colour example below

 

color: #FFFbd0;

 

As I say was only a test site but think you will probably find what you need in there.

 

Regards

Joli

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

Hi I am experiencing a weird thing in superfish. My site is protected by a simple php script that requires a login using a cookie. Once logged into the oscommerce program clicking on any product works fine but the first time I click on a category in the superfish I am taken back to the login page again (this is run from an include of the protection script as the first line of index.php). Logging in a second time then cures the problem and superfish runs fine. Any ideas what might be causing this?

Link to comment
Share on other sites

The links generated by Superfish are not getting cleared by your login script. If your protection script is in the first line of index.php, and Superfish runs in includes/template_top.php, this is likely. You need to move your protection to a point before the script generates the links. Of course this is all guesswork as I don't know what your script looks like.

 

Regards

Jim

 

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi Jim

 

Yes that actually makes sense ... the script is a simple one I found and it does say to put it as the first line of index.php:

 

<?php

 

###############################################################

# Page Password Protect 2.13

###############################################################

# Visit http://www.zubrag.com/scripts/ for updates

###############################################################

#

# Usage:

# Set usernames / passwords below between SETTINGS START and SETTINGS END.

# Open it in browser with "help" parameter to get the code

# to add to all files being protected.

# Example: password_protect.php?help

# Include protection string which it gave you into every file that needs to be protected

#

# Add following HTML code to your page where you want to have logout link

# <a href="http://www.example.com/path/to/protected/page.php?logout=1">Logout</a>

#

###############################################################

 

/*

-------------------------------------------------------------------

SAMPLE if you only want to request login and password on login form.

Each row represents different user.

 

$LOGIN_INFORMATION = array(

'zubrag' => 'root',

'test' => 'testpass',

'admin' => 'passwd'

);

 

--------------------------------------------------------------------

SAMPLE if you only want to request only password on login form.

Note: only passwords are listed

 

$LOGIN_INFORMATION = array(

'root',

'testpass',

'passwd'

);

 

--------------------------------------------------------------------

*/

 

##################################################################

# SETTINGS START

##################################################################

 

// Add login/password pairs below, like described above

// NOTE: all rows except last must have comma "," at the end of line

$LOGIN_INFORMATION = array(

'Member' => 'test',

'Admin' => 'test',

'Alan' => 'test',

'Michelle' => 'test'

);

 

// request login? true - show login and password boxes, false - password box only

define('USE_USERNAME', true);

 

// User will be redirected to this page after logout

define('LOGOUT_URL', 'http://www.digibooks.org.uk/');

 

// time out after NN minutes of inactivity. Set to 0 to not timeout

define('TIMEOUT_MINUTES', 0);

 

// This parameter is only useful when TIMEOUT_MINUTES is not zero

// true - timeout time from last activity, false - timeout time from login

define('TIMEOUT_CHECK_ACTIVITY', true);

 

##################################################################

# SETTINGS END

##################################################################

 

 

///////////////////////////////////////////////////////

// do not change code below

///////////////////////////////////////////////////////

 

// show usage example

if(isset($_GET['help'])) {

die('Include following code into every page you would like to protect, at the very beginning (first line):<br><?php include("' . str_replace('\\','\\\\',__FILE__) . '"); ?>');

}

 

// timeout in seconds

$timeout = (TIMEOUT_MINUTES == 0 ? 0 : time() + TIMEOUT_MINUTES * 60);

 

// logout?

if(isset($_GET['logout'])) {

setcookie("DBverify", '', $timeout, '/'); // clear password;

header('Location: ' . LOGOUT_URL);

exit();

}

 

if(!function_exists('showLoginPasswordProtect')) {

 

// show login form

function showLoginPasswordProtect($error_msg) {

?>

<html>

<head>

<title>Please enter password to access this page</title>

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

</head>

<body background="http://digibooks.org.uk/bookshelf/images/digibooks_logo.jpg">

<style>

input { border: 1px solid black; }

</style>

<div style="width:500px; margin-left:auto; margin-right:auto; text-align:center">

<form method="post">

<h3><br /><br /><br /><br /><br /><br /><br />Membership Access</h3>

<font color="red"><?php echo $error_msg; ?></font>

<?php if (USE_USERNAME) echo 'Login:<br /><input type="input" name="access_login" /><br />Password:<br />'; ?>

<input type="password" name="access_password" /><p></p><input type="submit" name="Submit" value="Submit" />

</form>

<br />

<a style="font-size:9px; color: #B0B0B0; font-family: Verdana, Arial;" href="http://www.zubrag.com/scripts/password-protect.php" title="Download Password Protector">Powered by Password Protect</a>

</div>

</body>

</html>

 

<?php

// stop at this point

die();

}

}

 

// user provided password

if (isset($_POST['access_password'])) {

 

$login = isset($_POST['access_login']) ? $_POST['access_login'] : '';

$pass = $_POST['access_password'];

if (!USE_USERNAME && !in_array($pass, $LOGIN_INFORMATION)

|| (USE_USERNAME && ( !array_key_exists($login, $LOGIN_INFORMATION) || $LOGIN_INFORMATION[$login] != $pass ) )

) {

showLoginPasswordProtect("Incorrect password.");

}

else {

// set cookie if password was validated

setcookie("DBverify", md5($login.'%'.$pass), $timeout, '/');

 

// Some programs (like Form1 Bilder) check $_POST array to see if parameters passed

// So need to clear password protector variables

unset($_POST['access_login']);

unset($_POST['access_password']);

unset($_POST['Submit']);

}

 

}

 

else {

 

// check if password cookie is set

if (!isset($_COOKIE['DBverify'])) {

showLoginPasswordProtect("");

}

 

// check if cookie is good

$found = false;

foreach($LOGIN_INFORMATION as $key=>$val) {

$lp = (USE_USERNAME ? $key : '') .'%'.$val;

if ($_COOKIE['DBverify'] == md5($lp)) {

$found = true;

// prolong timeout

if (TIMEOUT_CHECK_ACTIVITY) {

setcookie("DBverify", md5($lp), $timeout, '/');

}

break;

}

}

if (!$found) {

showLoginPasswordProtect("");

}

 

}

 

?>

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...