Adding discounts to shipping in magento - php

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

Related

How can I add a checkbox on a product page in WooCommerce that adds a fixed fee when checked?

Here is the trouble I'm having. I'm creating a custom kitchen cabinet doors and drawers website with Woocommerce. There are a lot of variations going into the project that alters the price (Wood type, thickness etc.) per square foot. The customer also has to provide credentials (L x W) to calculate the total cost of the product. We found that using the Measurement Price Calculator plugin works the best as it also calculated the weight of the product which can be used for shipping.
However, we want to add an option (preferably checkbox) that adds a fixed fee to the product if checked. Using WooCommerce itself and having "Boring" as a variable attribute doesn't work because adding a charge here will only add to the price per square foot and will not be fixed regardless of the dimensions.
I'm not a master at PHP and have only found ways to add a surcharge in the checkout but I need the fee to be conditional to the checkbox being checked and be replicated based on quantity. If there are any functions or hooks that you think could help me please let me know.
What you are looking for is a part of WooCommerce that was separated and turned into a paid plugin called WooCommerce Product Add-Ons.
Koda

Magento shipping charge based on specific zip code and weight range

I need to calculate the shipping charge based on following to criteria.
I have fixed specific pin codes available for shipment.
The weight of the product.
Condition: If the weight of the product is within 500gms then free shipping otherwise on every 500gms additional price of Rs 50 will be added as shipping charge.
Kindly guide me as to how to achieve this in magento 1.9
Please use the Google drive link for the solution of this question and first disable all other shipping methods except this shipping then it will work properly.
Download the customised code according to the requirement.
https://drive.google.com/file/d/0B5RZxA4F3j3KWmo2WUFJWXE0ejQ/view

applying VAT Rule in magento

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';

Incorrect shipping calculation in Magento

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.

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