Beispiel #1
0
 /**
  * Add "hidden" discount and shipping tax
  *
  * Go ahead, try to understand ]:->
  *
  * Tax settings for getting "discount tax":
  * - Catalog Prices = Including Tax
  * - Apply Customer Tax = After Discount
  * - Apply Discount on Prices = Including Tax
  *
  * Test case for getting "hidden shipping tax":
  * - Make sure shipping is taxable (set shipping tax class)
  * - Catalog Prices = Including Tax
  * - Shipping Prices = Including Tax
  * - Apply Customer Tax = After Discount
  * - Create a shopping cart price rule with % discount applied to the Shipping Amount
  * - run shopping cart and estimate shipping
  * - go to PayPal
  *
  * @param \Magento\Payment\Model\Cart\SalesModel\SalesModelInterface $salesEntity
  * @return void
  */
 protected function _applyHiddenTaxWorkaround(\Magento\Payment\Model\Cart\SalesModel\SalesModelInterface $salesEntity)
 {
     $dataContainer = $salesEntity->getTaxContainer();
     $this->addTax((double) $dataContainer->getBaseHiddenTaxAmount());
     $this->addTax((double) $dataContainer->getBaseShippingHiddenTaxAmnt());
 }