Create an article using code?

View: New views
1 Messages — Rating Filter:   Alert me  

Create an article using code?

by Fritjof Bohm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

is there a (good) possibility to add a new article using a php script I  
hooked into the basket generation?
(I added a textarea to the basket where the shop user can leave a message.  
It would be great if that message could be converted to an article and  
added to the basket on refresh, so it will appear on the invoice a.s.o)

At the moment I use the  
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/pi2/class.tx_commerce_pi2.php']['postartAddUid'][]  
hook and call

        $creator = t3lib_div::makeInstance('tx_commerce_articleCreator');
        $creator->init(0,0);
        $PA = array();
        $PA['title'] = "Hello World";
        $key = "";
        $creator->createArticle($PA, $key);

. This creates an article, but it is "empty" (just the title, no  
description, no categories,...).

Any ideas how I can add further data, and how I can put the new article  
into a category?

Regards,
Fritjof
_______________________________________________
TYPO3-project-commerce mailing list
TYPO3-project-commerce@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-commerce