[TYPO3-commerce] Which function creates products?

Erik Sokoll erik at t3media.de
Tue Nov 1 11:32:41 CET 2011


Hi Ingo,
thank you! This helps a lot.

So it's done the "TYPO3 Way" about process_datamap() and I thought I was 
reading a comment somewhere in the code that this is not a suitable way 
for commerce.
Perhaps it's an old comment or I simply misunderstand something.

My real problem is, that I created categories, products and articles by 
own functions with (as far as I can see) the identical data like 
commerce does.
But in FrontEnd I run into problems at the navigation, which sometimes 
expand other folders than the one you have selected... e.g. you click on 
the last category navigation point and one before expands.

We followed the line until *function processArrayPostRender()* in 
*lib/class.tx_commerce_navigation.php* but here I stick at the moment.

So anything seems to be different between my written data and the one 
which comes from commerce.

I will write more, as soon as I find the solution.
Or maybe I ask more questions here. ;)


Thanx...
Erik

P.S. Shortly for you to know:
Commerce: 0.12.2
TYPO3: 4.3



Am 31.10.2011 20:59, schrieb Ingo Schmitt:
> 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
>>
>>
>
> _______________________________________________
> TYPO3-project-commerce mailing list
> TYPO3-project-commerce at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-commerce



-- 

Erik Sokoll
Am Wengert 23
97271 Kleinrinderfeld

M 0175 444 666 2
E erik at t3media.de
I http://t3media.de





More information about the TYPO3-project-commerce mailing list