[TYPO3-commerce] Which function creates products?

Erik Sokoll erik at t3media.de
Wed Nov 2 11:57:23 CET 2011


Hi Ingo,
sorry to say but I think you are probably wrong.
If I grep for "process_datamap" inside my commerce (0.12.2) folder I 
find four files which are:

   ./mod_orders/index.php
   ======================
This one writes into the orders table.

   ./lib/class.tx_commerce_belib.php
   =================================
Here I find it four times and $tce->process_datamap(); can be found in:
function copyLocale()
function overwriteLocale()
function overwriteProduct()
function overwriteArticle()

   ./hooks/class.tx_commerce_tcehooksHandler.php
   =============================================
Just comments.

   ./hooks/class.tx_commerce_pi4hooksHandler.php
   =============================================
Just comments.


So I find everything... a lot of things... except creation of products.

:(


Greetings...
Erik



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



More information about the TYPO3-project-commerce mailing list