Created
June 14, 2012 17:45
-
-
Save krisives/2931711 to your computer and use it in GitHub Desktop.
Fernando's generateDiv() function ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>'; | |
} | |
} |
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
I didn't write this.