Page 1 of 4 123 ... LastLast
Results 1 to 10 of 32
  1. #1
    Join Date
    Jun 2007
    Location
    Michigan
    Posts
    187
    Plugin Contributions
    0

    help question Need SideBox to show in One Catagory Only

    I just can't figure this out. Please Help!!!!

    I downloaded the Absolute Links Sidebox contribution and it works perfectly. Just wonderful.


    Here's the delima:
    The issue that I'm having is that it shows on ALL pages and I only want it to show up on certain pages and/or certain catagories.

    Now, If it's a page with a page-name, I can surpress the sidebox on that particular page with no problem

    BUT....
    I have 2 specific catagories that I truly want this sidebox on, the only issue is that it does not have a typical page-name, it has 'main_page=product_info&cPath= 'somenumber'

    What do I do to make the this particular side box only show on those pages?

    Thank you in advance for your quick response.
    lj

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Need SideBox to show in One Catagory Only

    PHP Code:
    if ($_GET['cPath'] == 12 or $_GET['cPath'] == 47) {
    //do it
    } else {
    //skip it

    Or, you might use:
    PHP Code:
    if ($current_category_id == 12 or $current_category_id == 47) {
    //do it
    } else {
    // skip it

    If you peek in the sideboxes ... you will see how many have a $show_blah_blah ... look to see how that is used ...
    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: v1.5.5]
    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!

  3. #3
    Join Date
    Jun 2007
    Location
    Michigan
    Posts
    187
    Plugin Contributions
    0

    Default Re: Need SideBox to show in One Catagory Only

    Ummmm....guess what?

    IT WORKED, IT ACTUALLY WORKED...

    Okay, I'm about to go donate now....
    Thank you so much.
    lj
    ---


    Quote Originally Posted by Ajeh View Post
    PHP Code:
    if ($_GET['cPath'] == 12 or $_GET['cPath'] == 47) {
    //do it
    } else {
    //skip it

    Or, you might use:
    PHP Code:
    if ($current_category_id == 12 or $current_category_id == 47) {
    //do it
    } else {
    // skip it

    If you peek in the sideboxes ... you will see how many have a $show_blah_blah ... look to see how that is used ...

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Need SideBox to show in One Catagory Only

    Thanks for the update ... glad that this could work for you ...

    We also appreciate the support to help us continue to make your e-commerce solution better ...
    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: v1.5.5]
    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. #5
    Join Date
    Apr 2006
    Location
    Fort Bragg, North Carolina
    Posts
    153
    Plugin Contributions
    0

    Default Re: Need SideBox to show in One Catagory Only

    Could this be done also for a specific product instead of the entire category?

    Thanks

  6. #6
    Join Date
    Apr 2006
    Location
    Fort Bragg, North Carolina
    Posts
    153
    Plugin Contributions
    0

    Default Re: Need SideBox to show in One Catagory Only

    Never mind, I think I got it.

    Code:
    if ($_GET['products_id'] == 12 or $_GET['products_id'] == 47) {
    //do it
    } else {
    //skip it
    }

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Need SideBox to show in One Catagory Only

    Yep, it certainly could. Depending on what page you want this on, test for the product id, seen in the url:
    ...com/index.php?main_page=product_info&cPath=21_57&products_id=149

    $_GET['products_id'] will give you the current product id to test against.


    OK, looking good!

  8. #8
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Need SideBox to show in One Catagory Only

    Hi Guys,

    I have an identical dilema to the OP but having read your thread cannot get it to work at all. I am a complete amateur with PHP, building my first website in my spare time.

    My dilema is that I want a sidebox only to appear in certain categories. Now, here is the original PHP:

    PHP Code:
      $show_lingerie_sizes_sidebox true;
      
      if (
    $show_lingerie_sizes_sidebox == true) {
          require(
    $template->get_template_dir('tpl_lingerie_sizes_sidebox.php',DIR_WS_TEMPLATE$current_page_base,'sideboxes'). '/tpl_lingerie_sizes_sidebox.php');
          
    $title =  BOX_HEADING_LINGERIE_SIZES_SIDEBOX;
          
    $title_link false;
          require(
    $template->get_template_dir($column_box_defaultDIR_WS_TEMPLATE$current_page_base,'common') . '/' $column_box_default);
     } 
    I've read this thread and tried to implement your advice but what I've come up with just doesn't work at all:

    PHP Code:
      $show_lingerie_sizes_sidebox true;


      if (
    $_GET['cPath'] == or $_GET['cPath'] == or $_GET['cPath'] == 33 or $_GET['cPath'] == 34 or $_GET['cPath'] == 35) {
          require(
    $template->get_template_dir('tpl_lingerie_sizes_sidebox.php',DIR_WS_TEMPLATE$current_page_base,'sideboxes'). '/tpl_lingerie_sizes_sidebox.php');
          
    $title =  BOX_HEADING_LINGERIE_SIZES_SIDEBOX;
          
    $title_link false;
          require(
    $template->get_template_dir($column_box_defaultDIR_WS_TEMPLATE$current_page_base,'common') . '/' $column_box_default);
          } else {
      
    $show_lingerie_sizes_sidebox == false;
     } 
    With the original PHP the sidebox appears on all pages. When I upload my modified PHP then the sidebox simply doesn't appear at all. Please, could you tell me where I'm going wrong? I know it's something silly and it would be such a fantastic help.

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Need SideBox to show in One Catagory Only

    You have to watch $cPath ...

    Your categories_id 8 is really using:
    /index.php?main_page=index&cPath=1_8

    Go to your categories_id 8 where you think you want to see this ... and edit the URL in your browser from =1_8 to =8 ... does it work now?

    You could also use:
    $current_category_id

    on the test as it does evaluate to 8 ...
    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: v1.5.5]
    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!

  10. #10
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Need SideBox to show in One Catagory Only

    Ajeh, you are genius, you are! When I change the URL from 1_8 to just 8 then it does indeed work....

    However, I created the categories from ADMIN and they created their own dynamic URL.... how do I stop the URL from going 1_8 instead of 8 ?? Or is there a way to tell the PHP if ($_GET['cPath'] == 1_8 ?????

    OR... could you tell me how to use $current_category_id in correcting this problem?

    Thanks for your help, I know your time is valuable.
    Last edited by limelites; 20 Feb 2009 at 09:53 PM.

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. v139h Need to only show in one category
    By 4jDesigns in forum General Questions
    Replies: 1
    Last Post: 30 May 2012, 12:40 PM
  2. v150 Specials listing and sidebox will only show ONE product
    By DivaVocals in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 2 Apr 2012, 02:10 AM
  3. I need to have a particular sidebox only show on one EZ page.
    By tolefairy in forum Basic Configuration
    Replies: 7
    Last Post: 21 Jan 2008, 08:22 AM
  4. I need to have a particular sidebox only show on one EZ page.
    By tolefairy in forum General Questions
    Replies: 0
    Last Post: 20 Jan 2008, 07:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR