Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Tip: Changing "Let's see what...here" to current


Web Bitch

Recommended Posts

I know I was stuck on this and so was someone else, but I can't find their post now. When you open default.php in dreamweaver you'll see three tables. In the second table where it says "echo HEADING_TITLE" on line two-hundred-something in code view, replace that with this mumbo jumbo:

 

<?php

if ($cPath) {

if (!ereg('_', $cPath)) {

$cPath_array = array($cPath);

}

$cPath_new = '';

for($i=0; $i<sizeof($cPath_array); $i++) {

if ($cPath_new == '') {

$cPath_new .= $cPath_array[$i];

} else {

$cPath_new .= '_' . $cPath_array[$i];

}

$categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $cPath_array[$i] . "' and language_id='" . $languages_id . "'");

$categories = tep_db_fetch_array($categories_query);

echo $categories['categories_name'];

}

} elseif ($HTTP_GET_VARS['manufacturers_id']) {

$manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . $HTTP_GET_VARS['manufacturers_id'] . "'");

$manufacturers = tep_db_fetch_array($manufacturers_query);

echo $manufacturers['manufacturers_name'];

}

if ($HTTP_GET_VARS['products_id']) {

$model = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "'");

$model_values = tep_db_fetch_array($model);

echo $model_values['products_model'];

}

if ($location) {

echo $location;

}

?>

:::::::::Web Bitch::::::::

Link to comment
Share on other sites

So is ^that all the body content which is in the center of the page, or what does that code do . . .

 

I'm using DreamweaverMX

 

Right now I'm trying to make my own template for the store, but having some issues. I think it is because I have some code that is messed up, and or left out. Currently I have the left and right sections working, along with the bread crumb trail(kinda) header/footers work fine. . . This is my code that I have for the middle:

 

<font color="#000000" size="2" face="Trebuchet MS"><table width="100%" height=100% border="0" cellpadding="0" cellspacing="0" dwcopytype="CopyTableColumn">

             <tr> 

               <?php

 if ($category_depth == 'nested') {

   $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" . $languages_id . "'");

   $category = tep_db_fetch_array($category_query);

?>

               <td width="60%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

                   <tr> 

                     <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

                         <form>

                           <tr> 

                             <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

                             <?php

// optional Product List Filter

   if (PRODUCT_LIST_FILTER) {

     $filterlist = tep_db_query($filterlist_sql);

     if (tep_db_num_rows($filterlist) > 1) {

       echo '            <td align="center" class="main">' . TEXT_SHOW . '<select size="1" onChange="if(options[selectedIndex].value) window.location.href=(options[selectedIndex].value)">';

       if ($HTTP_GET_VARS['manufacturers_id']) {

         $arguments = 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'];

       } else {

         $arguments = 'cPath=' . $cPath;

       }

       $arguments .= '&sort=' . $HTTP_GET_VARS['sort'];



       $option_url = tep_href_link(FILENAME_DEFAULT, $arguments, 'NONSSL');



       if (!$HTTP_GET_VARS['filter_id']) {

         echo '<option value="' . $option_url . '" SELECTED>' . TEXT_ALL . '</option>';

       } else {

         echo '<option value="' . $option_url . '">' . TEXT_ALL . '</option>';

       }



       echo '<option value="">---------------</option>';

       while ($filterlist_values = tep_db_fetch_array($filterlist)) {

         $option_url = tep_href_link(FILENAME_DEFAULT, $arguments . '&filter_id=' . $filterlist_values['id'], 'NONSSL');

         if ( ($HTTP_GET_VARS['filter_id']) && ($HTTP_GET_VARS['filter_id'] == $filterlist_values['id']) ) {

           echo '<option value="' . $option_url . '" SELECTED>' . $filterlist_values['name'] . '</option>';

         } else {

           echo '<option value="' . $option_url . '">' . $filterlist_values['name'] . '</option>';

         }

       }

       echo '</select></td>' . "n";

     }

   }



// Get the right image for the top-right

   $image = DIR_WS_IMAGES . 'table_background_list.gif';

   if ($HTTP_GET_VARS['manufacturers_id']) {

     $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . $HTTP_GET_VARS['manufacturers_id'] . "'");

     $image = tep_db_fetch_array($image);

     $image = $image['manufacturers_image'];

   } elseif ($current_category_id) {

     $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . $current_category_id . "'");

     $image = tep_db_fetch_array($image);

     $image = $image['categories_image'];

   }

?>

                             <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

                           </tr>

                         </form>

                       </table></td>

                   </tr>

                   <tr> 

                     <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

                   </tr>

                   <tr> 

                     <td>

                       <?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?>

                     </td>

                   </tr>

                 </table></td>

               <?php

 } else { // default page

?>

               <td width="60%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

                   <tr> 

                     <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

                         <tr> 

                           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

                           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></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="0">

                         <tr> 

                           <td class="main"><?php echo tep_customer_greeting(); ?></td>

                         </tr>

                         <tr> 

                           <td class="main"><br>

                             <?php echo TEXT_MAIN; ?></td>

                         </tr>

                         <tr> 

                           <td><br>

                             <?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?>

                           </td>

                         </tr>

                         <?php

   include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);

?>

                       </table></td>

                   </tr>

                 </table></td>

               <?php

 }

?>

               <!-- body_text_eof //-->

             </tr>

           </table></font>

Link to comment
Share on other sites

Alex...

 

couple things to look for..

#1 there are couple instances of "echo HEADING_TITLE"

only replace the one near line 200

 

just cut web bitch's code and replace

 

<?php echo HEADING_TITLE; ?>

Link to comment
Share on other sites

Not sure if I am using an older version (I downloaded it just a couple of weeks ago) or what but I had to modify the code a bit to get it to work. Basically the global table names didn't exist in my version.

 

<?php

if ($cPath)

{

if (!ereg('_', $cPath))

{

$cPath_array = array($cPath);

}

 

$cPath_new = '';

for($i=0; $i<sizeof($cPath_array); $i++)

{

if ($cPath_new == '')

{

$cPath_new .= $cPath_array[$i];

}

else

{

$cPath_new .= '_' . $cPath_array[$i];

}

 

$categories_query = tep_db_query("select categories_name from categories where categories_id = '" . $cPath_array[$i] . "'");

 

$categories = tep_db_fetch_array($categories_query);

echo $categories['categories_name'];

}

}

elseif ($HTTP_GET_VARS['manufacturers_id'])

{

$manufacturers_query = tep_db_query("select manufacturers_name from MANUFACTURERS where manufacturers_id = '" . $HTTP_GET_VARS['manufacturers_id'] . "'");

$manufacturers = tep_db_fetch_array($manufacturers_query);

echo $manufacturers['manufacturers_name'];

}

 

if ($HTTP_GET_VARS['products_id'])

{

$model = tep_db_query("select products_model from PRODUCTS where products_id = '" . $HTTP_GET_VARS['products_id'] . "'");

$model_values = tep_db_fetch_array($model);

echo $model_values['products_model'];

}

if ($location)

{

echo $location;

}

?>

 

 

I also had some catgories without images specified so I did this right before the image was to be printed out...

 

<?php

// Don't show image if it doesn't exist!!!

if ($image != DIR_WS_IMAGES && $image != DIR_WS_IMAGES . "none")

{

$image = tep_image($image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT);

}

else

{

$image = "";

}

?>

 

And replaced this...

 

<td align="right" nowrap> <? echo tep_image($image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT);

?> </td>

 

with this...

 

<td align="right" nowrap> <? echo $image ?> </td>

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...