sCheckForDiscount example

// If shop is in net mode, we have to consider             // the tax separately             if (($this->config->get('sARTICLESOUTPUTNETTO') && !$this->sSYSTEM->sUSERGROUPDATA['tax'])
                || (!$this->sSYSTEM->sUSERGROUPDATA['tax'] && $this->sSYSTEM->sUSERGROUPDATA['id'])
            ) {
                if (empty($getProducts[$key]['modus'])) {
                    $getProducts[$key]['amountWithTax'] = Shopware()->Container()->get('shopware.cart.net_rounding')
                        ->round($netprice$tax$quantity);

                    // If basket comprised any discount, calculate brutto-value for the discount                     if ($this->contextService->getShopContext()->getCurrentCustomerGroup()->getPercentageDiscount() && $this->sCheckForDiscount()) {
                        $discount += ($getProducts[$key]['amountWithTax'] / 100 * $this->sSYSTEM->sUSERGROUPDATA['basketdiscount']);
                    }
                } elseif ($getProducts[$key]['modus'] == CartPositionsMode::CUSTOMER_GROUP_DISCOUNT) {
                    $getProducts[$key]['amountWithTax'] = round(1 * (round($price, 2) / 100 * (100 + $tax)), 2);
                    // Basket discount                 } elseif ($getProducts[$key]['modus'] == CartPositionsMode::VOUCHER) {
                    $getProducts[$key]['amountWithTax'] = round(1 * (round($price, 2) / 100 * (100 + $tax)), 2);

                    if ($this->sSYSTEM->sUSERGROUPDATA['basketdiscount'] && $this->sCheckForDiscount()) {
                        $discount += ($getProducts[$key]['amountWithTax'] / 100 * $this->sSYSTEM->sUSERGROUPDATA['basketdiscount']);
                    }
                }
Home | Imprint | This part of the site doesn't use cookies.