Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

mrbags

Archived
  • Posts

    7
  • Joined

  • Last visited

Profile Information

  • Real Name
    Danny

mrbags's Achievements

  1. i am trying to create a manufacturers dropdown box variable, $mfgrmenu, which is similar to that of the category dropdown box variable, $catmenu. inside of my file sts_user_code.php, I have added this. Im pretty certain that my mysql query is bad, and I am hoping someone can point me in the right direction of where I am going wrong. // good category drop down menu code $sts_block_name = 'catmenu'; require(STS_START_CAPTURE); echo "\n<!-- Start Category Menu -->\n"; echo tep_draw_form('goto', FILENAME_DEFAULT, 'get', ''); echo tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"'); echo "</form>\n"; echo "<!-- End Category Menu -->\n"; require(STS_STOP_CAPTURE); $template[$sts_block_name] = $sts_block[$sts_block_name]; function tep_get_category_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false) { global $languages_id; if (!is_array($category_tree_array)) { $category_tree_array = array(); } if ( (sizeof($category_tree_array) < 1) && ($exclude != '0') ) { $category_tree_array[] = array('id' => '0', 'text' => "Browse By Catalog"); } if ($include_itself) { $category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.language_id = '" . (int)$languages_id . "' and cd.categories_id = '" . (int)$parent_id . "'"); $category = tep_db_fetch_array($category_query); $category_tree_array[] = array('id' => $parent_id, 'text' => $category['categories_name']); } $categories_query = tep_db_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 cd.language_id = '" . (int)$languages_id . "' and c.parent_id = '" . (int)$parent_id . "' order by c.sort_order, cd.categories_name"); while ($categories = tep_db_fetch_array($categories_query)) { if ($exclude != $categories['categories_id']) { $category_tree_array[] = array('id' => $categories['categories_id'], 'text' => $spacing . $categories['categories_name']); } $category_tree_array = tep_get_category_tree($categories['categories_id'], $spacing . '???', $exclude, $category_tree_array); } return $category_tree_array; } // begin buggy manufacturer drop down menu $sts_block_name = 'mfgrmenu'; require(STS_START_CAPTURE); echo "\n<!-- Start Manufacturer Menu -->\n"; echo tep_draw_form('goto', FILENAME_DEFAULT, 'get', ''); echo tep_draw_pull_down_menu('cPath', tep_get_mfgr_tree(), $current_manufacturer_id, 'onChange="this.form.submit();"'); echo "</form>\n"; echo "<!-- End Manufacturer Menu -->\n"; require(STS_STOP_CAPTURE); $template[$sts_block_name] = $sts_block[$sts_block_name]; function tep_get_mfgr_tree($parent_id = '0', $spacing = '', $exclude = '', $manufacturer_tree_array = '', $include_itself = false) { global $languages_id; if (!is_array($manufacturer_tree_array)) { $manufacturer_tree_array = array(); } if ( (sizeof($manufacturer_tree_array) < 1) && ($exclude != '0') ) { $manufacturer_tree_array[] = array('id' => '0', 'text' => "Browse By Manufacturer"); } if ($include_itself) { $manufacturer_query = tep_db_query("select mi.manufacturers_id, mi.languages_id, mi.manufacturers_url from " . TABLE_MANUFACTURERS_INFO . " mi left join " . TABLE_MANUFACTURERS . " m on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id), " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id"); $manufacturer = tep_db_fetch_array($manufacturer_query); $manufacturer_tree_array[] = array('id' => $parent_id, 'text' => $manufacturer['manufacturers_name']); } $manufacturers_query = tep_db_query("select mi.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id"); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { if ($exclude != $manufacturers['manufacturers_id']) { $manufacturer_tree_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $spacing . $manufacturers['manufacturers_name']); } $manufacturer_tree_array = tep_get_mfgr_tree($manufacturers['manufacturers_id'], $spacing . '???', $exclude, $manufacturer_tree_array); } return $manufacturer_tree_array; }
  2. nevermind. duh. i was putting it in the src tag when all i needed to to was put it between <td> and </td> well that solves the $image question. question 2 is still valid.
  3. hi brian, terrific contribution youve created. i have a couple of questions, and hopefully they are easy for you to answer. ive been tooling around with the STS for a few hours now, and I have come up with a couple of questions: 1) Ive been trying to use $imagelarge or $imagesmall to make my product image appear on my modified product_info.php.html page, and each time all I get are broken links. Any help with this code <td width="400" height="400"> $startform <table> <tr> <td><img src="$imagesmall" border="0"></td> </tr> <tr> <td width="200" class="pageHeading" valign="top">$productname<br>$productmodel</td> <td width="200" class="pageHeading" valign="top">$regularpricestrike $specialprice</td> </tr> </table> 2) where does STS pull the default locations of images of variables like cartlogo and how can i make my own variables to work in STS? Thanks for your help. Danny
×
×
  • Create New...