Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to Add a new box and a couple of new pages to OSCommerce


chrishamblin

Recommended Posts

Posted

How to add a new box with two new pages in OScommerce.

 

Before you start, of course BACK UP YOUR STORE.

 

First, we are going to create your new Box.

 

Go to the catalog\includes\boxes\ directory.

 

Open “information.php”, and save as a new file.

I’ll call mine “support.php

 

In your new support.php file, find

$info_box_contents[] = array('text' => BOX_HEADING_INFORMATION);

and replace it with:

$info_box_contents[] = array('text' => BOX_HEADING_SUPPORT);

 

Then, find

 

  $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');

 

And replace it with:

  $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_USER_GUIDES) . '">' . BOX_SUPPORT_USER_GUIDES . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_DRIVERS) . '">' . BOX_SUPPORT_DRIVERS . '</a><br>');

 

Open “catalog\includes\coloum_left.php

Insert the line

 

  require(DIR_WS_BOXES . 'support.php');

 

where ever you’d like your new box to be.

 

Open “catalog\includes\languages\english.php”

 

At around line 122 you should see

 

// information box text in includes/boxes/information.php

 

After that section, add a new one

 

// support box text in includes/boxes/support.php
define('BOX_HEADING_SUPPORT', 'Product Support');
define('BOX_SUPPORT_USER_GUIDES', 'User Guides');
define('BOX_SUPPORT_DRIVERS', 'Software Drivers');

 

If you save everything now, you should have new box on the left called support , with two links, one to User Guides, and one to Software Drivers.

 

Now you just need to create the pages these links want to point at.

For that take inspiration from http://www.oscommerce.com/forums/topic/40982-how-to-add-a-new-pages-to-osc/

 

Go to your catalog folder and open shipping.php.

Save this as user_guides.php.

Re open shipping.php and save it as drivers.php

 

Change the following:

In user_guides.php, line 3, change

  $Id: shipping.php 1739 2007-12-20 00:52:16Z hpdl $

To

  $Id: user_guide.php 1739 2007-12-20 00:52:16Z hpdl $

At line 15, change

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHIPPING);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHIPPING));

to

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_USER_GUIDE);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_USER_GUIDE));

 

Repeat for drivers.php, swapping user_guide for drivers.

 

Go to /catalog/includes/languages/your_language/ and find shipping.php

 

Once more, open this and save as “user_guide.php” and “drivers.php

Edit these two pages to what you’d like them to look like.

 

Finally, open “catalog\includes\filenames.php

 

At the bottom of the list of defined files, add:

 

  define('FILENAME_USER_GUIDES', 'user_guides.php');
 define('FILENAME_DRIVERS', 'drivers.php');

 

That’s it.

You now have two new pages and a new box.

These new links also should have the vital “osCsid” so your customer doesn’t lose whatever they were doing.

 

If this is already on the forum, sorry for reposting.

If it's not, I hope that it helps someone out. I know that I was looking for this kind of thing and couldn't find it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...