Results 1 to 10 of 35

Threaded View

  1. #1
    Join Date
    Mar 2009
    Location
    India, Hyderabad
    Posts
    36
    Plugin Contributions
    1

    Default Code to display Featured Category with Description, Manufacture URL, BuyNow button

    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>&nbsp;');

    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######################
    Attached Files Attached Files

 

 

Similar Threads

  1. Create a rollover effect for a ‘BuyNow’ button
    By thaipokey in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 15 Jun 2011, 10:33 PM
  2. Code to display Featured Category Name Image Details
    By rahul56008 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 18 Jan 2010, 10:48 PM
  3. Formatting Price and Buynow button
    By cashgil in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 1 Oct 2008, 11:31 AM
  4. Formatting Price and Buynow button
    By cashgil in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 9 Sep 2008, 07:29 AM
  5. Buynow button that skips to checkout
    By jdgray03 in forum General Questions
    Replies: 2
    Last Post: 29 Jan 2008, 07:19 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR