magento checkout: change shipping price - php

Scenario:
Change shipping price using variable parsed by design during checkout.
I need to change the final shipping price using some variables sent by phtml checkout.
Eg.
Shipping method 1: cost 33$
Shipping method 2: cost 23$
Shipping method 3: cost 10$
special packaging checkbox (y/n) + 10$ (set it as yes for this example)
assicuration:
I've inserted manually this checkbox, just in design but I need to increment final price and add a simple label that include this on shipment
total should be
shipment total 20$

In order to do this, you will need to write your own Shipping Module. There is a wiki article here with instructions, otherwise there are many good blog posts on the process. I would recommend that you use one of the existing Magento shipping modules (e.g. Mage_Shipping_Model_Carrier_Flatrate) as an example and then just extend the collectRates method to test for the value of your variable.

Related

magento coupon code for free shipping

I need to generate coupon code which allow customer "Free Shipping". I have generated one with following options:
Promotions -> Shopping Cart Price Rules
All Customer Groups
Specific Coupon
Coupon Code
no condition
Free Shipping - For matching items only
I am getting all shipping methods with price $0 where I want Free Shipping option included with all shipping method with their actual price. There is setting in System -> Configuration, free shipping is available for price > 100, but I want to give free shipping option to some customers using coupon. I am getting following options:
Any suggestions?
This is the way Magento rules generally work.
To implement this change, you need to either write your own extension or get a ready-to-use solution.
E.g. our Magento shipping extension is capable of doing that: http://www.mageworx.com/shipping-suite-magento-extension.html

Creating Custom Shipping Method In Magento, Weight vs Destination and Zones?

am just switching from my e-commerce shopping basket website to a Magento implementation.
Currently we have different Shipping Zones for different countries, and the weight of the final shopping basket determines the Shipping Price for the selected country. We therefore just have one shipping method, i.e. "Standard Shipping".
What I would like to do is use the Country Code to carry out a lookup and locate the Postal Zone and use that Postal Zone to lookup/calculate the Shipping Price of the basket based on it's weight.
Have seen a few examples of Flat Rates, but not too sure if they are applicable?
I don't have the finances to buy an extension as yet.
Thank you for any help or advice,
Barton.
This extension does exactly what you need and its free.
Matrixrate
All you have to do is export the CSV file and map all your shipping methods accordingly to the location, weight and price. It also allows you to create custom free deliveries over an amount.

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

Adding discounts to shipping in magento

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

how to change/update shipping price after shipping method choose

I am trying to create a custom (pickship) shipping method for magento 1.7.x.x following the instructions in this this blog after creating the shipping module. I would like to be able to change shipping cost based on the user's choice of shipping option.
Preparation:
1.) Created a form block for custom (pickship) shipping method
2.) Create a store name (can be any text) dropdown/select element with three values: store1, store2, store3.
3.) The default shipping price is set via the shipping configuration at $1.00 (just for testing purposes).
Current Status:
1.) After the required process, when I reach the selection of shipping method in the single-page checkout, I see a select element with three options and the shipping price set to the default price.
Target:
I would like the shipping cost to be updated to $10.00 if the user selects the first option, $20.00 if the user selects the second option.
My attempt:
After a few hours of googling, I made some changes in the observer model:
NameSpace_ModuleName_Model_Observer extends Varien_Object {
public function saveShippingMethod($observer) {
$request = $evt->getRequest();
$quote = $evt->getQuote();
$pickship = $request->getParam('shipping_pickship', false);
$rates = $quote->getShippingAddress()->getShippingRatesCollection();
$rate = $rates->getFirstItem();
if($pickship['select_element'] == 1) {
$rate->setPrice(10);
} elseif($pickship['select_element'] == 2) {
$rate->setPrice(20);
}
//Mage::log($rate->getPrice());
}
Question:
Am I using the right observer/method for this task? It only works for one step – once I click 'Continue' to place the order, it resets to the default price. My way of setting the delivery price may be wrong. Can you put me on the right track or suggest a solution?
If you want to code your tailored solution, you can find a nice tutorial here: Custom shipping method in Magento
Basically you should not use observers, instead you should define in your module a custom carrier with two shipping methods.
In your model, use function getAllowedMethods() to declare your shipping methods, then in function collectRates() give the rate for each shipping method.
If your main goal is to provide multiple shipping methods with different pricing, and can trust a third party module, you might try the free MatrixRate from WebShopApps
http://www.magentocommerce.com/magento-connect/webshopapps-matrixrate-1-multiple-table-rates-extension.html
There are other modules for this, but this is which I tried, and it works as I expected.

Categories