[Typo3-shop] zk_products category <---> page

Franz Holzinger franz at fholzinger.com
Thu Dec 9 15:35:08 CET 2004


Hello tt_products users,

when I bring in zk_products the following problem will come up:

zk_products does not use the categories of the shop. It uses the pages 
to distinguish between categories instead.

---------
var $uid_list="";  // List of existing uid's from the basket, set by 
initBasket()
...
		$uidArr=array();
		if (is_array($basket["tt_products"]))	{
			reset($basket["tt_products"]);
		while(list($uid,$count)=each($basket["tt_products"])) {
				if (t3lib_div::testInt($uid))	{
			$count=t3lib_div::intInRange($count,0,100000);
					if ($count)	{
					$this->basket[$uid]=$count;
						$uidArr[]=$uid;
					}
				}
			}
		}
		$this->uid_list=implode($uidArr,",");
----------
This is never used by zk_products.

So how should I solve this problem?


Franz

Here the code snippet, where $this->uid_list is not used by zk_products:

-------------------
	 	$query = "SELECT * FROM tt_products WHERE uid IN 
(".implode(",",$uidArr).") AND pid IN 
(".$this->pid_list.")".$this->cObj->enableFields("tt_products");

			// Get the products from the uid_list (initialized by the initBasket 
function)
	 	$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_products', 
'uid IN ('.$this->uid_list.') AND pid IN 
('.$this->pid_list.')'.$this->cObj->enableFields('tt_products'));
		$productsArray = array();
		while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))		{
			reset($this->basketExt[$row["uid"]]);
			while(list($bextVars,)=each($this->basketExt[$row["uid"]])) {
				$groesseFarbe = explode(";", $bextVars);
				$row["size"] = $groesseFarbe[0];
				$row["color"] = $groesseFarbe[1];
				$row["extVars"] = $bextVars;
				$productsArray[$row["pid"]][]=$row;
						// Fills this array with the product records. Reason: Sorting them 
by category (based on the page, they reside on)
			}
		}
--------------------------------------------------------





More information about the TYPO3-project-tt-products mailing list