Paypal Express übernimmt keine Versandkosten

hier ne simple plugin was wir benutzen um die shopware paypal plugin zu fixen… 

class FooBarPaypalAddPremiumShipping extends Plugin
{
    public static function getSubscribedEvents()
    {
        return [
            "Shopware_Controllers_Frontend_PaymentPaypal::getBasketParameter::after"
            => "afterGetBasketParameter"
        ];
    }

    public function afterGetBasketParameter(\Enlight_Hook_HookArgs $args)
    {
        $return = $args->getReturn();

        if ($return['PAYMENTREQUEST_0_SHIPPINGAMT'] == 0) {
            $shippingcosts = Shopware()->Modules()->Admin()->sGetPremiumShippingcosts();
            if ($shippingcosts) {
                $return['PAYMENTREQUEST_0_SHIPPINGAMT'] = $shippingcosts["surcharge"];
                $return['PAYMENTREQUEST_0_AMT'] += $return['PAYMENTREQUEST_0_SHIPPINGAMT'];
            }
        }

        $args->setReturn($return);
    }
}

 

 

2 „Gefällt mir“