Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

can boxes be hidden depending on what page they are on


horsetags

Recommended Posts

Hi

I want to show some boxes on the pages they relate to only and not on any other.

 

Is there any code that will do this?

I have already hidden the shopping cart with some code i found here but that doesn't help me in this.

 

Any help would be great

 

Thanks

Paul

Link to comment
Share on other sites

In the column left or right file, find the line that calls the box you want to hide and add this before it

if (basename($PHP_SELF) != FILENAME_DEFAULT)

That will prevent that box from being shown on the index page. To change the page, change FILENAME_DEFAULT.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

 

 

Thanks for answering

 

 

I looked at that but i have about 20 pages that require it and just as many that don't and i'm not sure how to implement that many. I have two main categories, one of which i want the boxes on and one i don't, so a function that says something like " if cpath = 22 don't show etc

 

Thanks again

 

Paul

 

In the column left or right file, find the line that calls the box you want to hide and add this before it
if (basename($PHP_SELF) != FILENAME_DEFAULT)

That will prevent that box from being shown on the index page. To change the page, change FILENAME_DEFAULT.

 

Jack

 

 

Thanks Jack, but the pages are from one of my categories which don't have an individual page name as such, they all come from product_info.php, or can you state a relative url?

 

Problem is, i have loads of pages that require the box and loads that don't.

 

I have two main categories, Cards and Gifts. One cat needs these boxes, the other doesn't, so i was wondering how i could change your code to reference a cpath instead of a filename?

 

thanks again

 

Paul

Link to comment
Share on other sites

Thanks Jack, i think your right, but at the moment, i don't know how to do this. Oh well.

Thanks again for your time

Paul

you can make it as crazy as you want like :

 

 

if (

(stristr(basename($PHP_SELF),'index')) and

(isset($_GET['cPath'])) and

($request_type != 'SSL')

) {

include(DIR_WS_BOXES . 'best_sellers_image.php');

}

Treasurer MFC

Link to comment
Share on other sites

you can make it as crazy as you want like :

if (

(stristr(basename($PHP_SELF),'index')) and

(isset($_GET['cPath'])) and

($request_type != 'SSL')

) {

include(DIR_WS_BOXES . 'best_sellers_image.php');

}

 

Thanks for that.

 

Being a bit green, where would i specify the cPath exactly, in the isset line?

 

I would have answered sooner but the forum tracker doesn't seem to send me all of the replies :-(

 

 

Thanks again

 

Paul

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...