Hello,
I also have a requirement to display
Product Name
Product Image
Product Description
Product Manufacture URL
Product Price
Buy Now buttom/ Sold out button.
I have searched but din't find the solution / code any where in the thread (may be it would be there some where)
But, as I have achieved the functionality I wanted to share this so that others can use this. Let me know if any thing is wrong here. I am also a beginner to zencart (started before 4days )
So here is the code...
NOTE:: This is for the latest version 3.8
Go to /includes/modules/featured_products.php
May at line number 67 you will find a while loop
-----------
while (!$featured_products->EOF) {
$products_price = zen_get_products_display_price($featured_products->fields['products_id']);
..
...
..
..
}
---------
REPLACE THE WHILE LOOP WITH THE CODE BELOW
while (!$featured_products->EOF) {
$products_price = zen_get_products_display_price($featured_products->fields['products_id']);
$products_desc = substr(strip_tags(trim(zen_get_products_description($featured_products->fields['products_id'], $_SESSION['languages_id']))),0,100).'…';
$vendor_name = zen_get_products_manufacturers_name($featured_products->fields['products_id']);//this is the manufacture name
$vendor_id = zen_get_products_manufacturers_id($featured_products->fields['products_id']);//this is the manufacture name
$vendor_link = '<a href="'.zen_href_link('index', 'manufacturers_id='.$vendor_id, 'NONSSL').'">'.$vendor_name.'</a>';
$buy_now_link = zen_get_buy_now_button($featured_products->fields['products_id'],'<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a> ');
if (!isset($productsInCategory[$featured_products->fields['products_id']])) $productsInCategory[$featured_products->fields['products_id']] = zen_get_generated_category_path_rev($featured_products->fields['master_categories_id']);
$list_box_contents[$row][$col] = array('params' =>'class="back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => (($featured_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<div class="d_imgbox"><a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . $productsInCategory[$featured_products->fields['products_id']] . '&products_id=' . $featured_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $featured_products->fields['products_image'], $featured_products->fields['products_name'], IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH, IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT) . '</a></div><p>') . '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . $productsInCategory[$featured_products->fields['products_id']] . '&products_id=' . $featured_products->fields['products_id']) . '">' . $featured_products->fields['products_name'] . '</a></p>'.'By '.$vendor_link.'<p>'.$products_desc.'</p><p>' . $products_price.'</p><p>'.$buy_now_link.'</p>');
$col ++;
if ($col > (SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS - 1)) {
$col = 0;
$row ++;
}
$featured_products->MoveNextRandom();
}
-----------------------------------
There is a css class too...
/*--- Custom css by Dharam for image box*/
.d_imgbox
{
float:left;
height:200px;
width:90px;
padding:5px 0px 0px 0px;
}
put the above css class in some of the css file you are using.
THATS all - you should get the result
Let me know if there is any problem. I am attaching my featured_products.php file for your reference.
If this information would be helpful for you, I can share the source code for all the blocks with you soon.
HAPPY ZENCARTING
Regards
Dharam
dharam.new######################
Bookmarks