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 21 to 40 of 48
This thread is locked. New replies are disabled.
20 Nov 2006, 10:40 PM
#21
axel1 avatar

axel1

New Zenner

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

Not to show Featured Product Sidebox on main page

Can this be applied for Categories box?

Axel

21 Nov 2006, 3:29 AM
#22
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 control all sideboxes by setting a given condition and just not letting it run ...

Same holds true of any page, column, centerbox, etc.

That is the beauty of being able to customize the code ... just need to find the trigger to manage the element that you are trying to control ... :cool:

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!

26 Jan 2007, 8:09 PM
#23
cristele avatar

cristele

New Zenner

Join Date:
Nov 2006
Posts:
8
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

Hi there,

Just did what was suggested in that thread, it works great.
I have a question though: I'd rather not touch the code that is not in MY_TEMPLATE.
Is there any suggestion to be able to do the same thing as changing into modules/incription.php (example given) but to keep this change in MY_TEMPLATE?

I've modified the tpl_information.php with the if statement suggested here , but the header of "information" still appears. (which is logical). Anyway to pick up whatever sidebox you want for different pages/ categories without touching the core code?

THanks!

cristele

26 Jan 2007, 8:38 PM
#24
burtjesus avatar

burtjesus

New Zenner

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

Re: Not to show Featured Product Sidebox on main page

Copy the file and place it within your template folder beneath modules/.

Use:

modules/MY_TEMPLATE/incription.php

Then you can modify that code without worrying about messing up the core file.

Keep in mind that whereever you see a classic folder, you can place your own folder with the same name as MY_TEMPLATE to override the core files, without modifying core files.


Steve

27 Jan 2007, 8:37 PM
#25
cristele avatar

cristele

New Zenner

Join Date:
Nov 2006
Posts:
8
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

burtjesus:

Copy the file and place it within your template folder beneath modules/.

Use:

modules/MY_TEMPLATE/incription.php

Then you can modify that code without worrying about messing up the core file.

Keep in mind that whereever you see a classic folder, you can place your own folder with the same name as MY_TEMPLATE to override the core files, without modifying core files.
it didnt work...let me check i got you write:

my template's name is "MY_TEMPLATE".
so you say the inscription.php should be here:
[zencart_location]\includes\templates\MY_TEMPLATE\modules\MY_TEMPLATE\inscription.php

Is it correct?

thanks,
cristele

27 Jan 2007, 9:01 PM
#26
burtjesus avatar

burtjesus

New Zenner

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

Re: Not to show Featured Product Sidebox on main page

The file should be located in /includes/modules/MY_TEMPLATE/[somefile.php]

This file will override the default file located in /includes/modules

Keep in mind that whereever you see a classic folder, you can place your own folder with the same name as MY_TEMPLATE to override the core files, without modifying core files.


Steve

1 Feb 2007, 5:52 PM
#27
cristele avatar

cristele

New Zenner

Join Date:
Nov 2006
Posts:
8
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

That's very cool....works like a charm:cool:
This is the coolest feature about ZenCart!

1 Feb 2007, 6:05 PM
#28
burtjesus avatar

burtjesus

New Zenner

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

Re: Not to show Featured Product Sidebox on main page

It's a fantastic template override system.

It's important that you don't modify core files.. you should always use template override. Just create a folder in the appropriate directory called MY_TEMPLATE (use the real name of your template) and copy the default files into it. You can modify those files. If you screw it up royally, you can remove your override file, and the cart will use the defualt files again.

See this link for some more info, and try some other searches in the tutorials or wiki
https://www.zen-cart.com/tutorials/index.php?article=36


Steve

4 Aug 2008, 9:36 PM
#29
merlin01326 avatar

merlin01326

New Zenner

Join Date:
Apr 2008
Posts:
27
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

I have really tried to follow this thread, copying and pasting and testing and ...... getting nowhere except very frustrated.

I downloaded the blank_sidebox.php. Renamed it to colour_sidebox.php
into the 3 relevant folders as per the instructions.

I am using override of merlin/. on the admin/tools/layout boxes controller I have turned on the sidebox.

It now shows on all pages. However, I do not want it to show on the home page.

What code do I use please and where do I put it.. Polite responses please..

Thank you in anticipation

6 Aug 2008, 3:40 PM
#30
merlin01326 avatar

merlin01326

New Zenner

Join Date:
Apr 2008
Posts:
27
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

Bump !

Following on from the above, I have changed my code to the following.

The Colours side box still shows on the main page. Any ideas please..
I have tried changing the false to true, but nothing happens

// test if box should display
$show_colour_sidebox = false;

$this_is_home_page = $($current_page== 'sideboxes');
$show_colour_sidebox = !$this_is_home_page;

if ($show_colour_sidebox == true) {
require($template->get_template_dir('tpl_colour_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_colour_sidebox.php');
$title = BOX_HEADING_COLOUR_SIDEBOX;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
?>

6 Aug 2008, 5:04 PM
#31
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

If I were to do this to the Featured sidebox ... I would copy the code to the proper templates and overrides and edit the file to change:

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

To read:

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

  $show_featured = !$this_is_home_page;

Now the condition is based on the existing $this_is_home_page and only shows when false or !$this_is_home_page

So more or less you are using:

// test if box should display
$show_colour_sidebox = false;

$this_is_home_page = $($current_page== 'sideboxes');
$show_colour_sidebox = !$this_is_home_page;

And should be using:

// test if box should display
// $show_colour_sidebox = false;

$show_colour_sidebox = !$this_is_home_page;

Note: commenting out the:

// $show_colour_sidebox = false;

is just to eliminate confusion ... whether or not it is commented out is is reset by the next line:

$show_colour_sidebox = !$this_is_home_page;

Easy smeasy, eh? :cool:

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!

6 Aug 2008, 6:06 PM
#32
merlin01326 avatar

merlin01326

New Zenner

Join Date:
Apr 2008
Posts:
27
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

Hi Linda
I wish it was so easy.

This is the code I now have.

// test if box should display

$show_colour_sidebox = !$this_is_home_page;

if ($show_colour_sidebox == true) {
require($template->get_template_dir('tpl_colour_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_colour_sidebox.php');
$title = BOX_HEADING_COLOUR_SIDEBOX;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
?>

this code resides in ..includes\modules\MY_TEMPLATE_NAME\colour_sidebox.php

Unfortunately the colour side box still shows on the main page.
This is the only colour_sidebox.php file that I have on the system. So I must be missing something else.

thank you for your prompt reply..

I will get the hang of this.......

6 Aug 2008, 6:30 PM
#33
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 this just before the IF statement in your sidebox:

echo 'I SEE ' . ($this_is_home_page == true ? "Lucy I'm Home!" : "Rick? Where are you");

Then look where you should see the sidebox and tell me what it reads ... :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!

6 Aug 2008, 6:37 PM
#34
merlin01326 avatar

merlin01326

New Zenner

Join Date:
Apr 2008
Posts:
27
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

Hi I have added the code as suggested and all I get is the side box

no other description...

6 Aug 2008, 6:41 PM
#35
merlin01326 avatar

merlin01326

New Zenner

Join Date:
Apr 2008
Posts:
27
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

I am running V 1.3.7

6 Aug 2008, 7:31 PM
#36
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

Have you an URL to your site and do you have the sidebox currently show on your site?

And your code looks like what now?

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!

6 Aug 2008, 8:06 PM
#37
merlin01326 avatar

merlin01326

New Zenner

Join Date:
Apr 2008
Posts:
27
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

Hi Linda
Sorry. I am working on localhost, building the site, as I am already live with a HTML site at https://www.merlinmounts.co.uk...

I know this is not the ideal solution, but I am sure you are aware it is the easiest option. - until that is.. one gets problems...

This is my code that I have in...

store\includes\modules\merlin\colour_sidebox.php.

merlin is my override folder..

Basically I downloaded the Blank_sidebox 2 from the site. Changed all occurences of blank_sidebox to my own name of colour_sidebox in the 3 override folders.

// test if box should display
// $show_colour_sidebox = false;

// $this_is_home_page = $($current_page== 'sideboxes');
$show_colour_sidebox = !$this_is_home_page;
echo 'I SEE ' . ($this_is_home_page == true ? "Lucy I'm Home!" : "Rick? Where are you");

if ($show_colour_sidebox == true) {
require($template->get_template_dir('tpl_colour_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_colour_sidebox.php');
$title = BOX_HEADING_COLOUR_SIDEBOX;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
?>

6 Aug 2008, 8:15 PM
#38
merlin01326 avatar

merlin01326

New Zenner

Join Date:
Apr 2008
Posts:
27
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

To help me understand. could you please explain briefly where the term

$this_is_home_page

comes from. Is it an actual name of a page?

6 Aug 2008, 8:27 PM
#39
merlin01326 avatar

merlin01326

New Zenner

Join Date:
Apr 2008
Posts:
27
Plugin Contributions:
0

Re: Not to show Featured Product Sidebox on main page

Sorry to add to the above.

Is it the same as $this_is_main_page.php

7 Aug 2008, 2:05 AM
#40
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

$this_is_home_page is a variable set when the main page is resolved to the actual "home" page of your site to distinguish between all of the other pages ...

You can find where it is set by going to the Developers Tool Kit in your Admin under the Tools menu ...

Enter it in the bottom input box and select Catalog/Admin and click search ...

You will see where there is a:
$this_is_home_page = blah blah blah

Now, if you do not find this ... then you have files out of date from an upgrade issue ...

I am really surprised that you are not seeing Lucy or Ricky on this as one or the other should be showing ...

Are you sure you are editing 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!