Skip to content

Instantly share code, notes, and snippets.

@krisives
Created June 14, 2012 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krisives/2931711 to your computer and use it in GitHub Desktop.
Save krisives/2931711 to your computer and use it in GitHub Desktop.
Fernando's generateDiv() function ...
function generateDiv( $product_id, $product_name, $product_s_desc, $img_div, $title_div, $desc_div, $display_image, $display_title, $display_desc ){
global $sess, $VM_LANG, $mm_action_url;
STN::depend('ProductImage');
require_once CLASSPATH.'ps_product_category.php';
$ps_product_category = new ps_product_category;
$cid = $ps_product_category->get_cid( $product_id );
$url = "?page=shop.product_details&category_id=$cid";
$url .= "&product_id=" . $product_id;
if( $display_image == "yes" ){
echo '<div class="'.$img_div.'"><a title="'.$product_name.'" href="'.$sess->url($mm_action_url. "index.php" . $url).'">';
echo '<img src="'.ProductImage::getSecureThumb($product_id).'"/>';
echo '</a></div>';
}
if( $display_title == "yes" ){
echo '<div class="'.$title_div.'">'.$product_name.'</div>';
}
if( $display_desc == "yes" ){
echo '<div class="'.$desc_div.'">'.$product_s_desc.'</div>';
}
}
@krisives
Copy link
Author

I didn't write this.

@stnadmin
Copy link

Wow! Let's generate divs! Wait that's more than just a DIV!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment