Creating a new infobox in osCommerce 2.3.1
#1
Posted 29 November 2010 - 08:00 PM
If anyone could provide a simple, step-by-step guide I would be very grateful.
Thanks in advance.
#2
Posted 29 November 2010 - 10:30 PM
Working with osCommerce 2.3.1
Add-Ons so far Installed:
Add date and order number to invoice and packing slip,
Products Cycle Slideshow,
Detailed Monthly Sales,
Holiday Settings,
Tracking Module for 2.3
#3
Posted 29 November 2010 - 11:35 PM
- Copy catalog/includes/modules/boxes/bm_information.php and give it a new name.
- Edit that file and change bm_information to your new box name throughout that file.
- Change all of the constants that include _INFORMATION_ to include your new name instead. Keep them in all caps.
- Change the content to what you want in your new box. If you are using links to new files, keep the same format as the links in that box. The part that generates the box is in the execute() method.
- Copy catalog/includes/languages/english/modules/boxes/bm_information.php and give it a the same name as you did the file in step 1.
- Make the same changes to the constants in this file that you made in step 3.
- Upload your two new files.
- Go to your store Admin > Modules > Boxes and install your new module. Give it a sort order that will place it where you want it.
Regards
Jim
Banners Box 2.3.x Support
Categories Accordion Box 2.3.x Support
Categories Images Box 2.2x 2.3.x Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box 2.3.x Support
Get 1 Free 2.2x Support
jQuery Banner Rotator 2.2x 2.3.x Support
Modular Front Page 2.3.x Support
Modular SEO Header Tags 2.3.x Support
MVS 2.2x Support
PDF Datasheet 2.3.x Support
Price Updater 2.2x
Products Specifications 2.2x 2.3.x Development Version Support Bugs/Suggestions
Request a Review 2.2x - 2.3.x Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x Support
#4
Posted 30 November 2010 - 05:35 PM
Thanks a million for your guide. It worked perfectly.
At first I could not add the new infobox from the site admin pages, then I realized this was because I had not altered all the INFORMATION constants in the file catalog/includes/modules/boxes/newfile.php, specifically in the function "install".
Keep up the good work.
#5
Posted 15 December 2010 - 07:58 PM
kymation, on 29 November 2010 - 11:35 PM, said:
Go to your store Admin > Modules > Boxes and install your new module. Give it a sort order that will place it where you want it.
DUMP I made a typo mistake, all is fine.
Bennett
Edited by blr044, 15 December 2010 - 08:00 PM.
#6
Posted 21 December 2010 - 11:05 AM
I created a new box called bm_adbanner and i changed:
$data = 'blah' and sure enough blah showed up, but when i attempt to put an img src in there; it shows up as an X-box. If you right click the image it has the proper path for the file but has extra odd characters on the end of the file name; i do not think just putting an img src in the ' ' works.
can anyone help? Im sure there are lots of people who are looking to do the same thing.
#7
Posted 21 December 2010 - 11:09 AM
for those that may be dumb like me, you have to add <div class="img">
function execute() {
global $oscTemplate;
$data = '<div class="img"><img src="http://www.XXXXXXX.com/XXXXX/catalog/frontbanners/side_bar.jpg"></div>';
$oscTemplate->addBlock($data, $this->group);
}
cheers!
#8
Posted 31 December 2010 - 08:23 AM
I have done everything you have said and no dice.
when i go to install there is no name in the list and it gives my errors out the ying yang.
DO you ahve any other methods to get this done or am I just that big of noob lol.
Email me back
#9 ONLINE
Posted 31 December 2010 - 03:36 PM
aybc, on 21 December 2010 - 11:09 AM, said:
you have to add <div class="img">
function execute() {
global $oscTemplate;
$data = '<div class="img"><img src="http://www.XXXXXXX.com/XXXXX/catalog/frontbanners/side_bar.jpg"></div>';
$oscTemplate->addBlock($data, $this->group);
}
cheers!
I took a slightly different tack on this. I wouldn't have gotten there if it weren't for ErikMM, kymation and aybc's posts. Thank you all.
This code is in /catalog/includes/modules/boxes/bm_paypal_accepted.php, (the project I did was add an info box with a PayPal accepted logo inserted in the content area.) The format of the box, title etc remained the same as my other boxes.
Here's the code:
$data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_PAYPAL_ACCEPTED_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents">' . '<div class="img"><center><img src="/images/paypal/paypal_accepted.gif" alt="We accept credit cards through PayPal" border="0" width="100" height="100"></center></div>' . ' </div>' . '</div>';
The only thing not working is the alt= text, but for now the box image is what I wanted.
Anyway, to get there I used kymations instructions on creating a new info box, the used aybc's tip on inserting an image.
It looks like this:
[img]http://doggiesports.com/images/screenshot/PayPalBox.jpg[/img]
Thanks again to all.
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.
#10
Posted 31 December 2010 - 06:17 PM
[img]http://www.bjgrem.com/osc1.jpg[/img]
[img]http://www.bjgrem.com/osc2.jpg[/img]
Any ideas on what I'm doing wrong?
Edited by BenjaminJ.Gremillion, 31 December 2010 - 06:19 PM.
#11
Posted 31 December 2010 - 06:25 PM
$data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_PAYPAL_ACCEPTED_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents">' . ' <div class="img"><center>' . tep_image( DIR_WS_IMAGES . 'paypal/paypal_accepted.gif', 'We accept credit cards through PayPal', '100', '100' ) . '</center></div>' . ' </div>' . '</div>';Regards
Jim
Banners Box 2.3.x Support
Categories Accordion Box 2.3.x Support
Categories Images Box 2.2x 2.3.x Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box 2.3.x Support
Get 1 Free 2.2x Support
jQuery Banner Rotator 2.2x 2.3.x Support
Modular Front Page 2.3.x Support
Modular SEO Header Tags 2.3.x Support
MVS 2.2x Support
PDF Datasheet 2.3.x Support
Price Updater 2.2x
Products Specifications 2.2x 2.3.x Development Version Support Bugs/Suggestions
Request a Review 2.2x - 2.3.x Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x Support
#12
Posted 31 December 2010 - 06:32 PM
BenjaminJ.Gremillion, on 31 December 2010 - 06:17 PM, said:
Any ideas on what I'm doing wrong?
It's hard to tell without seeing the errors. Edit your admin/includes/application_top.php and change this line
error_reporting(E_ALL & ~E_NOTICE);to this
error_reporting(E_ALL);That will give you a better idea of what's going wrong.
Regards
Jim
Banners Box 2.3.x Support
Categories Accordion Box 2.3.x Support
Categories Images Box 2.2x 2.3.x Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box 2.3.x Support
Get 1 Free 2.2x Support
jQuery Banner Rotator 2.2x 2.3.x Support
Modular Front Page 2.3.x Support
Modular SEO Header Tags 2.3.x Support
MVS 2.2x Support
PDF Datasheet 2.3.x Support
Price Updater 2.2x
Products Specifications 2.2x 2.3.x Development Version Support Bugs/Suggestions
Request a Review 2.2x - 2.3.x Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x Support
#13
Posted 31 December 2010 - 06:38 PM
class bm_quick_order {
var $code = 'bm_quick_order';
var $group = 'boxes';
var $title;
var $description;
var $sort_order;
var $enabled = false;
function bm_search() {
$this->title = MODULE_BOXES_QUICK_ORDER_TITLE;
$this->description = MODULE_BOXES_QUICK_ORDER_DESCRIPTION;
if ( defined('MODULE_BOXES_QUICK_ORDER_STATUS') ) {
$this->sort_order = MODULE_BOXES_QUICK_ORDER_SORT_ORDER;
$this->enabled = (MODULE_BOXES_QUICK_ORDER_STATUS == 'True');
$this->group = ((MODULE_BOXES_QUICK_ORDER_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');
}
}
function execute() {
global $oscTemplate;
$data = '<div class="ui-widget infoBoxContainer">' .
' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_QUICK_ORDER_BOX_TITLE . '</div>' .
' <div class="ui-widget-content infoBoxContents">' .
' ' . tep_draw_form('quick_order', tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL', false), 'get') .
' ' . tep_draw_input_field('item', '', 'size="10" maxlength="30" style="width: 75%"') . ' ' . tep_image_submit('button_quick_order.gif', MODULE_BOXES_QUICK_ORDER_BOX_TITLE) . '<br />' . MODULE_BOXES_QUICK_ORDER_BOX_TEXT .
' </form>' .
' </div>' .
'</div>';
$oscTemplate->addBlock($data, $this->group);
}
function isEnabled() {
return $this->enabled;
}
function check() {
return defined('MODULE_BOXES_QUICK_ORDER_STATUS');
}
function install() {
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Quick Order Module', 'MODULE_BOXES_QUICK_ORDER_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_QUICK_ORDER_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_QUICK_ORDER_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
}
function remove() {
tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
function keys() {
return array('MODULE_BOXES_QUICK_ORDER_STATUS', 'MODULE_BOXES_QUICK_ORDER_CONTENT_PLACEMENT', 'MODULE_BOXES_QUICK_ORDER_SORT_ORDER');
}
}
And here's the code for catalog\includes\languages\english\modules\boxes\bm_quick_order.php
define('MODULE_BOXES_QUICK_ORDER_TITLE', 'Quick Order');
define('MODULE_BOXES_QUICK_ORDER_DESCRIPTION', 'Quick Order');
define('MODULE_BOXES_QUICK_ORDER_BOX_TITLE', 'Quick Order');
define('MODULE_BOXES_QUICK_ORDER_BOX_TEXT', '');
EDIT- Thanks, Jim. I'll give that a shot and see.
Edited by BenjaminJ.Gremillion, 31 December 2010 - 06:40 PM.
#14
Posted 31 December 2010 - 06:50 PM
#15 ONLINE
Posted 31 December 2010 - 06:55 PM
kymation, on 31 December 2010 - 06:25 PM, said:
$data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_PAYPAL_ACCEPTED_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents">' . ' <div class="img"><center>' . tep_image( DIR_WS_IMAGES . 'paypal/paypal_accepted.gif', 'We accept credit cards through PayPal', '100', '100' ) . '</center></div>' . ' </div>' . '</div>';Regards
Jim
Thanks you Jim, that did the trick. Much appreciated.
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.
#16
Posted 31 December 2010 - 07:05 PM
#17
Posted 05 January 2011 - 07:37 AM
after following the steps my boxes strarted to uninstall themselfs.. NO JOKES!!!
now i cant re add catergories or best seller
these are the errors that are displayed
Warning: reset() [function.reset]: Passed variable is not an array or object in /home/automodi/public_html/shop/blair1/modules.php on line 227
Warning: Variable passed to each() is not an array or object in /home/automodi/public_html/shop/blair1/modules.php on line 228
Iv even removed the newly installed boxes and the issue stays the same
Any help would be amazing
#18
Posted 05 January 2011 - 05:31 PM
This may have been caused by an error in your new module. The most common cause is a constant declared in the install() method that is not also declared in the keys() method.
Regards
Jim
Banners Box 2.3.x Support
Categories Accordion Box 2.3.x Support
Categories Images Box 2.2x 2.3.x Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box 2.3.x Support
Get 1 Free 2.2x Support
jQuery Banner Rotator 2.2x 2.3.x Support
Modular Front Page 2.3.x Support
Modular SEO Header Tags 2.3.x Support
MVS 2.2x Support
PDF Datasheet 2.3.x Support
Price Updater 2.2x
Products Specifications 2.2x 2.3.x Development Version Support Bugs/Suggestions
Request a Review 2.2x - 2.3.x Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x Support
#19
Posted 05 January 2011 - 06:22 PM
kymation, on 05 January 2011 - 05:31 PM, said:
This may have been caused by an error in your new module. The most common cause is a constant declared in the install() method that is not also declared in the keys() method.
Regards
Jim
this is basically my 1st Oscommerce template iv ever modified so could you maybe explain in more simple terms for me
highly appreciated
Blair
#20
Posted 05 January 2011 - 09:39 PM
Regards
Jim
Banners Box 2.3.x Support
Categories Accordion Box 2.3.x Support
Categories Images Box 2.2x 2.3.x Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box 2.3.x Support
Get 1 Free 2.2x Support
jQuery Banner Rotator 2.2x 2.3.x Support
Modular Front Page 2.3.x Support
Modular SEO Header Tags 2.3.x Support
MVS 2.2x Support
PDF Datasheet 2.3.x Support
Price Updater 2.2x
Products Specifications 2.2x 2.3.x Development Version Support Bugs/Suggestions
Request a Review 2.2x - 2.3.x Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x Support









