Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon] Generic Box


kymation

Recommended Posts

This addon produces a box in the left or right column. You can put text, images, or scripts in this box. It's ideal for adding credit card information, security logos, or important text to your osCommerce pages. The title and/or contents of the box can be linked to any other page for more information.

 

The one thing that you cannot do with this box is a list of links (like the Information box.) You can add a link list by copying the Information box and modifying it. There is a guide to doing that here.

 

The distribution is available here.

 

Regards

Jim

Edited by kymation

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

Link to comment
Share on other sites

Hi,

 

when i changed the "sort order" to some other number beside 1000, i.e 1090 or any #, it display an error below

 

Fatal error: Cannot redeclare class language in /home/mc/public_html/example.com/includes/classes/language.php on line 16

 

Can you show me how to fix this error? Thanks

Link to comment
Share on other sites

That's very odd. I have my test box set to 1090 right now. No errors. Are you using the latest version? I put up an old design by mistake, then corrected it in the latest release. Check that the download is generic_box_1.0.2.tar.gz.

 

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

 

I had the same problem

 

Fatal error: Cannot redeclare class language in C:\xampp\htdocs\ccb231\includes\classes\language.php on line 16

 

I uninstalled the box and then re-installed it and now its working fine.

 

I hope this helps you find the problem.

 

Regards

 

Ken

Link to comment
Share on other sites

Try this: In catalog/includes/modules/boxes/bm_generic.php, find these lines and comment out or delete them:

     unset($language_class);
     unset($languages);
     unset($language);

Let me know if that helps.

 

Regards

Jim

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

Link to comment
Share on other sites

OK, another test. Find this code:

     $language_class = new language;
     $languages = $language_class->catalog_languages;

and replace it with:

     $bm_generic_language_class = new language;
     $languages = $bm_generic_language_class->catalog_languages;

Let me know if that changes anything.

 

Regards

Jim

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

Link to comment
Share on other sites

OK, another test. Find this code:

     $language_class = new language;
     $languages = $language_class->catalog_languages;

and replace it with:

     $bm_generic_language_class = new language;
     $languages = $bm_generic_language_class->catalog_languages;

Let me know if that changes anything.

 

Regards

Jim

 

same thing happens still

 

it always shows this error below

 

Fatal error: Cannot redeclare class language in /home/mc/public_html/example.com/includes/classes/language.php on line 16

Link to comment
Share on other sites

There's something really wrong here. We're not redeclaring a class, so the error message is highly suspect. Then it points to Line 16 of includes/classes/language.php which is a blank line. It appears that you have done something to that file. Try replacing it with a clean copy from the osCommerce distribution and see what happens.

 

Regards

Jim

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

Link to comment
Share on other sites

Then you've made the same error that the original poster made. Start by removing both files and reinstalling them from the distribution. Uninstall and reinstall the box. If you are still having problems, then copy and paste the error message here.

 

Regards

Jim

Edited by kymation

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

Link to comment
Share on other sites

Gentleman,

I am getting the same error message after installing the module. I am using OScommerce 2.3.1

Fatal error: Cannot redeclare class language in /home/bentonsc/public_html/includes/classes/language.php on line 16

 

Here is my install info:

osCommerce Online Merchant v2.3.1

PHP Version 4.4.8

Link to comment
Share on other sites

There are two things that can cause this:

 

1. You put a file in the wrong place. This will happen here if you put the file that belongs in catalog/includes/modules/ in catalog/includes/languages/english/modules/.

 

2. You made a mistake editing a file and put something in twice. There are no edits in this Addon, so it would have to be something else that you added.

 

OK, there is actually one more:

 

3. PHP is throwing the wrong error and this has nothing to do with the language class or probably with any other class. This is extremely rare but it happens.

 

I'd bet on number 1 if I were inclined to gamble.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 2 weeks later...

You can copy this box and make some minor changes to the files.

1. Copy both files and rename them to bm_generic_2.php. Keep the copies in the same directories as the originals.

2. Using search-and-replace in your editor, set to Case Sensitive, change bm_generic to bm_generic_2 in both files.

3. Again using search-and-replace, change _GENERIC_ to _GENERIC_2_

4. Change Enable Generic Module to Enable Generic Module 2 on Line 98 of the code file..

 

Make similar changes for additional copies. Once you have all the changes made, upload and install the boxes.

 

Regards

Jim

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

Link to comment
Share on other sites

Jim,

 

great contrib but only 1 small issue.

I have dutch language installed, double/triple/quadruple checked chcked teh files and all are installed properly.

Also in admin all green checks not a single red cross.

In English i get the box prefectly but in Dutch i get the language error and i cannot figure out why.

Running OCS 2.3.1 locally (still testing).

 

Any chance you can help me out with this one?

crossing out the language calling makes teh box disappear on both languages.

 

Thanks

Edgar

Everything is conditional, you just can't always anticipate the conditions.

Link to comment
Share on other sites

First, check that your language is installed properly. Is the language name in your Admin >> Localization >> Languages exactly the same as the directory name the language files are in?

 

Regards

Jim

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

Link to comment
Share on other sites

Jim,

 

Name there is "Nederlands", folder of the languagefiles is "dutch" and the language Nederlands is referring to the folder "dutch".

 

In the generic boxes via admin control panel i have 2 boxes to fill, 1 for English and 1 for Nederlands.

 

If i rename the language Nederlands in admin localisation languages or directly in my database to "dutch" i only have the English generic box left.

In my shop in English i see the box, in Nederlands i keep getting the language error :

Warning: constant() [function.constant]: Couldn't find constant MODULE_BOXES_GENERIC_CONTENT_DUTCH in 
D:\wamp\www\dutch test\includes\modules\boxes\bm_generic.php on line 49

 

What is going wrong here?

Everything is conditional, you just can't always anticipate the conditions.

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