Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatic price calculation doesn't affect #138

Closed
calien666 opened this issue Oct 11, 2016 · 1 comment
Closed

automatic price calculation doesn't affect #138

calien666 opened this issue Oct 11, 2016 · 1 comment

Comments

@calien666
Copy link
Contributor

the calculation of the prices in articles (from net, from gross, non existing) doesn't have any effect at all. After debugging, I found out, that the hook is registered wrong. Formerly the TcehooksHandlerHooks was registered this way:
$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = 'EXT:commerce/hooks/class.tx_commerce_tcehooksHandler.php:tx_commerce_tcehooksHandler'; $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = 'EXT:commerce/hooks/class.tx_commerce_tcehooksHandler.php:tx_commerce_tcehooksHandler';
now it is registered this way:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass']['commerce'] = 'EXT:commerce/Classes/Hook/TcehooksHandlerHooks.php:CommerceTeam\\Commerce\\Hook\\TcehooksHandlerHooks';

For me it worked, to change the registration like the following:

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['commercehooks'] = 'EXT:commerce/Classes/Hook/TcehooksHandlerHooks.php:CommerceTeam\\Commerce\\Hook\\TcehooksHandlerHooks';
and
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['commercehooks'] = 'EXT:commerce/Classes/Hook/TcehooksHandlerHooks.php:CommerceTeam\\Commerce\\Hook\\TcehooksHandlerHooks';

In affect to this, the value is now multiplied by 100 two times, so in Classes/Hooks/TcehooksHandlerHooks.php the line 56 is changed as followed:

from:
$incomingFieldArray[$key] = (int) strval($value * 100)

to

$incomingFieldArray[$key] = (int) strval($value)

alternatively the lines 51 to 59 are commented out.

@garbast
Copy link
Contributor

garbast commented Oct 11, 2016

Feel free to send a pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants