Objective: Give a discount to my clients when they buy 2 , 3 or + 4 products. I have successfully modified the cart to show a discount line and a modified total cart price.
The issue is that when the client pressed Checkout or Paypal the total price shown is the original one , not the modified for me in cart.liquid.
I have been looking around for a solution but found nothing clear enough. As far as I could read Ajax is required.
Could anyone help me? I am new to Ajax so please do not leave anything out in the explanation.
Thanks
You should have read up on using Shopify first. You cannot modify prices as you wish. There is no API possibility to do so. If you want to offer discounts you will have to follow the same patterns as every other Shopify merchant that has come before you. Typically, you can monitor the contents of a cart, and if you believe it to be enough to merit a discount, you can expose a discount code for the customer. It is not foolproof to monkey business, but it does work for most.
Related
I have isolated the reason why zip pay orders are cancelling on our system with the help of their support.
This is the response from the integrations team.
We have taken a look at the issue and it seems the issue occurs on your end and only when an order has 2 decimal places or more.
The reason the error is occurring is that there seems to be rounding on your end before we create the charge.
The reason this only affects Zip orders is that Zip checks to see if the order details match what is being passed to Zip and if it doesn't throw an error to ensure the customer is charged the correct amount.
Below you can see the product page which rounds to the nearest first decimal:
(product shows price as $2180)
And below you can see the cart page which doesn't round:
(shows price as 2179.98)
Zip takes the cart page information then compares this to the charge payload before creating the charge.
You can see below that the charge payload is rounded after the checkout which is causing the error:
(picture of code with charge as 2180)
You can also compare this to the checkout response below which has a different value:
(picutre of code with charge as 2179.98)
We aren't sure if there are any business rules applied on your end which is causing the behavior, however, the Zip plugin is functioning as intended.
I would recommend speaking to your developer as this doesn't seem to be the standard Magento rounding and it is causing the issue when charging the customer.
I am using OnePage checkout and can only think that this is the place causing issues.
Any suggestions on how to stop this from happening (ie stop it rounding after checkout on the charge payload)?!
I am happy to try anything.
Cheers
The answer to this was not simple. For some reason in our store the onepagecheckout was rounding to 4 places and the store was rounding to 2 places.
It was a matter of forcing all prices to round to one value. I ended up using an extension to achieve this and it worked. I know us zip, after, and paypal all in one happy environment.
I am using a CART PRICE RULE for creating a coupon code that will when applied than all shipping amount turn to zero.
Problem is it is worked for all shipping method except UPS.
Please if someone guide what is i am making mistake for UPS configuration.
Thanks
Confirm you have the UPS shipping method marked to use with Free Shipping.
Go to Stores>Configuration>Sales>Shipping Methods>UPS update the "Free Method" field. Then save, reindex if needed, and flush cache.
I am observing the strange situation of orders with subtotal and grand total of 0, but with products in it. The products row have prices and no promo rules or discounts are being used. This happens sporadically and not only with one site. The version of Magento is 1.7.0.2. There are also no additional extensions installed. system.log and exception.log do not contain traces of errors that may have something to do with this problem.
At first i thought it may be because of server overload. I think this may have something to do with it but the last "0"-subtotal order happened when the server was not loaded at all.
Any ideas? Thanks!
I 've had the same problem with you guys and it was really annoying because I could not reproduce it and could not find a proper solution.
I started to believe that it was just another Magento bug caused by some bad timing in database operations.
Anthony's post really helped me and guide me to find a practical fix.
So here it is.
Indeed the error is caused by the trigger recollect flag that is set in markQuotesRecollect (for instance when a product is saved) and causes
all active quotes to recollect their totals.
I had to spent a lot of hours in debugging IWD OnepageCheckout code to understand that in Geo.php saveBilling function creates a new shipping address by cloning
the billing address (in case shipping is same as billing) and passes (almost) all data from billing address to the shipping address which later on is saved (through the parent quote save).
This way cached_items_* data are set and when Geo.php saves payment even if you intentionally set quote to recollect totals (i.e by setting collected flag to false) shipping totals
are not calculated correctly.
Eventually I had to add this lines of code in saveBilling method after line that writes:
$ship->addData($bill->getData());)
$ship->setSameAsBilling(1)->setShippingMethod($ship_method)->setCollectShippingRates(true);
$ship->unsetData('cached_items_nominal');
$ship->unsetData('cached_items_nonnominal');
$ship->unsetData('cached_items_all');
So far (after 10 days and around 1000 orders) had no random zero total orders.
Hope this helps you all
Kind Regards
Lefteris
I have had the same problem. And I have done some researches here.
I used IWD onepagecheckout module. And the issue was inside this module.
Lets consider situation. You are doing smth in adminpanel or cron is doing some tasks this products or you could apply some catalog rules. In any kind of these actions will be called event catalog_product_status_update or catalog_product_save_after.
So every time you're changing smth in products all current quotes will be updates by events.
ok, here you'll ask me - what does it mean?
It means that each quote changes the field trigger_recollect in sales_flat_quote table.
You can find it here
app/code/core/Mage/Sales/Model/Resource/Quote.php::[markQuotesRecollectOnCatalogRules and markQuotesRecollect methods] to get more in details.
The trigger_recollect field is a trigger/signal to recollect whole quote total sums. You can find this step here
app/code/Mage/Sales/Model/Quote.php::_afterLoad.
protected function _afterLoad()
{
// collect totals and save me, if required
if (1 == $this->getData('trigger_recollect')) {
$this->collectTotals()->save();
}
return parent::_afterLoad();
}
And accurate at this moment all current quote total sums became 0. The follow step is to get address collection and for some reason we have not product items it the address object now. Magento cannot recollect correct here. But it occur only when you or system are doing smth with a products and at the same time customer is pressing the button "send order". Why - I do not know yet. By the issue was occurred and catched.
Just check in the Configuration->Advanced->advanced->Disabled Module Outputs
Mage_Tax option is enabled or not.
Zero Subtotal Checkout
Using this
System > Configuration > Payment Methods > Zero Subtotal Checkout
More info to go hear
I am trying to make our payment methods give an extra 5% off when checking out. We have 3 methods to choose from but only 2 want to give the discount.
Yes - Bank Transfer
Yes - Phone Payment
No - Purchase Order
For some reason the discount is only showing on Bank Transfer and not Phone payment if I select this option in checkout.
Could someone please look at my settings and tell me what I am doing wrong?
Link: Conditions
Link: Actions
Thanks! :)
make sure is activated and date range is correct, sometimes it happens ;)
I am desperately hoping someone is able to assist with this error that seems to be occurring with our magento (version 1.6.2.0) checkout and applying a discount code. It isn't the easiest to explain so I have attached an image:
http://i.imgur.com/iX1Qh.png
Thank you very much for your time.
Regards
Problem here is that paypal considers discounts on item total excluding VAT and in magento discount is counted overall. As Magento is not passing VAT amount to paypal, paypal calculates it.
If you want solution how to rectify then do let me know.