Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

BTSv1.2 Support


paulm2003

Recommended Posts

  • Replies 377
  • Created
  • Last Reply

Top Posters In This Topic

Hello,

 

I want everyone to know that I couldn't get the contribution to run on my site, but I got it working somewhere else. If you want to add a new look for the oscommerce, please look in the contribution. There are lots of templates and lots of people to help. IF you need any help with anything else just contact me via PM and I will see what I could do. Have a good day!

Link to comment
Share on other sites

Don't try to do install mods at 2:30 a.m.!
:lol: Same problem here, until 1:30 a.m. I'm at my best, the trouble is I never know when to stop.

 

There are lots of templates
A lot of templates exist of course (on the shops which are driven by osC+BTS, and for sale), or do you mean there are other templates available (for free) besides the included ones? I was hoping that someone would make a nice (and different) looking template available for download but, as far as I know, it hasn't happened yet. Edited by paulm2003
Link to comment
Share on other sites

Some time ago I created a link from the image popup back to the product_info.php page (and there also is a close window link in the code below, "invented" by someone else).

 

The point is that if someone enters your popup image from the outside (i.e. entering it through google) without a link to the product page, they might not know how to enter your shop because they only see the popup window.

 

Today, after reading a post by Burt about the subject, I could simplify the code a little (before that I changed the popup page query to retreive the $products_id but this appeared to be overkill since $pID already was available :rolleyes: ) so i decided to post it.

 

example of popup_image.tpl.php

<?php
echo '<div id="imagePopup">';

if (isset($pID))
{ // link back to this products info page (target="_blank" because we don't want it inside the popup window)
 echo '<a target="_blank" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $pID) . '">'.$products[products_name].'</a>';
 echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']);
 echo '<a id="closePopup" href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>';
}
else
{
 // a link to the index page if the products id is unknown somehow
 echo '<a target="_self" href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . '"><h1>www.yourdomain or whatever you like</h1></a>';
}

echo '</div>';
?>

BTS only example of course (but probably also very easy to implement without BTS)

Link to comment
Share on other sites

Morning Paul -

 

It's past 2am so you may be sleeping at this time... as should I. I've just installed the latest version of osc and bts1.2 with the latest patches. I've also ran the sql successfully. I'm currently getting the error:

 

Warning: main(templates/content/main_page.tpl.php): failed to open stream: No such file or directory in /www/catalog/index.php on line 150

 

Fatal error: main(): Failed opening required 'templates/content/main_page.tpl.php' (include_path='.:/usr/local/share/pear:/usr/local/lib/php') in /www/catalog/index.php on line 150

 

I've been looking for the answer through the forum and I'm not finding the answer to my problem. I saw that one gentleman changed his directory from 'css' to 'CSS', but in a reply, you mentioned that chagne wasn't needed. Any help woould be appreciated.

 

Thanks

Keeping the Faith -

Franklyn

Link to comment
Share on other sites

I checked configure_bts.php and all seems to be in order:

 

<?php

// BTS defines added 2003/12/23

define('DIR_WS_TEMPLATES', $tplDir . '/' );

define('DIR_WS_CONTENT', DIR_WS_TEMPLATES . 'content/');

define('DIR_WS_JAVASCRIPT', DIR_WS_INCLUDES . 'javascript/');

define('DIR_WS_BOX_TEMPLATES', DIR_WS_TEMPLATES . 'boxes/');

// define the templatenames used in the project

define('TEMPLATENAME_BOX', 'box.tpl.php');

define('TEMPLATENAME_MAIN_PAGE', 'main_page.tpl.php');

define('TEMPLATENAME_POPUP', 'popup.tpl.php');

define('TEMPLATENAME_STATIC', 'static.tpl.php');

 

?>

 

 

and I alsp checked the application_top.php but am not sure what I'm looking for there.

Keeping the Faith -

Franklyn

Link to comment
Share on other sites

Good morning -

 

I thought that I would try to clearify the problem I'm having with the current setup.

 

I've done a clean install of BTS and of OSC. Everything seems to work just fine, however,

when I change to the content template, I get the following errors:

 

Warning: main(templates/content/main_page.tpl.php): failed to open stream: No such file or directory in /www/catalog/index.php on line 150

Fatal error: main(): Failed opening required 'templates/content/main_page.tpl.php' (include_path='.:/usr/local/share/pear:/usr/local/lib/php') in /www/catalog/index.php on line 150

 

 

I can see the file, but I'm not understanding why I'm getting the error. I've read through

the forum with hopes of gaining a better understanding, but it's still not clear. Any thoughts?

Keeping the Faith -

Franklyn

Link to comment
Share on other sites

Warning: main(templates/content/main_page.tpl.php): failed to open stream: No such file or directory in /www/catalog/index.php on line 150

Fatal error: main(): Failed opening required 'templates/content/main_page.tpl.php' (include_path='.:/usr/local/share/pear:/usr/local/lib/php') in /www/catalog/index.php on line 150

Hi Franklyn,

 

I am a bit tired now and I don't fully understand what is happening. But there's one thing that suprises me:

templates/content/main_page.tpl.php
Why is your templates directory called "content"? Allthough this is a valid name of course, I suspect it has something to do with your problem.

 

hth

Paul

Link to comment
Share on other sites

there's one thing that suprises me:
templates/content/main_page.tpl.php
Why is your templates directory called "content"? Allthough this is a valid name of course, I suspect it has something to do with your problem.

I will try to explain what I ment last night.

 

main_page.tpl.php I would expect at for example (i.s.o. "CSS" fill in another templates directory if you changed the settings):

templates/CSS/main_page.tpl.php

 

and in:

 

"templates/CSS/content/"

the templates for the "middle content area" should reside for example

 

"templates/content/" is the directory where the BTS1.0 and BTS1.1 content files where stored

Link to comment
Share on other sites

I have post this problem somewhere else. But seems like this would be the better place. Sorry for post twice.

 

I have a problem to make the BTS V1.2 works.

 

Here is the error message:

Warning: main(templates/CSS/content/CONTENT_INDEX_DEFAULT.tpl.php): failed to open stream: No such file or directory in /hsphere/local/home/amyqzus/qnk.us/templates/CSS/main_page.tpl.php on line 46

 

Fatal error: main(): Failed opening required 'templates/CSS/content/CONTENT_INDEX_DEFAULT.tpl.php' (include_path='.:/usr/local/lib/php') in /hsphere/local/home/amyqzus/qnk.us/templates/CSS/main_page.tpl.php on line 46

 

anybody could give me a help?

 

www.qnk.us

 

 

Are you sure you copied everything into in the right directories?

I just simply upload the contents inside the catalog to the root. Is this correct directories?

Link to comment
Share on other sites

Warning: main(templates/CSS/content/CONTENT_INDEX_DEFAULT.tpl.php): failed to open stream: No such file or directory in /hsphere/local/home/amyqzus/qnk.us/templates/CSS/main_page.tpl.php on line 46

 

Looks like "CONTENT_INDEX_DEFAULT" isn't defined (but if everything is installed correctly this really can't happen!!).

 

Normally "CONTENT_INDEX_DEFAULT" is defined in "includes/filenames.php".

You can post your "includes/filenames.php" here if you like, it might help.

Link to comment
Share on other sites

  • 2 weeks later...

Has anyone integrated Credit Class Gift Voucher 5.10b with BTS 1.2? Or know how I can integrate the includes/boxes/shopping_cart.php together?

 

I'm stuck on how to modify CC Gift voucher with BTS

 

Here's the code:

 

<?php
/*
 $Id: shopping_cart.php,v 1.2.2.9 2003/05/13 22:49:08 wilt Exp $
 $Id: shopping_cart.php,v 1.18 2003/02/10 22:31:06 hpdl Exp $
 modified by paulm_nl 2003/12/23
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 $boxHeading = BOX_HEADING_SHOPPING_CART;
 $corner_left = 'square';
 $corner_right = 'rounded';
 $boxLink = '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><img src="images/infobox/arrow_right.gif" border="0" alt="more" title=" more " width="12" height="10"></a>';
 $box_base_name = 'shopping_cart'; // for easy unique box template setup (added BTSv1.2)

 $box_id = $box_base_name . 'Box';  // for CSS styling paulm (editted BTSv1.2)

 $boxContent = '';
 if ($cart->count_contents() > 0) {
   $boxContent = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
   $products = $cart->get_products();
   for ($i=0, $n=sizeof($products); $i<$n; $i++) {
     $boxContent .= '<tr><td align="right" valign="top" class="infoBoxContents">';

     if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
       $boxContent .= '<span class="newItemInCart">';
     } else {
       $boxContent .= '<span class="infoBoxContents">';
     }

     $boxContent .= $products[$i]['quantity'] . ' x </span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';

     if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
       $boxContent .= '<span class="newItemInCart">';
     } else {
       $boxContent .= '<span class="infoBoxContents">';
     }

     $boxContent .= $products[$i]['name'] . '</span></a></td></tr>';

     if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
       tep_session_unregister('new_products_id_in_cart');
     }
   }
   $boxContent .= '</table>';
 } else {
   $boxContent .= BOX_SHOPPING_CART_EMPTY;
 }

 if ($cart->count_contents() > 0) {
   $boxContent .= tep_draw_separator();
   $boxContent .= '<div align="right">' . $currencies->format($cart->show_total()) . '</div>';
 }

// ICW ADDED FOR CREDIT CLASS GV
 if (tep_session_is_registered('customer_id')) {
   $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
   $gv_result = tep_db_fetch_array($gv_query);
   if ($gv_result['amount'] > 0 ) {
     $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
     $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>');
     $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>');
   }
 }
 if (tep_session_is_registered('gv_id')) {
   $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
   $coupon = tep_db_fetch_array($gv_query);
   $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
   $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>');

 }
 if (tep_session_is_registered('cc_id') && $cc_id) {
   $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
   $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');

 }

// ADDED FOR CREDIT CLASS GV END ADDITTION


// bof BTSv1.2
 if(file_exists(DIR_WS_BOX_TEMPLATES . $box_base_name . '.tpl.php')) {
 // if exists, load unique box template for this box from templates/boxes/
     require(DIR_WS_BOX_TEMPLATES . $box_base_name . '.tpl.php');
 }
 else {
 // load default box template: templates/boxes/box.tpl.php
     require(DIR_WS_BOX_TEMPLATES . TEMPLATENAME_BOX);
 }
// eof BTSv1.2

 $boxLink = '';
?>

 

But the Credit Class Gift voucher doesn't show up, and I belive it's because it's using $info_box_contents and [] instead of $boxContent. Anyone happen to know how I can change it to work?

 

Thanks.

Link to comment
Share on other sites

Hi,

 

maybe this helps (same as posted at "the other" forums):

If you're using BTS and CCGV and cannot get the Shopping Cart infobox to display the voucher stuff then try this:

 

Find 'catalog/includes/boxes/shopping_cart.php'

 

Directly before: (approx line 58 )

// bof BTSv1.2
 if(file_exists(DIR_WS_BOX_TEMPLATES . $box_base_name . '.tpl.php')) {
 // if exists, load unique box template for this box from templates/boxes/
     require(DIR_WS_BOX_TEMPLATES . $box_base_name . '.tpl.php');

 

Add this code:

// ICW ADDED FOR CREDIT CLASS GV
 if (tep_session_is_registered('customer_id')) {
   $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
   $gv_result = tep_db_fetch_array($gv_query);
   if ($gv_result['amount'] > 0 ) {
     $boxContent .= tep_draw_separator();
     $boxContent .= '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>';
     $boxContent .= '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>';
   }
 }
 if (tep_session_is_registered('gv_id')) {
   $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
   $coupon = tep_db_fetch_array($gv_query);
   $boxContent .= tep_draw_separator();
   $boxContent .= '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>';

 }
 if (tep_session_is_registered('cc_id') && $cc_id) {
   $boxContent .= tep_draw_separator();
   $boxContent .= '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>';

 }

// ADDED FOR CREDIT CLASS GV END ADDITTION

 

Basically all the positioning arrays have been stripped out and $info_box_content[] have been changed to $boxContent

 

This is also how it has been done using osC-MAX

 

If you have any problems post here and i'll try help you out.

 

Regards,

 

Fish

I did not try it myself yet, so please tell me if it works.

It would be very interesting to have a "Credit Class Gift Voucher" for the BTS. It's a very usefull, but maybe one of the most difficult contribs to install on a BTS system I think.

Link to comment
Share on other sites

Hi,

 

maybe this helps (same as posted at "the other" forums):

If you're using BTS and CCGV and cannot get the Shopping Cart infobox to display the voucher stuff then try this:

 

Find 'catalog/includes/boxes/shopping_cart.php'

 

Directly before: (approx line 58 )

// bof BTSv1.2
?if(file_exists(DIR_WS_BOX_TEMPLATES . $box_base_name . '.tpl.php')) {
?// if exists, load unique box template for this box from templates/boxes/
? ? ?require(DIR_WS_BOX_TEMPLATES . $box_base_name . '.tpl.php');

 

Add this code:

// ICW ADDED FOR CREDIT CLASS GV
?if (tep_session_is_registered('customer_id')) {
? ?$gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
? ?$gv_result = tep_db_fetch_array($gv_query);
? ?if ($gv_result['amount'] > 0 ) {
? ? ?$boxContent .= tep_draw_separator();
? ? ?$boxContent .= '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>';
? ? ?$boxContent .= '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>';
? ?}
?}
?if (tep_session_is_registered('gv_id')) {
? ?$gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
? ?$coupon = tep_db_fetch_array($gv_query);
? ?$boxContent .= tep_draw_separator();
? ?$boxContent .= '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>';

?}
?if (tep_session_is_registered('cc_id') && $cc_id) {
? ?$boxContent .= tep_draw_separator();
? ?$boxContent .= '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>';

?}

// ADDED FOR CREDIT CLASS GV END ADDITTION

 

Basically all the positioning arrays have been stripped out and $info_box_content[] have been changed to $boxContent

 

This is also how it has been done using osC-MAX

 

If you have any problems post here and i'll try help you out.

 

Regards,

 

Fish

I did not try it myself yet, so please tell me if it works.

It would be very interesting to have a "Credit Class Gift Voucher" for the BTS. It's a very usefull, but maybe one of the most difficult contribs to install on a BTS system I think.

Hey Paul,

 

Thanks for the quick link and help on this, the information below worked great! I believe BTS is a great system, and I believe I have Credit Class Gift Voucher and a few other mods working on this system. It takes a little bit of time, but after checking out your code it makes life so much easier, you can switch between templates for different occasions such as the holidays.

 

One other quick question, do you happen to know how I could make the categories box on the left show all the subcategories automatically?

 

Such as:

 

-> Category

-> Subcategory

-> Subcategory 2

 

Rather than having to click category, then see the rest of the subcategories?

 

Thanks again,

 

Matt

Link to comment
Share on other sites

Hi Matt,

 

One other quick question, do you happen to know how I could make the categories box on the left show all the subcategories automatically?

 

it's co?ncidence, but I just run into some code at the BTS forums what seems to do what you asked. Received from Matti, I adapted it a little for BTSv1.2.

<!-- categories_bof //-->
<?php
/*
 $Id: categories.php,v 1.24 2003/06/09 22:09:55 hpdl Exp $
 modified by paulm_nl 2003/12/23
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 $boxHeading = BOX_HEADING_CATEGORIES;
//  $corner_left = 'rounded';
//  $corner_right = 'square';
 $box_base_name = 'categories'; // for easy unique box template setup (added BTSv1.2)
 $box_id = $box_base_name . 'Box';  // for CSS styling paulm (editted BTSv1.2)
 


$query = "select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and c.parent_id = '' and cd.categories_name > '' and cd.language_id='" . (int)$languages_id . "'";

$categories_query = tep_db_query($query);

$boxContent = '';
$boxContent .= '<div id="cattest"><ul>';

 while ($row = tep_db_fetch_array($categories_query))  {
 $parent_category = $row['categories_id'];

//    $boxContent .= '<li><a href="' . tep_href_link(FILENAME_DEFAULT,'name=' . tep_spider_name($row['categories_name']) .'&' . 'cPath=' . $row['categories_id']) . '">' . $row['categories_name'] . '</a>';
   $boxContent .= '<li><a href="' . tep_href_link(FILENAME_DEFAULT,'name=' . ($row['categories_name']) .'&' . 'cPath=' . $row['categories_id']) . '">' . $row['categories_name'] . '</a>';

//lets end the list or start a new one

   $subquery = "select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and c.parent_id = '" . $parent_category . "' and cd.categories_name > '' and cd.language_id='" . (int)$languages_id . "'";

$subcategories = tep_db_query($subquery);

if(isset($subcategories)){
    $boxContent .= '<ul>';
   } else {
   $boxContent .= '</li>';
}
 while ($row = tep_db_fetch_array($subcategories))  {

//    $boxContent .= '<li><a href="' . tep_href_link(FILENAME_DEFAULT,'name=' . tep_spider_name($row['categories_name']) .'&' . 'cPath=' . $row['categories_id']) . '">' . $row['categories_name'] . '</a></li>';
   $boxContent .= '<li><a href="' . tep_href_link(FILENAME_DEFAULT,'name=' . ($row['categories_name']) .'&' . 'cPath=' . $row['categories_id']) . '">' . $row['categories_name'] . '</a></li>';

   }
if(isset($subcategories)){
    $boxContent .= '</ul></li>';
}
 }

//    echo '<ul id="cattest">' . $boxContent . '</ul>';

 $boxContent .= '</ul></div>';
?>
<!-- categories_eof //-->
<?php
// bof BTSv1.2
 if(file_exists(DIR_WS_BOX_TEMPLATES . $box_base_name . '.tpl.php')) {
 // if exists, load unique box template for this box from templates/boxes/
     require(DIR_WS_BOX_TEMPLATES . $box_base_name . '.tpl.php');
 }
 else {
 // load default box template: templates/boxes/box.tpl.php
     require(DIR_WS_BOX_TEMPLATES . TEMPLATENAME_BOX);
 }
// eof BTSv1.2
?>

Maybe you have to change it some more to your own needs, but it does work. It will have to be styled of course.

 

hth

Paul

Edited by paulm2003
Link to comment
Share on other sites

Thanks Paul,

 

I was also wondering, when using the BTS how would people make a "Top of Page" anchor, using the normal

 

<a name="TOP"></a>

 

<a href="#TOP">Top of Page</a>

 

This doesn't seem to work as it'll bring you back to the index.php page, instead i was hoping it would bring you back to top of whatever current page you're on such as shipping, specials, index, manufacture, and what not.

 

Thanks in advance,

 

Matt

 

 

 

an

Link to comment
Share on other sites

<a name="TOP"></a>

 

<a href="#TOP">Top of Page</a>

 

This doesn't seem to work as it'll bring you back to the index.php page

Hi Talon,

 

I noticed that too, and I don't understand why it happens either. I asked the question once at this board but nobody responded :(

 

I ended up using something like:

<a href="faq.php#TOP">Top of Page</a>

 

I have seen some contribs (which where not written for the BTS) and they also use the "long" links (like faq.php#TOP), that's why I think it's an osC problem and not a BTS problem (can somebody please confirm/deny that?).

 

P.S.

I am not 100% sure if you need to use the tep_href_link() function for these links. Since, if it works as it should, you're not changing pages.

Link to comment
Share on other sites

Hey Paul,

 

What i was trying to think of if theres a way to say something like whatever cpath and cid and pid is add #TOP to the end of it, i was looking around the files, and couldn't come up with a solution.

 

At the moment i'm still working on the store setup with BTS and while modififing the entire site to give a personal touch, i also have to touch files in the includes\boxes\,

 

hopefully this can be modified into the next BTS version so you can have more than one template.

 

Thanks again,

 

Matt

Link to comment
Share on other sites

Hi Matt,

What i was trying to think of if theres a way to say something like whatever cpath and cid and pid is add #TOP to the end of it, i was looking around the files, and couldn't come up with a solution.
:huh: Sorrry I don't understand

 

At the moment i'm still working on the store setup with BTS and while modififing the entire site to give a personal touch, i also have to touch files in the includes\boxes\
I assume you know it is very easy to create new/individual templates for each box if you like, together with some CSS styling you can do a lot without touching any other file than the templates ( i.e. www.eeweb.nl/osc-bts/index.php?tplDir=32-final ).

 

But you are right, you can't do anything you like, at least all <br> tags and  's should be removed from the core code to make it more flexible.

At the moment most (not all) BTS code is standard osC, but the code has been separated from the output. So a disadvantage could be of course, that it would become a little more difficult to add some of the existing contribs if that's changed.

Link to comment
Share on other sites

Actually for example the reason I touched includes\boxes\shopping_cart.php and includes\boxes\categories.php and other files, is to add things such as View Cart inside the shopping_cart.php or to add specials inside the categories.php box, also graphical images to each box, and a few other things, but I guess I could make individual templates for each or write if statements inside the boxes.tpl.php

 

You have a pretty nice store =D, I guess I can redo mine at a later date to fix this issue.

Link to comment
Share on other sites

I guess I could make individual templates for each or write if statements inside the boxes.tpl.php.
I would not add any if statements to "boxes.tpl.php". It is very easy to create individual box templates, just take "box.tpl.php" and save it as "categories.tpl.php" in the same "templates/.../boxes/" directory and you will have a new template for the categories box.

 

You have a pretty nice store =D
Thanks :) Actually, it's not really my store (if we are talking about the same one). It's an html template I got, and converted it to osC+BTS as an example on how it can be done. Edited by paulm2003
Link to comment
Share on other sites

I guess I could make individual templates for each or write if statements inside the boxes.tpl.php.
I would not add any if statements to "boxes.tpl.php". It is very easy to create individual box templates, just take "box.tpl.php" and save it as "categories.tpl.php" in the same "templates/.../boxes/" directory and you will have a new template for the categories box.

 

That'll work.

That'll work.

Link to comment
Share on other sites

Hello,

 

I'm sorry if this question has already been asked, but have searched all morning and cannot see it answered in the posts already!

 

I have installed BTS over a clean installation of OSC MS2.2

 

I want to just show the top level categories in my Category box, so downloaded the top_categories contribution (http://www.oscommerce.com/community/contributions,1145) which basically gives you a new box file (top_categories.php) to call instead of categories.php. I created a new box template file called top_categories.tpl.php. I guess that I need to add some new lines top the top_categories.php file to make it look to BTS for its formatting and also a new entry in stylesheet.css?

 

I have tried to do these changes by looking at categories.php, but to no avail!

 

If anyone has any ideas, I would be very grateful to hear them.

 

Thanks

 

John

Link to comment
Share on other sites

Hi John,

 

You could try something like this (untested):

<?php
/*
 Released under the GNU General Public License
*/

 $boxHeading = BOX_HEADING_CATEGORIES;
 $corner_left = 'rounded';
 $corner_right = 'square';
 $box_base_name = 'top_categories'; // changed value to top_categories !

 $box_id = $box_base_name . 'Box';  // for CSS styling 
?>
<!-- top_categories //-->
<?php
//////////
// Display box heading
//////////
 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'left', 'text'  => BOX_HEADING_CATEGORIES);
 new infoBoxHeading($info_box_contents, true, false);


//////////
// Get categories list
//////////
// Test for presence of status field for compatibility with older versions
 $status = tep_db_num_rows(tep_db_query('describe categories status'));

 $query = "select c.categories_id, cd.categories_name, c.parent_id
           from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
           where c.categories_id = cd.categories_id
                         and c.parent_id=0";
 if ($status >0)
   $query.= " and c.status = '1'";
 $query.= " and cd.language_id='" . $languages_id ."'
           order by sort_order, cd.categories_name";

 $categories_query = tep_db_query($query);

// Build categories string
 $categories_string = '';
 while ($row = tep_db_fetch_array($categories_query))  {
   $categories_string .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $row['categories_id']) . '">';
   list($current) = explode('_', $HTTP_GET_VARS['cPath']);
   if ($row['categories_id'] == $current) $categories_string .=  '<b>';
   $categories_string .= $row['categories_name'];
   if ($row['categories_id'] == $current) $categories_string .=  '</b>';
   $categories_string .= '</a>';
   $categories_string .= '<br>';
 }

//////////
// Display box contents
//////////
 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'left', 'text'  => $categories_string);
 new infoBox($info_box_contents);
?>
<!-- top_categories_eof //-->
<?php
// bof BTSv1.2
 if(file_exists(DIR_WS_BOX_TEMPLATES . $box_base_name . '.tpl.php')) {
 // if exists, load unique box template for this box from templates/boxes/
     require(DIR_WS_BOX_TEMPLATES . $box_base_name . '.tpl.php');
 }
 else {
 // load default box template: templates/boxes/box.tpl.php
     require(DIR_WS_BOX_TEMPLATES . TEMPLATENAME_BOX);
 }
// eof BTSv1.2
?>

It's not really the original BTS way to do it (the BTS does not use the box class as in "new infoBox(...)" for these boxes) but I think it will work.

 

The above is the new categories file for "includes/boxes/", you don't have to create a new box template, it will use "templates/.../boxes/box.tpl.php" by default. But if you want you can open "box.tpl.php" and save as "top_categories.tpl.php" to create a special box template for the new box.

 

You surely don't have to add anything to the stylesheet to make it work. Only add lines to the stylesheet to change to looks after you got it working. The new box will automaticly have top_categories as CSS id (so use #top_categories etc in the stylesheet file). By the way: the underscore in the CSS id might not work well in some ancient browsers, allthough I never have seen that it didn't work.

 

hth

Edited by paulm2003
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...