Latest News: (loading..)
kymation

[Addon} Modular Front Page

1,395 posts in this topic

This addon is designed to make changes to the front page of an osCommerce store easy and simple. It is particularly intended for new users of the software, but can be used by anybody.

 

Elements in the center section of the page can be added, removed, and reordered from the Admin panel. No code editing is needed unless the site has been modified already, in which case only two simple edits are needed.

 

Nine modules are provided with the initial release. More modules and upgrades are planned for future releases.

 

Code as soon as an admin approves it....

 

Regards

Jim

Edited by kymation
zediks and tomshaft like this

Share this post


Link to post
Share on other sites

Download the package here. This is an updated package, so anyone using the original version will need to replace some files. If you do replace a module, uninstall it first before upgrading, then reinstall.

 

This Addon modified only one file: catalog/index.php. All other files are new and can be uploaded to your server without disturbing any other changes. If you have not modified index.php you can upload that one as well and overwrite your existing file.

 

Regards

Jim

Share this post


Link to post
Share on other sites

Here's a list of the modules that are included in this package. The first 5 duplicate the features of the stock osCommerce front page. These modules just make it much easier to change, rearrange, or remove parts of that page.

  • Customer Greeting. This shows the greeting message.
  • Heading Title. This shows a title, usually at the top of the page.
  • New Products. This shows the New Products for <month> box.
  • Text main. This shows a block of text. The default on the osC front page is empty, but the code is still there.
  • Upcoming products. This shows the Upcoming Products box. This is also empty in a default osC shop because no products have been set with a future date.

I've also included 4 new modules. Most of these are similar to other Addons, they have just been converted into modules to make them easier to use.

  • Banner Rotator. This module shows a series of graphics (images) that fade into each other at a set interval.
  • Categories Images. This shows an image and the category name for each of your top-level categories. Subcategories can be listed underneath.
  • Featured Products. This shows a configurable number of products that you select.
  • Specials. This shows a configurable number of your store's specials.

These modules have been designed for ease of use. Some additional features are planned when I have the time to code them. Suggestions for new features and new modules are welcome. I don't promise that I'll do what you want, but I will listen.

 

Also, feel free to code your own modules and add them here or in a new Addon. The more the better.

 

Regards

Jim

Edited by kymation

Share this post


Link to post
Share on other sites

This looks really promising! I've run into a small problem though.

 

Modified the index.php with winmerge as you suggested and uploaded all the new files, but now I can no longer log into the admin panel.

 

Any ideas?

Share this post


Link to post
Share on other sites

This shouldn't have anything to do with either of the Admin password protection schemes. Which one are you using, and what do you get when you try?

 

Regards

Jim

Edited by kymation

Share this post


Link to post
Share on other sites

This shouldn't have anything to do with either of the Admin password protection schemes. Which one are you using, and what do you get when you try?

 

Regards

Jim

 

I have no additional password protection active.

 

When I try to login there's only a white screen on /admin/login.php

 

After restoring my backup I can login again.

 

Maybe I missed something, you wrote here that 2 simple edits are needed but Winmerge only found 1 for me?

 

/*
 $Id$
 $Mod: Modular Front Page 201111 Kymation $

 osCommerce, Open Source E-Commerce Solutions

 

I'm using Osc 2.3.1 if that helps.

 

Cheers

Share this post


Link to post
Share on other sites

The current version needs only one edit: catalog/index.php. Nothing that you do to that file will cause problems in the Admin. Unless you uploaded that file to the admin instead of the catalog side, in which case it will cause havoc.

 

You're getting some sort of error in your Admin. Without knowing the error it's impossible to tell what's wrong. I suggest that you edit catalog/admin/includes/application_top.php, line 17:

  error_reporting(E_ALL & ~E_NOTICE);

and change that to:

  error_reporting(E_ALL);

That should show an error message when you try to log in.

 

Regards

Jim

Share this post


Link to post
Share on other sites

OK, this one was my fault. I managed to put one file in the wrong place. My bad. I've uploaded a new copy with the problem fixed.

 

The easiest fix is to upload all of the files in the admin section again, overwriting the previous files. That should fix the Admin errors.

 

Regards

Jim

Share this post


Link to post
Share on other sites

The current version needs only one edit: catalog/index.php. Nothing that you do to that file will cause problems in the Admin. Unless you uploaded that file to the admin instead of the catalog side, in which case it will cause havoc.

 

You're getting some sort of error in your Admin. Without knowing the error it's impossible to tell what's wrong. I suggest that you edit catalog/admin/includes/application_top.php, line 17:

  error_reporting(E_ALL & ~E_NOTICE);

and change that to:

  error_reporting(E_ALL);

That should show an error message when you try to log in.

 

Regards

Jim

 

Aaah sorry for the slow reply, had to do some research on how to get it to show hehe.

 

Got the new files now and I can login now!

 

Thanks alot for the help!

Edited by Calle-

Share this post


Link to post
Share on other sites

Tried adding a few different modules but got some more errors:

 

Notice: Constant MODULE_FRONT_PAGE_SPECIALS_SORT_ORDER already defined in /customers/mydomain.eu/mydomain.eu/httpd.www/admin/includes/application_top.php on line 68 Notice: Constant MODULE_FRONT_PAGE_SPECIALS_STATUS already defined in /customers/mydomain.eu/mydomain.eu/httpd.www/admin/includes/application_top.php on line 68 Notice: Constant MODULE_FRONT_PAGE_SPECIALS_FRONT_TITLE already defined in /customers/mydomain.eu/mydomain.eu/httpd.www/admin/includes/application_top.php on line 68 Notice: Constant

 

 

MODULE_FRONT_PAGE_SPECIALS_MAX_DISPLAY already defined in /customers/mydomain.eu/mydomain.eu/httpd.www/admin/includes/application_top.php on line 68 Notice: Constant MODULE_FRONT_PAGE_SPECIALS_COLUMNS already defined in /customers/mydomain.eu/mydomain.eu/httpd.www/admin/includes/application_top.php on line 68 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /customers/mydomain.eu/mydomain.eu/httpd.www/admin/includes/application_top.php:68) in /customers/mydomain.eu/mydomain.eu/httpd.www/admin/includes/functions/sessions.php on line 102 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /customers/mydomain.eu/mydomain.eu/httpd.www/admin/includes/application_top.php:68) in /customers/mydomain.eu/mydomain.eu/httpd.www/admin/includes/functions/sessions.php on line 102 Warning: Cannot modify header information - headers already sent by (output started at /customers/mydomain.eu/mydomain.eu/httpd.www/admin/includes/application_top.php:68) in /customers/mydomain.eu/mydomain.eu/httpd.www/admin/includes/functions/general.php on line 34

 

When I try to login on the admin panel I get those two combined now.

Share this post


Link to post
Share on other sites

That can be caused by adding a module without removing it first, or by database corruption. Look at your configuration table, near the end. There should be several entries starting with MODULE_FRONT_PAGE_. Delete all of them, then log out of your Admin page and log back in. That should fix the errors.

 

Regards

Jim

Share this post


Link to post
Share on other sites

1054 - Unknown column 'c.categories_visible' in 'where clause'

 

I get this error when the categories image module is installed. There is nowhere that says to add this column in the sql.

Share this post


Link to post
Share on other sites

This is on a brand new implementation of 2.3.1 without any mods...

 

After installation of Category Images module and setting the Box Style to Float I receive the following error when attempting to view the main page:

 

1054 - Unknown column 'c.categories_visible' in 'where clause'

 

select c.categories_id, cd.categories_name from categories_description cd join categories c on c.categories_id = cd.categories_id where c.parent_id = 1 and cd.language_id = '1' and c.categories_visible = '1' order by c.sort_order

 

Also when I set the Box Style to Rows the main page alignment is completely messed up and it only shows the 1st category image.

 

After installation of Featured Products module and selecting EDIT from admin I get the following error:

 

Fatal error: Call to undefined function tep_cfg_pull_down_products() in \admin\modules.php(232): eval()'d code on line 1

Share this post


Link to post
Share on other sites

I fixed a couple of bugs in the Categories Images module. Thanks to both of you for reporting these. The new version is now available for download. Please uninstall your modules before uploading new copies. If you want to save on the upload, the only change is to catalog/includes/modules/front_page/categories_images.php.

 

The error reported by the Featured Products module is due to a missing file: catalog/admin/includes/functions/modules/front_page/featured.php. Please check that you have this file installed.

 

Regards

Jim

Share this post


Link to post
Share on other sites

OK, that was really a bug in the Featured module. Fixed and (another) new package has been uploaded. Sorry about the confusion, I seem to be messing up a lot here. Hopefully I can get all of the modules working before version 1.1.999.

 

Thanks again to all of my unwitting Beta testers.

 

Regards

Jim

Share this post


Link to post
Share on other sites

HI

Some of the problem has been resolved, thanks. I have some alignment issue as can be seen here electricalcity dot co dot uk.

 

 

There is also a spelling error in admin, when installing the categories module

Control the appearance of the specials module on the front page. and Fload mode only)

Share this post


Link to post
Share on other sites

Obviously I need a spellchecker. Thanks; I'll go fix that one.

 

The alignment problem means that you need to go play with the stylesheet settings in catalog/ext/modules/categories_images/stylesheet.css. The subcategories list doesn't work well with a fixed width box, so I suggest that you start by deleting the width: 110px; from the imageBox class. You may also need to add some left padding to the link_column class.

 

Regards

Jim

Share this post


Link to post
Share on other sites

The w3C validator is saying some divs and spans are in the wrong places. I will have a look tomorrow when my head is working again.

Share this post


Link to post
Share on other sites

line 133 in categories_images.php should read

 

$categories_content .= '<span class="imageBox" id="box_' . $box_number . '"';

 

(the original has the "" missing around imagebox)

Share this post


Link to post
Share on other sites

line 177 should read

 

 

$categories_content .= '<div class="link_column"><a href="' . tep_href_link( FILENAME_DEFAULT, 'cPath=' . $category['id'] . '_' . $subcategories['categories_id']) . '" class="category_link_sub">' . $subcategories['categories_name'] . '</a></div>';

 

(original has an extra" near category_link_sub">)

Share this post


Link to post
Share on other sites

Yes, I used a span where I should have used a div. Good catch. Fixed. That didn't fix the display problem that you saw, so I added a bit of padding to the stylesheet. You may need to make more changes to make it look good with your settings and theme; there's only so much I can do to cover the general case.

 

Uploaded Version 1.1.4. Creeping up on that 999 bugfix estimate.... :blush: :-"

 

Regards

Jim

Share this post


Link to post
Share on other sites

Caught the typo on line 177 too; or rather the validator did. It's hard to get all of the possible configurations validated, so I expect that I've missed more than this. Thanks for reporting that one.

 

Regards

Jim

Share this post


Link to post
Share on other sites

Hi Jim,

 

Great work, i like this module and still working on it. If you can add the flash carousel into this package would be perfect!

 

Waiting for your reply,

 

Thanks again,

 

Andy,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now