CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Bug #32158

[Documentation] No Documentation about 'priceLimitForBasket ' feature

Added by Christoph Sölder over 1 year ago. Updated over 1 year ago.

Status:New Start date:2011-11-29
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:Bug Spent time: -
Target version:-
Votes: 0

Description

I accidentally stumbled over the following feature in the code for the Basket view.

You can actually set a maximum Limit for the Basket, so that Orders above a certain total cash amount are not possible.

You just have to enter the following (or something similar :)) in your typoscript setup.

plugin.tx_commerce_pi2 {

  //Set Maximum Limit for Basket Total 
  //Integer representation of total SUM
  priceLimitForBasket = 10000000

  // Error Message that replaces Marker ###BASKET_PRICELIMIT###
  priceLimitForBasketMessage = TEXT
  priceLimitForBasketMessage {
      value = Orders above XXX are not allowed!
      stdWrap = <div class="notification">|</div>
  }
}

Search for "priceLimitForBasket" or "###BASKET_PRICELIMIT###" in class.tx_commerce_pi2.php to see where it is used in the code.

It almost seems that actually nobody has an idea that this feature even exists since I could not find anything about it when I googled it....

It is the perfect solution to the integer overflow that happens in the basket tax and sum calculation when dealing with amounts like 100.000.000 €.

History

Updated by Christoph Sölder over 1 year ago

In case of an empty Basket there is also no handling for the Marker ###BASKET_PRICELIMIT###

So you have to add a hook for

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/pi2/class.tx_commerce_pi2.php']['main'][] = t3lib_extMgm::extPath($_EXTKEY).'yourHookClassFile:yourHookClass';

In you Hook-class add the following:

function additionalMarker($markerArray, $cObj) {
        if($cObj->priceLimitForBasket == 1 && $cObj->conf['priceLimitForBasketMessage']) {
            $markerArray['###BASKET_PRICELIMIT###'] = $cObj->cObj->cObjGetSingle($cObj->conf['priceLimitForBasketMessage'], $cObj->conf['priceLimitForBasketMessage.']);
        } else {
            $markerArray['###BASKET_PRICELIMIT###'] = '';
        }

        return $markerArray;
    }

Also available in: Atom PDF