[TYPO3-commerce] delivery costs based on total costs

Jeroen Visser jeroen at roquin.nl
Mon Oct 8 16:19:48 CEST 2007


Hi,

I have tried the different options as described in the doc/hooks.html
For the basket page I need pi2/class.tx_commerce_pi2.php
Can you see any wrong writings in the code below? Or maybe I have 
forgotten something! Thanks for the debug tip.

Kind regards,
Jeroen

Franz Koch wrote:
> Hi,
> 
>> These are the the steps I have followed:
>>
>> 1) Build an extension
>>     1a) key: com_deliverycosts
>>     1b) "Just include library"
>> 2) Edit the extension files
>>     2a) Wrote a function getBasketSum($object, &$invokingObj) in 
>> class.tx_comdeliverycosts_pi1.php
>>         Just to see if I get inside this function I have placed aa
>>             simple mail() function inside it.
>>     3a) Setup "ext_localconf.php"
>>     3b)
>>
>> if (!defined ('TYPO3_MODE'))    die ('Access denied.');
>>
>> t3lib_extMgm::addPItoST43($_EXTKEY,'pi1/class.tx_comdeliverycosts_pi1.php','_pi1','',1); 
>>
>>
>> if (t3lib_extMgm::isLoaded('commerce')) {
>>     
>> $_GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['commerce/pi2/class.tx_commerce_pi2.php']['postAddArticle'][]='EXT:com_deliverycosts/pi1/class.tx_comdeliverycosts_pi1.php:tx_comdeliverycosts_class->getBasketSum'; 
>>
>>
>> }
>>     3c) Clear cache in typo3conf
>>
>> Now when I change the amount of articles in the basket I should get a 
>> e-mail that I am inside the function. Unfortunately I don't get it. 
>> According to the mentioned steps above, is there something I forget, 
>> mis configured? Hope that I have described my problem understandable.
> 
> sorry, the hook is called 'postartAddUid'. The hook 'postAddArticle' is 
> one of my own changes which is not yet in SVN as much as I know.
> 
> as for the debugging with emails. I think this is a bit slowing down - 
> you could do something like this:
> ---
> if($GLOBALS['TSFE']->fe_user->user['uid'] == *uid of your fe_user*) {
>     t3lib_div::debug('hook is called - jippie');
> }
> ---
> 
> At least I do it like this to hide any debug-output from regular users.
> 
> -- 
> Kind regards,
> Franz Koch
> 




More information about the TYPO3-project-commerce mailing list