I'm trying to use the block configure setting "Show block on specific pages" feature with the "Show if the following PHP code returns TRUE" radio button selected and doing a conditional that checks if the $node->type=='product' which works for other blocks but not this one. Again i'm using my conditional on other blocks without issue. Just seems to not work with this module's block. If I figure a workaround I'll post it here but it would be nice to use this as it's supposed to be used.

Comments

rmiddle’s picture

Status: Active » Postponed (maintainer needs more info)

I don't do anything strange in the block display area. I have no idea why that code doesn't work.

Thanks
Robert

mteipe’s picture

Robert, Thanks for the quick response! I found a workaround that I put inside the function theme_similarterms function:
(also note that i've completely re-coded the function and output to coincide with my Ubercart catalog grid view)
Great module thank you!


function theme_similarterms($items) {
if($items[0]->type=='product'){
$product_table = "<div class='category-grid-products'><table><tr>";

if (!empty($items)) {
 foreach ($items as $product) {
 
 
    $titlelink = l($product->title, "node/$nid", array(), null, null, false, true);
    $shortdescription = $product->field_short_description[0]['value'];
    if (module_exists('imagecache') && isset($product->field_image_cache) && file_exists($product->field_image_cache[0]['filepath'])) {
      $imagelink = l(theme('imagecache', 'product_list', $product->field_image_cache[0]['filepath']), "node/$nid", array(), null, null, false, true);
    }
    else {
      $imagelink = '';
    }
 
    $product_table .= '<td><div class="catalog_grid_box">';
    if (variable_get('uc_catalog_grid_display_add_to_cart', TRUE)) {
      if (variable_get('uc_catalog_grid_display_attributes', TRUE)) {
        $product_table .= theme('uc_product_add_to_cart', $product);
      }
      else {
        $product_table .= drupal_get_form('uc_catalog_buy_it_now_form_'. $product->nid, $product);
      }
    }
    
    if (variable_get('uc_catalog_grid_display_sell_price', TRUE)) {
      $product_table .= '<span class="catalog_grid_sell_price">Price: '. uc_currency_format($product->sell_price) .'</span>';
    }
    
    if (variable_get('uc_catalog_grid_display_model', TRUE)) {
      $product_table .= '<span class="catalog_grid_ref">'. $product->model .'</span>';
    }
    $product_table .= '<span class="catalog_grid_image">'. $imagelink .'</span>';
        if (variable_get('uc_catalog_grid_display_title', TRUE)) {
      $product_table .= '<span class="catalog_grid_title">'. $titlelink .'</span>';
    }
    $product_table .= '<div class="catalog_short_description">'. $shortdescription .'</div>';
    

    $product_table .= '</div></td>';
  }
  
  


 }
     $product_table .= '</tr></table></div>';
     
} else {$product_table="";}

  return $product_table;
} 


rmiddle’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.