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.
Related
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)
when i started on magento i use to list items including VAT as i am not VAT register. but now i have automated my price and data from a data supply company. and they send prices exclude VAT so i needed a rule to add 20% VAT on top of them.
i have created a rule as told here: http://www.magentocommerce.com/knowledge-base/entry/setting-up-value-added-tax-vat
and gave it Name "Standard VAT" but the problem is my magento is using attribute for tax "Taxable" and not using "VAT Standard"
can you tell me how to make magento use this rule by default? and show the prices include VAT on front end, every where.
there is a solution to select all the item in catalog and edit attribute and select "Standard VAT" but that is not fault proof. we edit new items every day and wont find a out which product is showing VAT and which isnt.
another thing i have done is: changed the setting in "taxable" attribute. but it is still not showing VAT on front end. i have tried to give priority to "standard VAT2 but no use.
you help will be much appreciated. please tell every thing in little details.
Once you have setup your Product Tax Rules which will have all the countries and rates you want to apply assigned to your Standard VAT Product VAT class, you will then to change each product to use this tax class. Go into the product, select prices, and change the VAT class to Standard VAT. Providing your rules are all setup correctly and you have set in the system configuration that your product prices are now setup as excluding tax, then it will automatically apply your tax rules to the products on the frontend.
I am unaware of a Default System Configuration Option for product tax_class_id. Ultimately it is simply an EAV attribute like any other custom product attribute. My deployment always defaults to the first product tax class after None when setting up a new product. What you could do is go into the database manually and set the default value of the tax_class_id attribute to be the ID of the product tax class you want to default to. Something like the following would probably do it;
UPDATE `eav_attribute` SET `default_value` = '2' WHERE `eav_attribute`.`attribute_code`='tax_class_id';
I have a Magento site which uses the webshopapps matrixrates plugin for shipping rates.
The shipping cost doesn't seem to be calculating correctly and appears to apply a discount to the product cost.
In the screenshot below, the basket contains one product that has a price of €30, the shipping option 'European Airmail' (€5.50) has been selected.
Therefore the total cost should be €35.50
However the cost comes out at €30.55.
It's almost as if the Delivery cost is subtracted from the total (ignoring euro cents)
Interestingly there are two instances of this site, the UK instance appears to work correctly but I can't find anything different in the config.
I've tried comparing a CSV export of shipping rates but can't see anything obviously different.
What do I need to do to get the cost to come out as the correct amount (€35.50)?
Any suggestions welcome!
EDIT
If I dump out the quote object, the price for the product shows up as 25
But if I just load the product and dump it's data, I get the actual price which is €30:
I've got the tax amount with:
<?php
$taxAmount = $quote->getShippingAddress()->getData('tax_amount');
?>
And that comes back as 0.000
So I'm at a bit of a loss as to what is going on here.
Got to the bottom of this, it was a catalogue price rule for free shipping upto 4.95..
I had removed all shopping cart price rules already but wasnt aware that anyone had created a catalogue price rule so didnt consider it. Thanks for the suggestions guys.
A project I’m working on allows customers to buy products that have the ability to be VAT exempt (through disability/chronic sickness). I have added an additional step to the checkout process so the customer can easily fill in the VAT exempt form. Once that form has been filled in I need to remove tax from their quote/order.
I have done a fair bit of digging into how I could potentially do this. Below is the code I got so far, however it works but the moment I go through to our payment provider the tax has been reset. Even when I use Check / Money Order payment option.
file: app/code/local/Vat/Exempt/controllers/OnepageController.php (method: saveExemptAction())
$quote = $this->getOnepage()->getQuote();
$quote->setCustomerTaxClassId(6); // Tried forcing a custom tax class id
$quote->setCustomerGroupId(4); //also tried forcing a different customer group...
foreach($quote->getAllItems() as $item){
// Attempt to zero the tax on each item
$item->setTaxAmount(0);
$item->setBaseTaxAmount(0);
//re-calculate & save each item.
$item->calcTaxAmount();
$item->save();
}
$quote->collectTotals()->save();
Any advice would be much appreciated!
The easiest way would be to change the customer's group to a group that doesn't pay VAT (you can define that in Sales > Tax > Manage Tax Rules).
After they fill up the form you change their group ($customer->setGroup(self::GROUP_EXEMPT_VAT)->save();) and from this moment they won't pay tax.
Let me know if that would work for your issue and if you need more help.
I was wondering if anyone here has ever added an automatic discount to a shipping method in magento before. FedEx is the only company I ship with, but I have 3 different methods of FedEx. I want to add a discount to 2 of the 3 methods, and display these discounts at the method selection screen automatically at checkout(to make it seem like they are getting a deal with the higher priority shipping I suppose?). I found which file displays the methods, but I don't think this is the file I need:
template/checkout/onepage/shipping_method.phtml
Does anyone know which file these are displayed in so that I can slash out the real price, and add the discounted price bellow it? I suppose I could change the shipping price by just subtracting from the variable price, correct?
I suggest this thread for adding custom discount price but its not related to any of shipping method price calculation, its might helpful, as its helped me well..
http://www.excellencemagentoblog.com/magento-add-fee-discount-order-total