Jump to content



Latest News: (loading..)

NuDreamer

Member Since 16 Dec 2007
OFFLINE Last Active Mar 05 2013 02:49 PM
-----

Topics I've Started

Display an Include on Subcategory, NOT parent category

03 February 2013 - 01:41 AM

Hey guys, really hoping someone can help me with this! I have an include that I want displayed on Subcategory pages only. So basically, if category is a parent, do NOT display, if category HAS a parent, display. Make sense? I tried using this...
if ($category_depth == 'nested' && isset($HTTP_GET_VARS['cPath'])) {
   include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
}

But its not enough, and doesn't work. Does anyone have any ideas how to fix that?

Thanks so very much, you guys are all awesome here.

Regards

Display text Only on Manufacturer page, or categories page

29 January 2013 - 03:22 PM

I am trying to figure out.. I have a block of text I want to display, but I only want it to show up on Manufacturer pages. It will be the same on all pages. I know there is a "if page has manufacturer_id" statement that I can write.. I just don't know how to. Can anyone give me an example or where to start?e

Custom module not displaying Product Title

28 January 2013 - 09:47 PM

I have been customizing a version of the "featured Products" module, in order to create a new version of my catalog pages. It is highly customized, and you can see what I am doing here:
http://www.tacticalbootstore.com/boots-511-tactical-c-392.html

The idea, is that I want to be able to display the products in the subcategories, on the categories page, with a small description. This is mostly for SEO purposes. However.. for some reason.. the code is not displaying the product name! I have the product price output.. but the product name refuses to show! I have been staring at it for hours and can't figure it out. i was hoping a fresh pair of eyes would see what I missed. The code is showing below:

if ($current_category_id == "392")
{
	echo "<div style='border-width: 1px; border-style: solid; border-color: e6e6e6; padding:2px; margin: 5px;'>";
if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
$category_query = tep_db_query("select distinct categories_id from ". TABLE_PRODUCTS_TO_CATEGORIES );
$cids = array();
while ($categories = tep_db_fetch_array($category_query)) {
  array_push($cids, $categories["categories_id"]);
}
$cid = $cids[rand(0, count($cids) - 1)];
   // removed order by p.products_date_added desc
$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, " . "if(s.status, s.specials_new_products_price, p.products_price) as products_price " . "from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id " . ", ". TABLE_PRODUCTS_TO_CATEGORIES . " p2c " . " where p.products_id = p2c.products_id and products_status = '1' and (p2c.categories_id = 399)" . "order by rand() limit " . MAX_DISPLAY_NEW_PRODUCTS);
echo "<h2><a href='http://www.tacticalbootstore.com/boots-511-tactical/511-atac-c-392_399.html'>5.11 ATAC Boots</a></h2><br />
  The ATAC Series or better known as 'All Terrain, All Condition' is proven to be the best tactical boot produced by 5.11. Within this superior quality boot you have full grain leather and nylon uppers. Also to protect you the boot is lined with moisture wicking and antibacterial material. For the best stability we added oil and slip resistance and a quiet outsole so that you can easily approach anyone undetected. When trying to create the best comfort we added Dual Density Polyou cushioning and open cell foam cushioning this way you know it's easy to handle long distances. The ATAC Series will give you the best tactical advantage in any fight, if you need tactical gear, choose 5.11.";
  } else {
	$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by rand() limit " . MAX_DISPLAY_NEW_PRODUCTS);
  }
  $row = 0;
  $col = 0;
  $info_box_contents = array();
  while ($new_products = tep_db_fetch_array($new_products_query))
  {
  $new_products['products_name'] = tep_get_products_name($new_products['products_id']);
  while ($new_products = tep_db_fetch_array($new_products_query)) {
	$info_box_contents[$row][$col] = array('align' => 'center',
										  'params' => 'class="smallText" width="33%" valign="top"',
										   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH*2, SMALL_IMAGE_HEIGHT*2) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));
	$col ++;
	if ($col > 2) {
	  $col = 0;
	  $row ++;
	}
  }
new contentBox($info_box_contents);
echo "</div>";

The general idea is, I would like to develop this into a module if I can get the bugs worked out of it. Thanks so much in advance for anyone who can help me with this!