Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2010
    Posts
    143
    Plugin Contributions
    0

    Default how to get the value of current category with PHP code?

    try to optimize a add-on. but I am a newbie of PHP.

    how to get the value of current category with PHP code?

    such as

    top Category----subCate1----subCate2---subCate3: Product A


    When the page of Product A displayed, how to get the value of current category with PHP code?

    also how to get the value of all parent categores all the way to top category?

    Thank you so much

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: how to get the value of current category with PHP code?

    What is it that you are actually trying to do?

    I get that you want to grab the category path for the product being displayed BUT what/why are you needing this and to do what?
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jul 2010
    Posts
    143
    Plugin Contributions
    0

    Default Re: how to get the value of current category with PHP code?

    Quote Originally Posted by kobra View Post
    What is it that you are actually trying to do?

    I get that you want to grab the category path for the product being displayed BUT what/why are you needing this and to do what?
    Thank you so much!!

    Yes, that's what I want(grab the category path ).

    I am making a add-on, so I need the PHP code of grabing the category path.

    Please help. Thank you !

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: how to get the value of current category with PHP code?

    I am making a add-on
    Please expand
    Where will you be when this addon is to get that info
    What will the addon be expected to do with it
    etc
    Zen-Venom Get Bitten

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

    Default Re: how to get the value of current category with PHP code?

    $_GET['cPath'] holds the current category path; how you break it down to use depends on what you want to do with it, as kobra said. And of course it doesn't exist if you are not in a product/category page, so you may need to take that possibility into account in your code.

  6. #6
    Join Date
    Jul 2010
    Posts
    143
    Plugin Contributions
    0

    Default Re: how to get the value of current category with PHP code?

    Thank you so much, gjh42!

 

 

Similar Threads

  1. v150 what is the php code to return the url of the current page?
    By WebKat in forum General Questions
    Replies: 7
    Last Post: 8 Mar 2012, 11:24 PM
  2. Calling the current product page url with php
    By pricediscrimination in forum Templates, Stylesheets, Page Layout
    Replies: 24
    Last Post: 16 Dec 2011, 03:52 PM
  3. Replies: 0
    Last Post: 5 May 2009, 03:10 PM
  4. how to get the value of order total ?
    By greenlight in forum General Questions
    Replies: 3
    Last Post: 8 Feb 2009, 03:20 AM
  5. how to get the current order no?
    By wdrwc in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 14 Jul 2006, 02:46 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