Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Default Specials Page

Default Specials Page

Views: 6,216

Results 21 to 22 of 22
12 Oct 2007, 3:21 AM
#21
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Default Specials Page

nrg77:

To add to what I just said, I refer back to the post where that person also experienced what I experienced as well. So I started counting the braces and yours is correct 4 open 4 close. So he too deleted one from yours thinking you put one too many but that is not the case...

Well, that was old code... old code had one too many, the new code does not have one too many.

19 May 2011, 4:40 PM
#22
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Default Specials Page

I've tried using the changes provided here but they just didn't work at all. So I changed some things here and there to make it work. The changes below make the specials page display with or without specials in it, a must for those of us who like to add images of coupons and promo codes to our specials page.

STEP 1. open includes/modules/pages/specials/main_template_vars.php

Find:

  $num_products_count = $specials->RecordCount();
  if ($num_products_count) {
    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);
    }

Replace with:

//show page even if no specials
$num_products_count = $specials->RecordCount();
if ($num_products_count > SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS==0 and $num_products_count!=0) {
$col_width = floor(100/$num_products_count);
$col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS);
} else {
if ($num_products_count == 0) {
$col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS);
}

STEP 2. open up includes/templates/YOUR_TEMPLATE/templates/tpl_specials_default.php

Find:

	<h1 id="specialsListingHeading"><?php echo BOX_HEADING_SPECIALS; ?></h1>

Replace with:

	<h1 id="specialsListingHeading"><?php echo BOX_HEADING_SPECIALS; ?></h1>
	<?php echo TEXT_SPECIALS_PAGE; }?>

STEP 3. You need to add a define for the above code. Open up includes/languages/YOUR_TEMPLATE/english.php

Add this:

define('TEXT_SPECIALS_PAGE', 'Add any images or text you want to display here.');

Instead of step 3 above I've hardcoded my tpl_specials_default.php file. It's up to you.

You can see one of my specials page here http://www.byvalenti.com/index.php?main_page=specials

Hope someone can find this helpful.

M.Valenti
Contemporary Artist - Entrepreneur
http://www.manuelavalenti.com - http://www.byvalenti.com