Page 1 of 4 123 ... LastLast
Results 1 to 10 of 35
  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

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

    Default Re: Code to display Featured Category with Description, Manufacture URL, BuyNow butto

    Forgot to tell that ..

    this is for displaying the featured product - in the content area of the main page (HOME PAGE).

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Code to display Featured Category with Description, Manufacture URL, BuyNow butto

    Thanks for adding the solution that worked for you on Featured Products ... this is always a help to others to see alternative coding solutions ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Jan 2009
    Location
    Montreal, Canada
    Posts
    228
    Plugin Contributions
    0

    Default Re: Code to display Featured Category with Description, Manufacture URL, BuyNow butto

    Thanks!

    Do you know how to lessen the space between products and also between the product name and line of description?

    a l e x a n d e r g i f t s . c a

    Cheers,

    Robbie

  5. #5
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default Re: Code to display Featured Category with Description, Manufacture URL, BuyNow butto

    Just a note - Zen Cart v2.0 will have options for showing the prices, descriptions etc. in the listings boxes and listing pages and the ability to have customized layouts for both.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  6. #6
    Join Date
    Jan 2009
    Location
    Montreal, Canada
    Posts
    228
    Plugin Contributions
    0

    Default Re: Code to display Featured Category with Description, Manufacture URL, BuyNow butto

    Cool, I read about 2.0 and how a lot of popular mods/effects and special coding will be built-in.

    But till it's good to go sans bugs may be a while...any way to lessen the spaces till then?

    R

  7. #7
    Join Date
    Jan 2009
    Location
    Montreal, Canada
    Posts
    228
    Plugin Contributions
    0

    Default Re: Code to display Featured Category with Description, Manufacture URL, BuyNow butto

    I realized the issue only arose by using this mod, which I didn't even need because I only wished to display the name, description and price...all do-able through Admin.

    R

  8. #8
    Join Date
    Jan 2009
    Location
    Montreal, Canada
    Posts
    228
    Plugin Contributions
    0

    Default Re: Code to display Featured Category with Description, Manufacture URL, BuyNow butto

    And now I just remembered that the description does not show in Featured through standard ZC! I read other posts to get around this, but couldn't control the length of the description text.

    So this mod is back on my site, even though I'll likely only use the description and maybe the price, and I would once again like to adjust the spacing. (I blocked out // the lines of code for name, price, id and the two links.)

    Cheers,

    R

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

    Default Re: Code to display Featured Category with Description, Manufacture URL, BuyNow butto

    Are you having any problem now...

    There is a css class where I have given a fixed height to the image block.

    Let me know if I can help you out..
    Regards
    Dharam

  10. #10
    Join Date
    Jan 2009
    Location
    Montreal, Canada
    Posts
    228
    Plugin Contributions
    0

    Default Re: Code to display Featured Category with Description, Manufacture URL, BuyNow butto

    Now I have two issues, one as currently seen on the site and another when I try to center everything with one item per row, which I would like when there are just two items. Though let's start with what you now see.

    I tinkered around some more and, going back to your original code for featured_products and stylesheet.css, I now have what's on the site at a l e x a n d e r g i f t s . c a where the item names and descriptions lap over the images.

    The only adjustment I did to your files was block out // in featured_prods lines 68 and 70-73 for price, name, id and the two links.

    In Admin, this is what I have under Config-Featured Listing:

    Display Product Image 1101
    Display Product Quantity 0
    Display Product Buy Now Button 0
    Display Product Name 1201
    Display Product Model 0
    Display Product Manufacturer Name 0
    Display Product Price 0
    Display Product Weight 0
    Display Product Date Added 0
    Display Product Description 150
    Display Product Display - Default Sort Order 8
    Default Featured Products Group ID 22
    Display Multiple Products Qty Box Status and Set Button Location 0

    Cheers,

    R

 

 
Page 1 of 4 123 ... LastLast

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