Owebia grand total showing wrong after placed order - magento2

I use bellow code for shipping price will add 50% extra of grand total which is tax, subtotal, and discount, but It not working on Magento 2.3. It showing invalid grand total and shipping after place order but before that, it showing right on the frontend.
addMethod('test', [
'title' => "3 Days",
'enabled' => $request->dest_region_id!= '52',
'price' => ($quote->grand_total)*.50,
]);
On magento 1x I have faced same issue but it fixed by using:
cart.price+tax+discount
But on Magento 2.3 I can't find the tax and discount.

Related

Magento 2 cart price rule and tax issue

Specs: Magento 2.1.7
I got an issue and could not find anything similar to my case on the google.
I have a tax price rule that makes free shipping when subtotal is above 500 euros.
Rule is working fine, free shipping is being applied without problems.
Problem comes with products that have FPT (Fixed product tax) applied.
When free shipping is applied, tax amount from the totals turns into a nice round zero. Tax amount reduced to the zero.
Apparently this isn't happening with products that are using tax classes.
Shipping becomes free and taxes looks fine.
I'm out of the ideas, going to dive into the code, but I'm not sure if I will find the problem.
Thanks for any help.
Apparently FPT doesn't sum up with totals, they have a different total item.
After knowing that I have wrote an observer which adds FPT amount to the tax total and everything looks fine now.
**Event** sales_quote_address_collect_totals_after
/**
* Adds Fixed Product Tax(FPT) to the total Taxes
*/
public function execute(Observer $observer)
{
/** #var Magento\Quote\Model\Quote\Address\Total */
$total = $observer->getData('total');
/* Adds FPT to the tax totals even if it is equal to zero */
$total->addTotalAmount('tax', $total->getWeeeAmount());
return $this;
}

PayPal SetExpressCheckout flat-rate shipping methods incorrect tax

I am including multiple shipping methods in DoExpressCheckoutPayment so the customer can choose the shipping method inside PayPal. Including these inside the call works:
L_SHIPPINGOPTIONISDEFAULT0 => true
L_SHIPPINGOPTIONNAME0 => 'Shipping option 1'
L_SHIPPINGOPTIONAMOUNT0 => 5.00
L_SHIPPINGOPTIONISDEFAULT1 => false
L_SHIPPINGOPTIONNAME1 => 'Shipping option 2'
L_SHIPPINGOPTIONAMOUNT1 => 10.00
The problem is the tax within PayPal is not readjusted accordingly when the shipping method is changed, it always uses the tax from PAYMENTREQUEST_0_TAXAMT. I have tried things such as L_TAXAMT0/L_TAXAMT1 like how the tax override works in the instant update API and PAYMENTREQUEST_0_TAXAMT/PAYMENTREQUEST_1_TAXAMT but nothing works. Which extra fields do I need to include with the shipping methods for the correct tax?
I think the problem comes that the parameter L_PAYMENTREQUEST_n_TAXAMTm is not setted. From paypal site:
(Optional) Item sales tax. You can specify up to 10 payments, where n is a digit between 0 and 9, inclusive, and m specifies the list item within the payment; except for digital goods, which only supports single payments. These parameters must be ordered sequentially beginning with 0 (for example L_PAYMENTREQUEST_n_TAXAMT0, L_PAYMENTREQUEST_n_TAXAMT1).
Character length and limitations: Value is typically a positive number which cannot exceed 10,000.00 USD or the per transaction limit for the currency. It includes no currency symbol. Most currencies require two decimal places; the decimal separator must be a period (.), and the optional thousands separator must be a comma (,). Some currencies do not allow decimals. See the currency codes page for details.
Try to set it also in the SetExpressCheckout method

Can you please help me to display the correct grand total in crystal reports

my grand total in crystal reports is coming up in thousands instead of hundred eg i've got a column of amount for products etc the amounts are:
10.00
42.00
55.00
45.00
75.00
it adds up to 227.00 but in the report the grand total is showing 22,700.00....please help!!!
The most likely culprit for an unexpected grand total is incorrect grouping. If you don't have totals on each group, add them, and see if those are off. Once you fix the grouping, and making sure you're totalling on the correct field, then your grand totals should also be correct.

Magento percentage off basket total

Is it possible to have a shopping cart rule that gives the user 25% off the whole total of the basket without using a coupon? It needs to be the total price and not 25% off each product.
Our site is running Magento 1.7.0.2.
Yes, using Promotions > Shopping Cart Price rules you just set it to take 25% off the basket total, and set it to 'No Coupon'.
Shopping cart price rules are rules that effect the total of the cart, not the products individually. Catalog price rules are for individual product discounts.

Paypal IPN using PHP to get customized Quantity and Amount

I have downloaded the sample paypal IPN script using php and customised with the email for the buyout option and it has also some hidden paramaters such as amount, quantity,return_url, notify_url like this. My main idea is to do the buyout option for the product purchase in my website.The current calculation for the product purchase is as follows:
Item Price:$20
Quantity :10
Total amount $200
I need the calculation to some different way as our site have some static set of quantities and prices, so our point of calculation is as follows:
Item Price:$20
Quantity :10
Total amount:$20
So, the total amount needs to be the same for the given number of quantities.The IPN configuration doesn't allow me to change the quantity field by this way, please suggest some ideas to overcome this issue.
The item price is price per item, the quantity is of course multiplied by the item price. Your second example should have $2 as the --Item-- price. If you want to sell "10 items for $20", I think you will need to make a new item for that combo and just but the actual quantity in a custom field.
If you want to use the same item and paypal's quantity field, I think you need to look into calculating a discount and making that part of the parameters (discount_amount_cart or discount_amount_X for item X I think).