Hook: calculateScaledPrice

Im Zuge der Ermittlung eines Staffelpreises

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * -- Registration: --
 * $GLOBALS['MERCONIS_HOOKS']['calculateScaledPrice'][] = array('myMerconisHookClass', 'myCalculateScaledPrice');
 *
 * -- Invocation: --
 * When calculating the scaled price for a product.
 *
 * -- Parameters: --
 *  1. $objProductOrVariant - the product or variant object
 *
 * -- Return value: --
 * $calculatedScaledPrice - the calculated scale price
 *
 * -- Objective: --
 * e.g. implement a custom scale price calculation logic
 *
 */
 
public function myCalculateScaledPrice($objProductOrVariant) {
    $calculatedScaledPrice = 12345;
     
    /*
     * Custom code to calculate the scaled price.
     * The following product or variant properties should be considered:
     *
     * $objProductOrVariant->_scalePrice
     * $objProductOrVariant->_scalePriceQuantity
     * $objProductOrVariant->_scalePriceType
     *
     */
     
    return $calculatedScaledPrice;
}