Forums / General Questions / adding a message to special section

adding a message to special section

Started by tony_sar on 7 Feb 2012, 9:49 PM · Views: 713

Results 1 to 8 of 8
7 Feb 2012, 9:49 PM
#1
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

adding a message to special section

hello.
As part of navigation , i am adding Specials link to my nav. Problem is that , if there are no specials , center box is empty . i like to add a message saying something like sorry there are no special today. bla bla.

i like to know how i can do that .

Thanks.

12 Feb 2012, 12:48 PM
#2
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: adding a message to special section

any advice ??

12 Feb 2012, 3:29 PM
#3
ajeh avatar

ajeh

Oba-san

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

Re: adding a message to special section

If you look how the Categories sidebox manages this, you should be able to adapt the code for what you are doing ...

    if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {
      $show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= 1 limit 1");
      if ($show_this->RecordCount() > 0) {
        $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_SPECIALS) . '">' . CATEGORIES_BOX_HEADING_SPECIALS . '</a>' . '<br />' . "\n";
      }
    }

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!

13 Feb 2012, 9:16 AM
#4
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: adding a message to special section

Thank for the pointer . will try to make it work from here on . :)

18 Feb 2012, 12:51 AM
#5
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: adding a message to special section

i failed .. codes are not my thing . anyone with more straight forward code to solve this problem ? :unsure:

18 Feb 2012, 1:00 AM
#6
ajeh avatar

ajeh

Oba-san

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

Re: adding a message to special section

You may need to adjust this but see if it helps:

<?php
// bof: specials link
      $show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= 1 limit 1");
      if ($show_this->RecordCount() > 0) {
        echo '<li><a href="' . zen_href_link(FILENAME_SPECIALS) . '">' . 'Specials' . '</a>' . '</li>';
      }
// eof: specials link
?>

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!

18 Feb 2012, 1:01 AM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: adding a message to special section

To give a message in the specials page if empty```php
$show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= 1 limit 1");
if ($show_this->RecordCount() !> 0) {

    echo 'There are no specials today.';

  }
18 Feb 2012, 2:24 PM
#8
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: adding a message to special section

Thank you both . I am kinda confused .. where is that code ? do i need to add it to a page ? which page and where exactly . .

sorry , to much drug in my system and I cANT tHINK Straight .. really :no: