Forums / Templates, Stylesheets, Page Layout / Product FREE Shipping IMAGE not showing up on Main & Product Page:

Product FREE Shipping IMAGE not showing up on Main & Product Page:

Started by rlexyd on 2 Oct 2012, 4:58 AM · Views: 4,800

Results 21 to 40 of 44
9 Oct 2012, 8:57 AM
#21
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Product FREE Shipping IMAGE not showing up on Main & Product Page:

A link to your main page

Zen-Venom Get Bitten

9 Oct 2012, 10:02 AM
#22
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

What if you rename that image to

free.gif

Zen-Venom Get Bitten

10 Oct 2012, 9:25 AM
#23
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
494
Plugin Contributions:
0

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

If I do that will it still show up in the Category & Product Listing if the image is a different name?

*Zen Cart eCommerce Solution - Putting the Dream of Owning an Online Business within reach of anyone!

10 Oct 2012, 9:34 AM
#24
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
494
Plugin Contributions:
0

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

I added two (same) images one named (always-free-shipping.gif) & the SAME image with the name (free.gif) but still no show on the main page :(

*Zen Cart eCommerce Solution - Putting the Dream of Owning an Online Business within reach of anyone!

10 Oct 2012, 10:53 AM
#25
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

I added two (same) images one named (always-free-shipping.gif) & the SAME image with the name (free.gif) but still no show on the main page
Did this cure it showing in your product listing and product details pages???

Give a link to your "Main" page & where you think this image should be

Zen-Venom Get Bitten

10 Oct 2012, 8:46 PM
#26
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
494
Plugin Contributions:
0

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

The FREE SHIPPING Shows up on Product Listing & Category Listing.

I want it to show on the Front page in the (What's New) + (Featured) + (Specials) boxes under each item name.

I private messaged you my URL yesterday.

Thanks.

*Zen Cart eCommerce Solution - Putting the Dream of Owning an Online Business within reach of anyone!

15 Oct 2012, 5:57 AM
#27
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
494
Plugin Contributions:
0

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

I just want to find out if the FREE SHIPPING Icon/Image is suppose to Show on the Front/Main/Index Page under the Specials, What's New & Featured Products Boxes?
Does stock zen-cart have that ability or does does ONLY the FREE or CALL FOR PRICE images/icons show up but NOT the FREE SHIPPING image/icon?

I am NOT talking about the Product Listings or the Category Pages, I already have the FREE SHIPPING correctly Displaying on those pages, I just want the FREE SHIPPING Image/Icon to display on the Front/Main/Index Page under the Specials, What's New & Featured Products Boxes JUST LIKE the FREE or CALL FOR PRICE images/icons show up on the Front/Main/Index Page under the Specials, What's New & Featured Products Boxes!!!

Not sure why there has been no solution for this seemingly simple thing? or are fellow zenners just not getting what I want?

Cheers,

*Zen Cart eCommerce Solution - Putting the Dream of Owning an Online Business within reach of anyone!

15 Oct 2012, 1:09 PM
#28
limitless avatar

limitless

Inactive

Join Date:
Jan 2012
Posts:
496
Plugin Contributions:
0

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

rlexyd:

I just want to find out if the FREE SHIPPING Icon/Image is suppose to Show on the Front/Main/Index Page under the Specials, What's New & Featured Products Boxes?
Does stock zen-cart have that ability or does does ONLY the FREE or CALL FOR PRICE images/icons show up but NOT the FREE SHIPPING image/icon?

I am NOT talking about the Product Listings or the Category Pages, I already have the FREE SHIPPING correctly Displaying on those pages, I just want the FREE SHIPPING Image/Icon to display on the Front/Main/Index Page under the Specials, What's New & Featured Products Boxes JUST LIKE the FREE or CALL FOR PRICE images/icons show up on the Front/Main/Index Page under the Specials, What's New & Featured Products Boxes!!!

Not sure why there has been no solution for this seemingly simple thing? or are fellow zenners just not getting what I want?

Cheers,

My template does not have that/do that, atleast on the the Featured Products, whether or not its there by default, I don't know.

16 Oct 2012, 5:58 AM
#29
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
494
Plugin Contributions:
0

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

Hi Limitless,

Kinda seems weird the FREE or CALL FOR PRICE image/icon appears but NOT the FREE SHIPPING button?
Since it doesn't come that way stock I think it should be quite easy to make it show JUST like the FREE & CALL FOR PRICE do!!

Hoping DrByte reads this post as he will have the solution in 2 seconds :)

*Zen Cart eCommerce Solution - Putting the Dream of Owning an Online Business within reach of anyone!

16 Oct 2012, 1:53 PM
#30
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

Have you a link to your main page where you are trying to see the Free Shipping image?

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!]
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!

17 Oct 2012, 12:25 AM
#31
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

On you main home page ... are you trying to see the Free Shipping icon on the New Products centerbox and Featured Products centerbox?

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!]
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!

17 Oct 2012, 3:25 AM
#32
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

rlexyd:

Hi Limitless,

Kinda seems weird the FREE or CALL FOR PRICE image/icon appears but NOT the FREE SHIPPING button?
Since it doesn't come that way stock I think it should be quite easy to make it show JUST like the FREE & CALL FOR PRICE do!!

Hoping DrByte reads this post as he will have the solution in 2 seconds :)

"Free" and "Call for Price" are REPLACEMENTS for prices. They have nothing to do with shipping.
Adding yet another image would require custom coding to suit your unique needs.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

17 Oct 2012, 9:51 PM
#33
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
494
Plugin Contributions:
0

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

Ajeh:

On you main home page ... are you trying to see the Free Shipping icon on the New Products centerbox and Featured Products centerbox?

Yes Linda, I am trying to show the FREE SHIPPING icon in the Centerboxes of the (Featured & New Products) on the Main Page.

From what DrByte just wrote, is that is something that doesn't come stock and needs special coding.

DrByte:

"Free" and "Call for Price" are REPLACEMENTS for prices. They have nothing to do with shipping.
Adding yet another image would require custom coding to suit your unique needs.

Would You or DrByte like to advise which .php files need to be edited and what codes might need to be added?
I can follow instructions very well.

If either of you could help that would be very much appreciated :)

I'm sure the solution would benefit many Zen-Cart users!

Cheers,

*Zen Cart eCommerce Solution - Putting the Dream of Owning an Online Business within reach of anyone!

18 Oct 2012, 1:56 AM
#34
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

You could customize the Featured Product by copying:
/includes/modules/featured_products.php

to you templates and overrides directory:
/includes/modules/your_template_dir/featured_products.php

and adding the code in RED:

  while (!$featured_products->EOF) {
    $products_price = zen_get_products_display_price($featured_products->fields['products_id']);
    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']);

[B]// bof: add always free shipping image
    $chk_free_shipping = '';
    $chk_free_shipping_image = '';
    $chk_free_shipping = zen_get_product_is_always_free_shipping($featured_products->fields['products_id']);
    if ($chk_free_shipping) {
      $chk_free_shipping_image = TEXT_PRODUCT_FREE_SHIPPING_ICON;
    }
[/B]    $list_box_contents[$row][$col] = array('params' =>'class="centerBoxContentsFeatured centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => (($featured_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<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><br />') . '<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><br />' . $products_price[B] . ($chk_free_shipping_image ? '<br>' . $chk_free_shipping_image : '')[/B]);
// eof: add always free shipping image

    $col ++;

then follow a similar pattern for the new_products.php module ...

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!]
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!

19 Oct 2012, 7:18 AM
#35
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
494
Plugin Contributions:
0

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

WOOW LINDA, YOU'RE FREAKIN AWESOME :clap:

That worked like a Charm, Thank You so much!

I'm sure it will come in handy for many Zenners :)

Cheers,

p.s: If anyone wanting to do this, make sure you scroll the code above all the way to the end as there is another code in red which you have to scroll all the way to the right to see :)

*Zen Cart eCommerce Solution - Putting the Dream of Owning an Online Business within reach of anyone!

19 Oct 2012, 7:24 AM
#36
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

Thanks for the update that this worked for you ... :smile:

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!]
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!

29 Oct 2012, 2:24 PM
#37
neily avatar

neily

New Zenner

Join Date:
Oct 2012
Posts:
1
Plugin Contributions:
0

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

Any chance of a web link to see how this looks?

27 Jan 2013, 9:48 PM
#38
mickmo68 avatar

mickmo68

Zen Follower

Join Date:
Apr 2008
Location:
Boston
Posts:
129
Plugin Contributions:
0

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

I'd like to do this to my Specials in the centerbox on my home page (add the Always Free Shipping image when called) but I can't figure out where to put Linda's code (above) in my /includes/modules/your_template_dir/specials_index.php without breaking it. Any help would be greatly appreciated.
v. 1.3.9

/includes/modules/your_template_dir/specials_index.php

<?php
/**
 * specials_index module
 *
 * @package modules
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: specials_index.php 6424 2007-05-31 05:59:21Z ajeh $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}

// initialize vars
$categories_products_id_list = '';
$list_of_products = '';
$specials_index_query = '';
$display_limit = '';

if ( (($manufacturers_id > 0 && $_GET['filter_id'] == 0) || $_GET['music_genre_id'] > 0 || $_GET['record_company_id'] > 0) || (!isset($new_products_category_id) || $new_products_category_id == '0') ) {
  $specials_index_query = "select p.products_id, p.products_image, pd.products_name, p.master_categories_id
                           from (" . TABLE_PRODUCTS . " p
                           left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id
                           left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
                           where p.products_id = s.products_id
                           and p.products_id = pd.products_id
                           and p.products_status = '1' and s.status = 1
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
} else {
  // get all products and cPaths in this subcat tree
  $productsInCategory = zen_get_categories_products_list( (($manufacturers_id > 0 && $_GET['filter_id'] > 0) ? zen_get_generated_category_path_rev($_GET['filter_id']) : $cPath), false, true, 0, $display_limit);

  if (is_array($productsInCategory) && sizeof($productsInCategory) > 0) {
    // build products-list string to insert into SQL query
    foreach($productsInCategory as $key => $value) {
      $list_of_products .= $key . ', ';
    }
    $list_of_products = substr($list_of_products, 0, -2); // remove trailing comma
    $specials_index_query = "select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id
                             from (" . TABLE_PRODUCTS . " p
                             left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id
                             left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
                             where p.products_id = s.products_id
                             and p.products_id = pd.products_id
                             and p.products_status = '1' and s.status = '1'
                             and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                             and p.products_id in (" . $list_of_products . ")";
  }
}
if ($specials_index_query != '') $specials_index = $db->ExecuteRandomMulti($specials_index_query, MAX_DISPLAY_SPECIAL_PRODUCTS_INDEX);

$row = 0;
$col = 0;
$list_box_contents = array();
$title = '';

$num_products_count = ($specials_index_query == '') ? 0 : $specials_index->RecordCount();

// show only when 1 or more
if ($num_products_count > 0) {
  if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS == 0 ) {
    $col_width = floor(100/$num_products_count);
  } else {
    $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS);
  }

  $list_box_contents = array();
  while (!$specials_index->EOF) {

    $products_img = (($specials_index->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'products_id=' . (int)$specials_index->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $specials_index->fields['products_image'], $specials_index->fields['products_name'], 100, 100) . '</a>');
    
    $products_name = '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'products_id=' . $specials_index->fields['products_id']) . '">' . zen_get_products_name($specials_index->fields['products_id']) . '</a>';
    
    $products_desc = substr(strip_tags($specials_index->fields['products_description']), 0, 100) . '...';
    
    $products_price = zen_get_products_display_price($specials_index->fields['products_id']);
    
    $products_link = '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'products_id=' . $specials_index->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_GOTO_PROD_DETAILS, BUTTON_GOTO_PROD_DETAILS_ALT) . '</a>';


    if (SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS > 1 && $num_products_count > 1) {
    
        if ($col > 0 && $col < SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS) {
            $tm_param = 'style="margin-left:2px;"';
        } else {
            $tm_param = '';
        }
    
    $list_box_contents[$row][$col] = array('params' =>'class="centerBoxContentsSpecials centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => 
    
            '<div class="product product_border" align="center" ' . $tm_param . '>
                <div class="margin_col">
                    ' . $products_img . '<br />
                    ' . $products_name . '<br />
                    <div class="text">
                        ' . $products_desc . '<br />
                    </div>
                    Price: <strong>' . $products_price . '</strong><br>
                    ' . $products_link . '
                    <div class="spacer"><br class="clear" /></div>
                </div>
            </div>'
                    
            );
    
    } else {

    $list_box_contents[$row][$col] = array('params' =>'class="centerBoxContentsSpecials centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => 
    
            '<div class="product product_border">
                <div class="w_100">
                    <div class="right" style="margin-left:-' . $img_col_w . 'px;">
                        <div class="margin">
                            ' . $products_name . '<br />
                            <div class="text">
                                ' . $products_desc . '
                            </div>
                            <div class="price">
                                Price: <strong>' . $products_price . '</strong>
                            </div>
                            <div class="button">' . $products_link . '</div>
                            <div class="spacer"><br class="clear" /></div>
                        </div>
                    </div>
                    <div class="right" style="width:' . $img_col_w . 'px;">' . $products_img . '</div>
                    <div class="clearBoth"></div>
                </div>
            </div>'
                    
            );
    
    }



    $col ++;
    if ($col > (SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS - 1)) {
      $col = 0;
      $row ++;
    }
    $specials_index->MoveNextRandom();
  }

  if ($specials_index->RecordCount() > 0) {
    $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime('%B')) . '</h2>';
    $zc_show_specials = true;
  }
}
?>
27 Jan 2013, 10:09 PM
#39
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

Mickmo68:

but I can't figure out where to put Linda's code (above) ... without breaking it.
What are the symptoms you encounter when you say you've "broken it"?
If it's a blank page, then the details of the PHP error causing the blank page would be a fast clue to the solution: http://www.zen-cart.com/content.php?124-blank-page

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

28 Jan 2013, 1:34 AM
#40
mickmo68 avatar

mickmo68

Zen Follower

Join Date:
Apr 2008
Location:
Boston
Posts:
129
Plugin Contributions:
0

Re: Product FREE Shipping IMAGE not showing up on Main & Product Page:

Yes, sorry, page goes blank. Below is what I tried but I'm afraid I don't understand the cod logic and syntax. Any help is appreciated.

<?php /** * specials_index module * * @package modules * @copyright Copyright 2003-2007 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: specials_index.php 6424 2007-05-31 05:59:21Z ajeh $ */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } // initialize vars $categories_products_id_list = ''; $list_of_products = ''; $specials_index_query = ''; $display_limit = ''; if ( (($manufacturers_id > 0 && $_GET['filter_id'] == 0) || $_GET['music_genre_id'] > 0 || $_GET['record_company_id'] > 0) || (!isset($new_products_category_id) || $new_products_category_id == '0') ) { $specials_index_query = "select p.products_id, p.products_image, pd.products_name, p.master_categories_id from (" . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id ) where p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1' and s.status = 1 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'"; } else { // get all products and cPaths in this subcat tree $productsInCategory = zen_get_categories_products_list( (($manufacturers_id > 0 && $_GET['filter_id'] > 0) ? zen_get_generated_category_path_rev($_GET['filter_id']) : $cPath), false, true, 0, $display_limit); if (is_array($productsInCategory) && sizeof($productsInCategory) > 0) { // build products-list string to insert into SQL query foreach($productsInCategory as $key => $value) { $list_of_products .= $key . ', '; } $list_of_products = substr($list_of_products, 0, -2); // remove trailing comma $specials_index_query = "select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id from (" . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id ) where p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1' and s.status = '1' and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p.products_id in (" . $list_of_products . ")"; } } if ($specials_index_query != '') $specials_index = $db->ExecuteRandomMulti($specials_index_query, MAX_DISPLAY_SPECIAL_PRODUCTS_INDEX); $row = 0; $col = 0; $list_box_contents = array(); $title = ''; $num_products_count = ($specials_index_query == '') ? 0 : $specials_index->RecordCount(); // show only when 1 or more if ($num_products_count > 0) { if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS == 0 ) { $col_width = floor(100/$num_products_count); } else { $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS); } $list_box_contents = array(); while (!$specials_index->EOF) { $products_img = (($specials_index->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'products_id=' . (int)$specials_index->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $specials_index->fields['products_image'], $specials_index->fields['products_name'], 100, 100) . '</a>'); $products_name = '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'products_id=' . $specials_index->fields['products_id']) . '">' . zen_get_products_name($specials_index->fields['products_id']) . '</a>'; $products_desc = substr(strip_tags($specials_index->fields['products_description']), 0, 100) . '...'; $products_price = zen_get_products_display_price($specials_index->fields['products_id']); $products_######## = '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'products_id=' . $specials_index->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_GOTO_PROD_DETAILS, BUTTON_GOTO_PROD_DETAILS_ALT) . '</a>'; // bof: add always free shipping image $chk_free_shipping = ''; $chk_free_shipping_image = ''; $chk_free_shipping = zen_get_product_is_always_free_shipping($featured_products->fields['products_id']); if ($chk_free_shipping) { $chk_free_shipping_image = TEXT_PRODUCT_FREE_SHIPPING_ICON; } if (SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS > 1 && $num_products_count > 1) { if ($col > 0 && $col < SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS) { $tm_param = 'style="margin-left:2px;"'; } else { $tm_param = ''; } $list_box_contents[$row][$col] = array('params' =>'class="centerBoxContentsSpecials centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => '<div class="product product_border" align="center" ' . $tm_param . '> <div class="margin_col"> ' . $products_img . '<br /> ' . $products_name . '<br /> <div class="text"> ' . $products_desc . '<br /> </div> Price: <strong>' . $products_price . '</strong><br> ' . $products_######## . ' <div class="spacer"><br class="clear" /></div> </div> </div>' ); } else { $list_box_contents[$row][$col] = array('params' =>'class="centerBoxContentsSpecials centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => '<div class="product product_border"> <div class="w_100"> <div class="right" style="margin-left:-' . $img_col_w . 'px;"> <div class="margin"> ' . $products_name . '<br /> <div class="text"> ' . $products_desc . ' </div> <div class="price"> Price: <strong>' . $products_price . '</strong> </div> <div class="button">' . $products_######## . '</div> <div class="spacer"><br class="clear" /></div> </div> </div> <div class="right" style="width:' . $img_col_w . 'px;">' . $products_img . '</div> <div class="clearBoth"></div> </div> </div>' ); } . ($chk_free_shipping_image ? '<br>' . $chk_free_shipping_image : '')); $col ++; if ($col > (SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS - 1)) { $col = 0; $row ++; } $specials_index->MoveNextRandom(); } if ($specials_index->RecordCount() > 0) { $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime('%B')) . '</h2>'; $zc_show_specials = true; } } ?>