Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2010
    Posts
    100
    Plugin Contributions
    0

    Default How to get cPath from a product id?

    Hello,

    Is there a function that returns the cPath value given the product ID? -- I know the cPath is simply like A_B_C, where A, B, C are its (parent) category IDs. But instead writing a code to get the IDs from db, just wonder whether such function is already there.

    Thanks.

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

    Default Re: How to get cPath from a product id?

    I don't think there is a single function that does that, but you can use
    zen_get_products_category_id($products_id) for the product's master category,
    with
    zen_get_path($current_category_id = '')

    like this:

    PHP Code:
    zen_get_path(zen_get_products_category_id($products_id)) 

    Oops, nevermind, here it is:
    PHP Code:
    zen_get_product_path($products_id

 

 

Similar Threads

  1. v151 Linked product - how to change the relative/parent cPath ?
    By twitchtoo in forum General Questions
    Replies: 0
    Last Post: 9 Feb 2014, 05:18 PM
  2. v151 Add To Cart From Product Details index&cPath Issue
    By jbible in forum General Questions
    Replies: 7
    Last Post: 14 Jan 2013, 04:10 PM
  3. function to get cPath by passing the products_id?
    By rajoo.sharma in forum General Questions
    Replies: 2
    Last Post: 14 Aug 2009, 07:09 AM
  4. How to get rid of "...... More Info" from product Listing?
    By hcd888 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 21 May 2009, 12:45 AM
  5. Get current cpath
    By foteek in forum General Questions
    Replies: 2
    Last Post: 31 Aug 2008, 03:59 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