[TYPO3-commerce] Download of PDF in singleview
Morten Olesen
mo at idefa.dk
Wed Sep 30 08:56:51 CEST 2009
Hi Rainer,
You are on the right track - the hooks should be initialized in
localconf.php of your extension - rather than include it your self you
can left commerce do it. This way the class will only be loaded when
it's needed
example localconf.php - assuming your extension dir is named raslupobello :
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
$lupohook='EXT:raslupobello/hookclass.php:user_lupohook';
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_pibase.php']['singleview'][]=$lupohook;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_product.php']['postinit'][]=$lupohook;
?>
After this change ( and indeed any change to localconf.php ) you will
need to clear the cache to allow typo3 to rebuild it's combined config file.
if this still doesn't work for you then the problem lies else where.
/Morten
rainer schleevoigt wrote:
> Hi,
>
> in my template file I have inserted ###PDF###.
>
> I created a extension width the new field 'tx_raslupobello_pdf' in
> tx_commerce_products. The client can upload pdf.
>
> Now comes my problem in FE:
>
> In this extension I created a file with the content:
>
> =================
> class user_lupohook {
> function postInit(&$model) {
>
> $model->add_fields_to_fieldlist(array('tx_raslupobello_pdf'));
> }
>
> function additionalMarker($markerArray,$singleViewPlugin) {
> $markerArray['###PDF###'] =
> $singleViewPlugin->product->getField('tx_raslupobello_pdf');
> return $markerArray;
> }
> }
> =================
>
> Inserting of
>
> require_once(t3lib_extMgm::extPath($_EXTKEY).'hookclass.php');
> $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_pibase.php']['singleview'][]
> = 'user_lupohook';
> $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_product.php']['postinit'][]
> = 'user_lupohook';
>
> in localconf.php doesnt work.
>
> It works after clearing of cache one time, if I place the code in
> ext_tables.php. After reloading of FE-page the marker doesnt replace.
>
> Any ideas?
>
>
> Rainer
More information about the TYPO3-project-commerce
mailing list