[TYPO3-commerce] Get parent category in typoscript and how to link a content page to a category

christian christian at typo3journal.info
Thu Aug 21 15:37:43 CEST 2008


Hello,
This is my first message on this list.
I'm new to Commerce and I'm really excited with this extension :)
I've got a few questions :

- How to get the catUid of the current category (GPvar:tx_commerce_pi1|
catUid)

The reason is I'm trying to build a HMENU but I would like to get the
parent category for subcategories that are displayed in my pages.

My current TS is the following but I can't get it work :

lib.test = COA
lib.test {

// Getting parent category  
10 = CONTENT
10 {
table = tx_commerce_categories
select.pidInList = 84
select.andWhere = uid={GPvar:tx_commerce_pi1|catUid}
select.andWhere.insertData = 1

# Getting the parent category - working
renderObj = COA
renderObj {
      10 = TEXT
      10.field = parent_category
      }

}

// Building the menu 
20 = CONTENT
20 {
    table = tx_commerce_categories
    select {
       pidInList = {$siteconf.catalogueProduits}
       // Can't get it work - no value passed
       andWhere.data = parent_category < .10
       andWhere.insertData = 1
       orderBy = sorting
    }
    renderObj = COA
    renderObj {
      10 = TEXT
      10.field = title
      10.typolink.parameter = {$boutique.produits}
      10.typolink.additionalParams.dataWrap =
&tx_commerce_pi1[catUid]={field:uid}
      10.typolink.useCacheHash = 1
      10.wrap = <li>|</li>
    }
     wrap=<ul>|</ul>
  }
// End lib.test 
}

- Second question ... I can attach a page to products but not to
categories. Do I have to extend the extension ?

Thanks for your help :)

Christian
---------





More information about the TYPO3-project-commerce mailing list