"PROMOCODE1" coupon code is not valid - php

Hi all I will go straight to the point. I found out that when i create a shopping cart price rule in magento and added a promotion/coupon code as indicated above with all rules set correctly to have a discount works from the frontend as expected from customers checkout experience/process.
But when i try to create an order from the backend/admin and trying to apply the promocode1 coupon code to the order for a specific customer it shows it to be invalid. as indicated above.
My Version i am using currently is ver. 1.9.3.6
I hope someone can point me to the right direction or what i may be doing wrong or not doing.
snap shots below
Thanks.

This looks like a bug in magento as after several checks i realized that you have to select 'all store view' option during the creation of the price rule.
Even though you select the specific store view for the price rule, the coupon will not be applied to the order from the backend of magento without you selecting the 'all store view'.

I know this thread is old but I am also getting the same error messages and i resolve my issue by removing the fields reset_shipping: true from sales.js file in js/mage/adminhtml from function applyCoupon. In myside whenever i am applying coupon code then my shipping price is going to reset so coupon code could not apply if shipping price is 0 ( my coupon code is to offer free shipping)

Related

Why are prestashop Cart Rules (Vouchers) not showing in frontend?

I successfully generated a test cart rule and assigned to my user.
I can see it both in backoffice and on the my-account page under 'my vouchers'. So we're sure it's recorderd and assigned.
What happens is that in shopping-cart page, even after loggin in with my user, I can't see any voucher field.
Digging deeper, I can say that the $discounts template var is not populated, or, simply it counts zero. So I took a look to the controller, and saw it assign it via $order->getCartRules(). And getCartRules simply reads a db table. And surprise?? The order_cart_rule table is empty. So it doesn't get populated. So what could be the problem here? Ever had same issue someone? It's a strange thing..
Probably the main question is: where/when exaclty do the cart and the rules get created/applied? I can see in FrontController the cart being created, but at that point it seems the cart rules are not setted yet.
By the way, I'm running on latest prestashop 1.6.1.4
$order->getCartRules
The function $order->getCartRules() gives you the list of cart rules applied to this order (you can find it in a table ps_order_cart_rule).
Where are all cart rules?
All cart rules are in the table ps_cart_rule.
If you have marked a cart rule as Highlight - you can see this:
If you have added any cart rule to your shop - you can see this:
If you can't see Vouchers field - either you don't have any cart rules or your theme installed isn't supporting it.
is a late answer but i noticed that if you enable paypal it has in paypal.js a line that remove not only the voucher area but also the trashcan to delete a product:
see pic: https://i.gyazo.com/403a9004aaa745a2817f11884d52346b.png
/* 1.5 One page checkout*/
var qty = $('.qty-field.cart_quantity_input').val();
$('.qty-field.cart_quantity_input').after(qty);
$('.qty-field.cart_quantity_input, .cart_total_bar, .cart_quantity_delete, #cart_voucher *').remove();
by renaming the cart_voucher to cart_voucher_2 (if you not use express checkout) and cart_quantity_delete to cart_quantity_delete_2 you will return to have your things right :)

Custom Shipping Rate

I'm trying to customize my onepage checkout in magento. The process is to place orders to the company. Apparently I have set a custom table rate in magento where in I have 2 choices. First choice is Victoria (Australia), where in depending on item size there is a fixed rate for that, while the rest of Australia has the same rate.
Apparently when I use my onepage checkout, I encounter 2 errors:
1st error is that when I am in guest mode, when I fill up the billing information, after I go to the shipping method, it says that my shipping method is unavailable, even if I had already inputted the correct address.
My second error is that when I am using a customer account, everything works fine for the 1st time, then if I try to place another order, it shows the error.
I'm thinking of two ways right now to solve it:
Since I need to fix the problem right away, could I remove the shipping method altogether and just create my own computation at the review tab and save the shipping fee in the end?
Or I try to fix the problem on how the shipping method works?
I found matrix-rate free plugin for magento online. A great alternative instead of manipulating it in the backend. I tried it and it immediately worked, though you need to check if you have the data you need in your database. Use the same steps as you were in modifying table rates, as there will be a new tab for the matrix-rate plugin in the configuration->shipping methods tab.

Magento require coupon to purchase product

After searching on Google for quite a while I am going crazy.
My question: Can you configure Magento to require a coupon code to buy specific product?
This is for a promotion my employer is running, basically we want to allow specific customers to buy specific product in our Magento store before any of our other customers. Thank you for your suggestions.
A brief idea I can give here.
Create a backend module, which has own db tables to save linking of products ID to specific coupon, multiple coupon or just a check that coupon is required, depending on your case. From this Module you should be able to define such linking of product to coupon.
Since customer apply a coupon code at cart page, so we will let customer add product into cart. Then edit isDisabled method of Mage_Checkout_Block_Onepage_Link class. where you will check if your quote has any product from the product-coupon linking defined in your module and coupon is not applied yet. Similar thing you can should do for Multishipping method if it is enabled in your Magento. So whenever coupon coupon code will be applied page will refresh and button will get enabled.
Same check you will need to put in indexAction of Mage_Checkout_OnepageController.

Magento quote_item and tax

I need to add custom attributes to selected products in store. To do so I'm using Model_Price_Observer. I'm using Magento 1.7.
So far I'm able to add custom attribute but calculated price is wrong - tax is missing.
My code is (part):
$quote_item->getProduct()->setIsSuperMode(true);
$quote_item->setOriginalCustomPrice( $customprice );
$quote_item->setCustomPrice( $customprice );
$quote_item->setTaxAmount($taxAmount);
$quote_item->setBaseTaxAmount($taxAmount);
Any ideas what am I doing wrong?
Am I using right trigger?
Tax cannot be added to an item as we do not yet know the customer's location in the world, and therefore cannot reasonably calculate a tax rate. I assume Magento is not saving your new tax information because of this fact. It also seems dangerous to me to add tax manually as it is always calculated on the fly via (sometimes) complex logic.
In the cart, try getting a "quick estimate" by entering in your country and postal code and see if tax is applied to the quote, and maybe try again.

Magento Free shipping and Coupon discount

I have a free shipping price rule which is configured like this:
All customer groups
No coupon
uses per customer: 0
Conditions: Cart total >= 100, Shipping country == NL or BE or DE
Free shipment: for shipment with matching items.
When I enter a coupon with a fixed discount amount however, the free shipment disappears.
Both price rules have Stop Further Rule Processing set to NO
This behaviour of Magento is driving me insane
Apparently Magento does not care about other shopping cart price rules if there is a valid coupon code entered in the Front-end.
Fix for this issue is in the comments of the following website:
http://magentoexpert.com/issue-with-cart-price-rules-coupon-code-discard-promotion-without-coupon-code/
As suggested in one of the comments it's best that you try and convert the current rule into a "Shopping Cart Price Rule".
In a Shopping Cart Price rule you can also set conditions that depend on the subtotal of the cart, the shipping region, shipping country, ...
In the action tab you can easily Free shipping option to "For shipment with matching items"
This should solve it ;)
Go through all your other rules which might be triggered as well (make sure they have "further rule processing" on "no").
Set the priority to "1"
Try again if the rule is applied and let us know.
If we are talking for Magento CE 1.9 and above, the code is corrected as long as the database is concerned but you might encounter the same problem! If so, then there is another cause.
One also usual bug is * user not being able to update the cart quantities* or users not able to login. This has to do with formKey and the answer that was given here.
Apparently, the same solution fixes the problem of vanished shipment or payment method after applying a coupon, that we are discussing here.
Hope this helps users of newer versions...
so be it - manemoi

Categories