[TYPO3-commerce] own input field for articles
Stephan Petzl
spetzl at gmx.at
Fri May 29 14:33:42 CEST 2009
Lars Quitsch schrieb:
> Hi,
> I'm looking for an idea to extend an article with one or more input
> fields. We want to sell personalized stuff and need e.g. an field for
> the name printed on the product.
>
> Is there anyone out there who can give me a hint how to do it?
>
> Thanks in advance,
> Lars
Took me quite a while to figure out which hooks to use and where to get
data from (such as the articleId) but now i managed it.
i added 1 note field to the single view and displayed the note in the
basket:
you need at least 4 hooks in your ext_localconf.php:
//DB loading and storing
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_basket.php']['load_data_from_database'][]
= "EXT:commerce_notes/class.tx_commercenotes.php:&tx_commercenotes";
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_basket.php']['store_data_to_database'][]=
"EXT:commerce_notes/class.tx_commercenotes.php:&tx_commercenotes";
//Basket View
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/pi2/class.tx_commerce_pi2.php']['makeArticleView'][]
=
"EXT:commerce_notes/class.tx_commercenotes_basket.php:&tx_commercenotes_basket";
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_pibase.php']['singleview'][]
= "EXT:commerce_notes/class.tx_commercenotes.php:&tx_commercenotes";
//$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_pibase.php']['articleview'][]
= "EXT:commerce_notes/class.tx_commercenotes.php:&tx_commercenotes";
//filling markers in the usermail and adminmail template
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_pibase.php']['makeLineView'][]
= "EXT:commerce_notes/class.tx_commercenotes.php:&tx_commercenotes";
you have to look in the respecting source files to figure out which
methods are called in your hook classes and what parameters are given.
--
Best Regards
Stephan Petzl
http://netrabbit.at
More information about the TYPO3-project-commerce
mailing list