Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Brenden

Archived
  • Posts

    120
  • Joined

  • Last visited

Profile Information

Brenden's Achievements

  1. The catalog directory refers to oscommerce's root directory. (The directory with index.php)
  2. Hi Walt and plmx, I think Ive figured out the problem. You never open catalog/includes/main_page.tpl.php in your browser. The only files you ever open in your browser are in the catalog/ directory. Open catalog/index.php in your browser. Hope that Works. Brenden
  3. Hi Greg, There is no easy way to do that :(. There are only 3 files on the catalog side that still use the infoBox class. They are: catalog/includes/modules/also_purchased_products.php catalog/includes/modules/new_products.php catalog/includes/templates/content/shopping_cart.tpl.php Hopefully, in a future version of BTS these will also make use of templates instead of the infoBox class.
  4. Hi Wolf Gang, Each page has been split into 3 parts. Application Logic File, Template File, Content File. The 1st part, which is located in the catalog/ directory contains the application logic. This file is usually made by deleting everything between the last $breadcrumb->add statement and require(DIR_WS_INCLUDES . 'application_bottom.php'); and then adding 2 lines. These 1st of these 2 lines tells osCommerce what file is to be used for the content and the second line tells osCommerce what template file to use. For allprods.php this would look like this: <?php /* $Id: allprods.php,v 1.7 2002/12/02 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Copyright (c) 2002 HMCservices Released under the GNU General Public License */ require('includes/application_top.php'); include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ALLPRODS); // Set number of columns in listing define ('NR_COLUMNS', 1); // $breadcrumb->add(HEADING_TITLE, tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL')); $content = CONTENT_ALLPRODS; /* ------- file to be used for the content --------- */ require(DIR_WS_TEMPLATES . TEMPLATENAME_MAIN_PAGE); /* ------- template file to use ------------ */ require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> The 2nd part is the template file to be used. With the default install this is catalog/templates/main_page.tpl.php . Nothing needs to be done for this. The 3rd part is the file to be used for content. This file is placed in the catalog/templates/content/ directory and should be named the same as the application logic file except with a .tpl.php extention. This file is made by copying everything between: <!-- body_text //--> <td width="100%" valign="top"> and </td> <!-- body_text_eof //--> For allprods it would be named allprods.tpl.php and would look like this: <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td align="right"></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order"); while ($languages = tep_db_fetch_array($languages_query)) { $languages_array[] = array('id' => $languages['languages_id'], 'name' => $languages['name'], 'code' => $languages['code'], 'image' => $languages['image'], 'directory' => $languages['directory']); } for ($i=0; $i<sizeof($languages_array); $i++) { $this_language_id = $languages_array[$i]['id']; $this_language_name = $languages_array[$i]['name']; $this_language_code = $languages_array[$i]['code']; $this_language_image = $languages_array[$i]['image']; $this_language_directory = $languages_array[$i]['directory']; echo " <tr>n"; $products_query = tep_db_query("SELECT p.products_id, pd.products_name FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd WHERE p.products_id = pd.products_id AND p.products_status = 1 AND pd.language_id = $this_language_id ORDER BY pd.products_name"); $products_array = array(); while($products = tep_db_fetch_array($products_query)) { $products_array[] = array('id' => $products['products_id'], 'name' => $products['products_name']); } for ($j=0; $j<NR_COLUMNS; $j++) { echo " <td class=main valign="top">n"; for ($k=$j; $k<sizeof($products_array); $k+=NR_COLUMNS) { $this_products_id = $products_array[$k]['id']; $this_products_name = $products_array[$k]['name']; echo " <a href="" . tep_href_link(FILENAME_PRODUCT_INFO, 'name=' .str_replace("/", "/", rawurlencode($this_products_name)). '&products_id=' . $this_products_id . (($this_language_code == DEFAULT_LANGUAGE) ? '' : ('&language=' . $this_language_code)), 'NONSSL', false) . "">" . $this_products_name . "</a><br>n"; } echo " </td>n"; } echo " </tr>n"; } ?> </td> </tr> </table></td> </tr> <tr> <td align="right" class="main"><br><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> </tr> </table> To finish the install of any new page the file names have to be defined. Open catalog/includes/filenames.php and add the following lines: define('CONTENT_ALLPRODS', 'allprods'); define('FILENAME_ALLPRODS', CONTENT_ALLPRODS . '.php'); Use the rest of the allprods installation documentation the same.
  5. Hi David, There is no demo for this because the demo would look exactly the same as the osCommerce 2.2 MS2 demo. This contribution does not change the default look of the store in any way. Basic Template Structure (BTS) is designed to speed the development when changing the look of your store. Site wide changes can be made by editing one file, catalog/templates/main_page.tpl.php. You can take this a step further if you desire by editing catalog/templates/box.tpl.php. Editing this file will change the look of all info boxes in your store. Furthermore, seperate templates can be made of main_page.tpl.php so that certain pages in your store can have 3 columns, others can have 2 columns and others can have a single column. By making more box templates(box.tpl.php) each individual box can have its own look and feel. For an example of how to make a new box template see the install documentation.
  6. Chad, Thanks for the bug report :) . Hi gilesw, You are using an old version of the template structure. I would recommend downloading the new version here which says "07/16/2003 - BTSv1.zip. This is the updated version that works with osC 2.2 MS2.
  7. Tim, Thanks for all the help searching out bugs. I have more things planned for this contribution and I will be working on it in the future. Keep in mind that this is a template structure, not a template system. Once the template structure is completed the way I envision it(not far off) I may start work on using this in a template system. The problem is that it is not part of the oscommerce code and keeping something like that up to date is very time consuming. That said, I have no problem with anyone taking this code and making mods for it or upgrading it or doing anything they like with it. This is open source and released under GPL remember. Thanks again for the testing tim :D .
  8. Patches for BTS ver1.0 can be found here http://www.w3design.ca/files/ Hey Tim, If you want the stylesheet to change with the theme Open catalog/templates/main_page.tpl.php Change line 10 from <link rel="stylesheet" type="text/css" href="stylesheet.css"> to <link rel="stylesheet" type="text/css" href="<?php echo DIR_WS_TEMPLATES; ?>stylesheet.css"> Cut/Paste catalog/stylesheet.css to where DIR_WS_TEMPLATES is defined to be in catalog/includes/configure.php I would consider including something like this in the mod, however simplicity is one of the objectives of this contribution. With a couple minutes work this can be achieved for those who want it.
  9. Hi Tim, Thanks for the bug reports. Kind of embarrassing not noticing these bugs but there were alot of files touched by this contribution. Im going to make a patch for all known bugs and make it availible on my own web site, then once more time passes and all bugs are worked out ill release an updated version. Bug Report: Known files which the meta tag optimizor is not working for: create_account_success.php checkout_shipping.php checkout_payment.php checkout_payment_address.php checkout_confirmation.php checkout_success.php This shouldnt be difficult to do. Create directory catalog/templates/default/ Create directory catalog/templates/default/content/ Create directory catalog/templates/test/ Create directory catalog/templates/test/content/ Copy/Paste all files in catalog/templates/ to catalog/templates/default/ Cut/Paste all files in catalog/templates/ to catalog/templates/test/ Copy/Paste all files in catalog/templates/content/ to catalog/templates/default/content/ Cut/Paste all files in catalog/templates/content/ to catalog/templates/test/content/ Open catalog/includes/configure.php Change define('DIR_WS_TEMPLATES', 'templates/'); to define('DIR_WS_TEMPLATES', 'templates/default/'); Customize files in catalog/templates/test/ To test files in catalog/templates/test/ Open catalog/includes/configure.php Change define('DIR_WS_TEMPLATES', 'templates/default/'); to define('DIR_WS_TEMPLATES', 'templates/test/'); This works in theory not practice :) (Untested)
  10. Glad that's fixed Albert. Enjoy. Bug Report: catalog/includes/boxes/tell_a_friend.php Add this line immidiately after line 21: $boxContent .= '</form>' Not having the form close causes problems with any form after the tell a friend info box. (Usually languages and currencies infobox forms.) I will be updating the current release to reflect any bug fixes after more time passes.
  11. Warning: main(DIR_WS_TEMPLATESmain_page.tpl.php) The part where it says DIR_WS_TEMPLATES means that its not recognising the directory name. There is a problem with when you added these lines to configure.php define('DIR_WS_TEMPLATES', 'templates/'); define('DIR_WS_CONTENT', DIR_WS_TEMPLATES . 'content/'); define('DIR_WS_JAVASCRIPT', DIR_WS_INCLUDES . 'javascript/');
  12. Try taking the original catalog/includes/filenames.php file from the BTSv1.zip file and overwriting the one you currently have. If that doesnt work can you provide a url?
  13. Hi Albert, Double check that you installed all the files. Pay special attention to: catalog/index.php catalog/templates/main_page.tpl.php catalog/templates/content/index_default.tpl.php catalog/includes/filenames.php And double check that you have added the following lines to catalog/includes/configure.php define('DIR_WS_TEMPLATES', 'templates/'); define('DIR_WS_CONTENT', DIR_WS_TEMPLATES . 'content/'); define('DIR_WS_JAVASCRIPT', DIR_WS_INCLUDES . 'javascript/'); Note: Code must be added anywhere after this line of code(usually line 22): define('DIR_WS_INCLUDES', 'includes/');
  14. I will be supporting Basic Template Structure (BTS) ver1.0 in this thread: Please post any questions. Please review the install documentation before reporting bugs.
×
×
  • Create New...