[TYPO3-commerce] Which function creates products?

Ingo Schmitt is at marketing-factory.de
Mon Oct 31 20:59:06 CET 2011


Hi Erik,

> Could somebody help and tell me which function is used to create products (and categories) and where to find it?
> 

both are just records. If we create them automatically we normally use plain TYPO3 TCEMAIN.

Example for a category:

			$tce = t3lib_div::makeInstance('t3lib_TCEmain');
			$tce->stripslashes_values = 0;

				// zuordnen der Daten welche für das anlegen der Kategorie wichtig sind
			$timestamp = time();
			$data['tx_commerce_categories']['NEW' . $timestamp] = array ( 
				'pid'						=> tx_commerce_belib::getProductFolderUid(),	// Produkt Ordner ID
				'title'						=> $categoryData['tx_mfcsap2commerce_name'],	// Name der Kategorie
				
				'sys_language_uid'			=> $categoryData['sys_language_uid'],			// Sprach ID
				'l18n_parent'				=> $categoryData['l18n_parent'],					// Sprach ID
				
			);

			if ($categoryData['l18n_parent'] == 0 && $categoryData['sys_language_uid'] == 0) {
					// UID der Elternkategorie - TYPO3
				$data['tx_commerce_categories']['NEW' . $timestamp]['parent_category'] = $parentCategory;
			} else {
				$tce->dontProcessTransformations = 1;
			}

				//start
			$GLOBALS['BE_USER']->uc['txcommerce_copyProcess'] = true;
			
			$tce->start($data, array());
			$tce->exclude_array = array();
			$tce->admin = 1;
			
			$tce->process_datamap();
			$uid = $tce->substNEWwithIDs['NEW' . $timestamp];


> Are there all articles created by the functions from class.tx_commerce_articlecreator.php ?
> 
> 
> Greetings...
> Erik
> 
> 
> _______________________________________________
> TYPO3-project-commerce mailing list
> TYPO3-project-commerce at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-commerce
> 
> 



More information about the TYPO3-project-commerce mailing list