Forums / Basic Configuration / Not to show Featured Product Sidebox on main page

Not to show Featured Product Sidebox on main page

Locked

Views: 9,357

Results 1 to 20 of 48
This thread is locked. New replies are disabled.
4 Nov 2006, 2:18 PM
#1
dealbyethan_com avatar

dealbyethan_com

Totally Zenned

Join Date:
Dec 2005
Location:
Perth, Western Australia, Australia
Posts:
782
Plugin Contributions:
0

Not to show Featured Product Sidebox on main page

Hi,

I am just wondering if it is possible to show Feature Product Sidebox on other pages but not on the main page? Is there a button where I can simply turn it off? Please let me know. Thanks.

Best regards,
Ethan

**The Team Behind DealByEthan.com | **Curating unique finds for a discerning community. Committed to a seamless and inspiring shopping experience. *Connect with us: *https://linktr.ee/dealbyethan

4 Nov 2006, 2:25 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Not to show Featured Product Sidebox on main page

You can customize the side box to disable when the variable:

$this_is_home_page

is true ...

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!

4 Nov 2006, 2:40 PM
#3
dealbyethan_com avatar

dealbyethan_com

Totally Zenned

Join Date:
Dec 2005
Location:
Perth, Western Australia, Australia
Posts:
782
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

Hi Ajeh,

Thanks for your quick response. Where do I find the variable $this_is_home_page? I got no luck using the Developers Tool Kit. Please let me know. Thanks again.

Best regards,
Ethan

**The Team Behind DealByEthan.com | **Curating unique finds for a discerning community. Committed to a seamless and inspiring shopping experience. *Connect with us: *https://linktr.ee/dealbyethan

4 Nov 2006, 3:40 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Not to show Featured Product Sidebox on main page

Sorry this was new in v1.3.5 ... and updated in v1.3.6 ...

I just realized you are v1.2.7 ...

You can download a v1.3.6 and see how this is done to cover all the possible settings for determining a true home page ...

It will be something like this that you could use:

$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) );
 

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!

5 Nov 2006, 4:08 AM
#5
dealbyethan_com avatar

dealbyethan_com

Totally Zenned

Join Date:
Dec 2005
Location:
Perth, Western Australia, Australia
Posts:
782
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

Hi Ajeh,

Thanks for your reply. It sounds complicated. Can you provide me with more instructions?

Regards,
Ethan

**The Team Behind DealByEthan.com | **Curating unique finds for a discerning community. Committed to a seamless and inspiring shopping experience. *Connect with us: *https://linktr.ee/dealbyethan

5 Nov 2006, 1:56 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Not to show Featured Product Sidebox on main page

Add that to the top of the sidebox ...

When $this_is_home_page is true then you do not want to show the sidebox ...

NOTE: this is already built into v1.3.6 and above ... so you will not need it in the sidebox when you upgrade ...

the /includes/modules/sideboxes/featured.php already has in it:

// test if box should display
$show_featured= true;

When $show_featured is true the sidebox shows ...

NOTE: there is a second check following the select of the featured products for whether or not there is "something" to show ... you only care if you are on the main page, from there the sidebox can run normally ...

So below the
$show_featured = true;

You could add the code:

$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) ); 
$show_featured = $this_is_home_page;

NOTE: This is written in two lines so that you can find it easily in the future for upgrading ...

What this will do is turn on/off the featured sidebox based on if you are on the home page or not ...

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!

11 Nov 2006, 10:11 AM
#7
dealbyethan_com avatar

dealbyethan_com

Totally Zenned

Join Date:
Dec 2005
Location:
Perth, Western Australia, Australia
Posts:
782
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

Hi Ajeh,

I took your suggestion to add the following code under $show_featured= true;

$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) );
$show_featured = $this_is_home_page;

However, the Featured Product Sidebox still shows up on the homepage. What did I miss?

Regards,
Ethan

**The Team Behind DealByEthan.com | **Curating unique finds for a discerning community. Committed to a seamless and inspiring shopping experience. *Connect with us: *https://linktr.ee/dealbyethan

11 Nov 2006, 2:34 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Not to show Featured Product Sidebox on main page

You just set $show_featured to true on the main page ... so it shows ... :eek:

You need it the other way ...

$show_featured = !$this_is_home_page;

Now when the it is the main page, this is false and when not the main page it is true ...

When false it is skipped and when true it runs ...

Got all that? :lamo:

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!

11 Nov 2006, 3:06 PM
#9
dealbyethan_com avatar

dealbyethan_com

Totally Zenned

Join Date:
Dec 2005
Location:
Perth, Western Australia, Australia
Posts:
782
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

Hi Ajeh,

Thanks for getting back to me. Sorry, I am afraid I need more help as I am not familar with php code. There are two $show_featured, which one did you refer to? Do you mean to change this code from:
$show_featured= true;
$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) );
$show_featured = $this_is_home_page;

to this code:
$show_featured= false;
$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) );
$show_featured = $this_is_home_page;

OR to this code:
$show_featured= !$this_is_home_page;
$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) );
$show_featured = $this_is_home_page;

I try all these and none of them work. Please help. Thanks again.

Best regards,
Ethan

**The Team Behind DealByEthan.com | **Curating unique finds for a discerning community. Committed to a seamless and inspiring shopping experience. *Connect with us: *https://linktr.ee/dealbyethan

11 Nov 2006, 3:17 PM
#10
ajeh avatar

ajeh

Oba-san

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

Re: Not to show Featured Product Sidebox on main page

$show_featured= false;
$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) );
$show_featured = $this_is_home_page;

You are setting $show_featured to false ...

Then you setting the main page value to $this_is_home_page ...

Then you are setting the results to $show_featured but you want the opposite result ...

When main page do not show, as in: !$this_is_home_page meaning if I am the home page, don't show, so I need to be false ... !true is false ...

So the results would be:

if (true) {
// show box
}

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!

11 Nov 2006, 4:04 PM
#11
dealbyethan_com avatar

dealbyethan_com

Totally Zenned

Join Date:
Dec 2005
Location:
Perth, Western Australia, Australia
Posts:
782
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

Hi Ajeh,

So are you saying the correct code I should use is:

$show_featured= false;
$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) );
$show_featured = !$this_is_home_page;
if (true) {
// show box
}

Is that it? If not, can you give me the "cut and paste" code to make my life easier? :) Thanks for your patience. Much appreciated.

Regards,
Ethan

**The Team Behind DealByEthan.com | **Curating unique finds for a discerning community. Committed to a seamless and inspiring shopping experience. *Connect with us: *https://linktr.ee/dealbyethan

11 Nov 2006, 4:07 PM
#12
ajeh avatar

ajeh

Oba-san

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

Re: Not to show Featured Product Sidebox on main page

Old Code:

// test if box should display
  $show_featured= true;

  if ($show_featured == true) {

New Code:

// test if box should display
  $show_featured= true;
  $this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) );
  $show_featured = !$this_is_home_page;

  if ($show_featured == true) {

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!

11 Nov 2006, 4:17 PM
#13
dealbyethan_com avatar

dealbyethan_com

Totally Zenned

Join Date:
Dec 2005
Location:
Perth, Western Australia, Australia
Posts:
782
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

Hi Ajeh,

I tried the new code but the Feature sidebox is still showing on the main page I am afraid. What should I do now?

Regards,
Ethan

**The Team Behind DealByEthan.com | **Curating unique finds for a discerning community. Committed to a seamless and inspiring shopping experience. *Connect with us: *https://linktr.ee/dealbyethan

11 Nov 2006, 5:17 PM
#14
ajeh avatar

ajeh

Oba-san

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

Re: Not to show Featured Product Sidebox on main page

Do you have an override for the file:
/includes/modules/sideboxes/featured.php

in your overrides directory?
/includes/modules/sideboxes/your_template_dir/featured.php

Are you changing the right file?

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!

12 Nov 2006, 1:44 AM
#15
dealbyethan_com avatar

dealbyethan_com

Totally Zenned

Join Date:
Dec 2005
Location:
Perth, Western Australia, Australia
Posts:
782
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

Hi Ajeh,

Thank you. I got that to work now :)
I also want to turn off the New Product Sidebox on the main page. Do I apply the same principle? I had a look at the file and the coding is slightly different. Not sure how to fit the code you gave me in there.

Regards,
Ethan

**The Team Behind DealByEthan.com | **Curating unique finds for a discerning community. Committed to a seamless and inspiring shopping experience. *Connect with us: *https://linktr.ee/dealbyethan

12 Nov 2006, 1:51 AM
#16
ajeh avatar

ajeh

Oba-san

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

Re: Not to show Featured Product Sidebox on main page

On the new products sidebox ... you need to add an IF around the whole code ...

This is not using the:

if ($show_something) {

But you could add one similar to the featured for:

if ($show_whats_new == true) {
// all code here
}

And build the $show_whats_new in the same manner ...

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!

12 Nov 2006, 3:19 AM
#17
dealbyethan_com avatar

dealbyethan_com

Totally Zenned

Join Date:
Dec 2005
Location:
Perth, Western Australia, Australia
Posts:
782
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

Hi Ajeh,

Thanks very much :) It worked. Magic!

Regards,
Ethan

**The Team Behind DealByEthan.com | **Curating unique finds for a discerning community. Committed to a seamless and inspiring shopping experience. *Connect with us: *https://linktr.ee/dealbyethan

12 Nov 2006, 3:20 AM
#18
ajeh avatar

ajeh

Oba-san

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

Re: Not to show Featured Product Sidebox on main page

You are most welcome ... glad you are starting to get the hang of this now ... :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!

16 Nov 2006, 6:16 PM
#19
burtjesus avatar

burtjesus

New Zenner

Join Date:
Sep 2006
Posts:
32
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

Hi,

I am looking for a solution similar to this issue.

Is there a flag like $show_featured for the information box? I don't see any test to show the information box in any of the information box pages. I want to hide the information box on all pages except one ez page. The original post is located here:

http://www.zen-cart.com/forum/showthread.php?t=51520

If I could just grab the flag to show/hide the info box, then I should be set.

Any help would be great! Thanks.


Steve

17 Nov 2006, 3:31 AM
#20
ajeh avatar

ajeh

Oba-san

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

Re: Not to show Featured Product Sidebox on main page

You can build an IF surrounding the code for any of the sideboxes to test any condition you like ...

$some_condition_here = something_is_evaluated;
if ($some_condition_here == true) {
// code here
}

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!