WooCommerce - Paypal Amount Error after shipping costs discount - wordpress

Good morning.
Thanks to the code provided here WooCommerce - get shipping country for non registered user I managed to add the correct discount to my checkout.
A brief resume: I had to discount the full shipping cost in case the order comes from specific country. But I cannot use the standard free shipping procedure, because I have to know the amount of the shipping costs to use it somewere after the checkout. That's why I added the some code to apply a negative fee to the woocommerce_cart_calculate_fees hook.
When I try to pay via PayPal I receive this error "https://www.paypal.com/webapps/shoppingcart/error?flowlogging_id=IDd&code=AMOUNT_ERROR&mfid=MFID"
I believe that PayPal does not evaluate the new total amount.
I tried to echo the $cart->total value inside woocommerce_after_calculate_totals hook, and it's OK.
So Paypal is looking at another value...
What can I do?
This is what I get (sorry for the partial translation)
Thanks!

PayPal evaluates what you send it -- so, review a log of what your browser is actually sending in the request. Use the Dev Tools 'Network' tab.
And try the latest PayPal for WooCommerce plugin, which has an option to enable Smart Buttons that use an API instead of redirecting with the amount, among other things: https://woocommerce.com/products/woocommerce-gateway-paypal-checkout/

Related

WoCommerce is not adding delivery charges during final payment

i am using WoCommerce. this is my final checkout page
but when i process for payments. i am getting seeing $27 not $37..
Any idea, if i am missing something
Thanks
Can you check if your product requires shipping or not? If you open the product in the backend and check that it requires shipping.
In backend check your product ...in the particular product check your shipping is enabled or not... if you enable the shipping...it will be work..

How do I get order information from the woocommerce payment screen?

Hi i want to woocommerce checkout page get woocommerce-checkout-review-order-table.
How do I get all the information for that order? The important thing is to be sensitive to situations such as VAT, cargo. I just need information.
You can get all the details of the products you've added into cart on checkout page. Please check if you've added tax(VAT) and shipping (CARGO) class to each product from your WP admin.
Here you can refer WC tax rate docs and you can see here to assign products a tax classes.
Similarly, you supposed to create and assign shipping zones and it's rates as well. You can find docs for creating shipping zone from here
You can find many tutorials to set shipping for your desire requirements however, here is the one for quick reference. WooCommerce Shipping Methods
Hope this may help you in your requirements!
Be noted you can't get order information before you placed order successfully. I answer you based on understanding that your need information of tax, shipping cost on checkout page.

WooCommerce - Apply coupon of discounts of a given payment method

I'm integrating a solution with WooCommerce where a coupon of discount is given depending on the payment method that customer chooses. So, to do it, the coupon needs to be created/applyed in checkout page, when customer is selecting the payment method he wants.
Is it possible? How should I do this?
There are 2 free plugins that allow you to set discount codes based on payment methods:
https://wordpress.org/plugins/woocommerce-auto-added-coupons/ - With over 5K+ active installs, this one seems to be the right choice.
https://wordpress.org/plugins/woocommerce-payment-discounts/ - Although this one has 3K+ active installs, it is specifically meant to give discounts based on payment methods. So this does exactly what you are looking for.
Try out both plugins, preferrably 2nd one first.

WooCommerce add delivery date as hidden product in checkout (Third party payment gateway)

Im developing an e-commerce site with wordpress and woocommerce 2.1. Im using a third party payment gateway (Klarna Checkout) which doesn't offer the customer to specify a delivery date/time. I need to make this feature available but the problem is that the gateway only sends the order-meta from their form, which doesn't offer a date field, when the order is completed. In other words, the standard checkout fields in woocommerce won't be passed to the final order.
My idea of solution is to add a hidden free product called Time, with variations for different time spans, on the checkout page and automatically add this product(with selected variation) to the cart when a customer selects a variation. The specified time would then show as a ordered product when viewing the order in wordpress. How could i do this?
If anyone has a better idea of how to solve this problem feel free to contribute :)
Thanks!
Try this free plugin that adds a delivery date on the checkout page: http://wordpress.org/plugins/order-delivery-date-for-woocommerce/

WooCommerce - Shipping plugin ignored

I've written a plugin that adds a custom shipping method to WooCoomerce.
It seems to be intermittently NOT returning shipping prices.
On the cart page, the shipping estimator works fine; then, when you click through to checkout, it will INITIALLY display all the results (from cheapest to fastest) but on refresh, with correct GUEST billing address, it returns nothing; debugging shows that it does not even call the plugins' shipping calculator or 'enabled' function check. It just says that there are no shipping options for Australia (if this is the only shipping option activated)
Have tried contacting the Woo guys, but nada.
EDIT:
Lessons learned.
Firstly, the big one: WooCommerce uses transients - it caches your shipping results. You can reset these in WooCoomerce settings, system status->tools Extra edit: Lastest WooCommerce version lets you turn this off! .. But only if you are shopping as administrator ..
Secondly: Once the above was out of the way, it simply turned out that I was reading in the posted address details incorrectly, and my plugin was returning 'false' and knocking itself out of the running. Big thanks to xDebug and PHP Storm ..
Thirdly: As an aside, I have also hooked the plugin's instantiation to the woocommerce_shipping_init, as Woo NOW recommends. Check out their revised docs at the shipping method API page
You should at least show us your code :-)
I bet there is something related to shipping address that is removing the shipping options.
If the initial page loads fine, but when address info is updated it doesn't respond correctly it may be a javascript issue. I'm working on a custom shipping plugin right now myself, and when any shipping details are changed it fires an event that updates the shipping results through AJAX. Posting a link to the checkout page, or looking for javascript errors on the front end might be very helpful.

Resources