Magento Shipping Method problems - magento

My problem is that i made ZIP Code optional, but now, if i write any number in the box, shipping methods are dissapearing .
i can write everything in the One Page Checkout, but when i get to zip code (which is optional now), and i write something, shipping methods dissaper and i try to finish order, i get
Your order cannot be completed at this time as there is no shipping
methods available for it. Please make necessary changes in your
shipping address.
If anyone knows how to solve this, thank you

Related

How to alert Magento Site Admin about abandoned cart?

How could we alert a magento site admin about each abandoned cart immediately after it is abandoned?
Is it a default feature in Magento EE?
No it is not a default feature in Magento EE.
You ask how a site admin could be alerted of an event that is somewhat of a grey area.
Assuming that an abandon cart is defined by the following criteria (which in fact is not the definition but may be applicable to you)
A registered user (ignore guest users for sake of sanity here) has products in cart.
This user does not complete the checkout and leaves the store-front
A period of time goes by (eg 1 day) with no adjustments on the cart items
Assuming this situation is your abandoned cart scenario i could suggest the following :
1.) I would use the Magento Quote Object (this is the object that is converted to an order after a successful checkout.)
looking at the quote object there already seems like there are enough fields to be able to monitor when the quote was created, when it was updated, when it was converted and whether it was converted or not. If the object does not contain the data fields you need there is no reason why you could not extend it. See a sample snapshot :
My (naive) suggestion would be to set up a scheduled job, to run at the same frequency at which you define your "abandoned cart" scenairio (or any frequency for that matter).
The job could do something like the following :
1.) Instantiate a collection of quotes.
2.) Filter out quote's that have been converted
3.) Filter out quote's that have been created recently (less than the critria above)
4.) Filter out quote's that have been modified within the same time-frame criteria
at this point you should have a list of all quote's that have been created, perhaps been updated but not converted for the last 24hours (depending on your criteria of course).
If you get to this point, well then the rest is straight forward.
Extract the information you need from the quotes (id's names, numbers, emails etc), compile your report and email to the administrator.
it the best idea i can think of for now! i have not done this in practice...
Ofcourse you can set-up funnels and goals with Google Analytic to give you extensive information on your customers, including abandoned carts, but that doesn't answer your question.

Magento get chosen shipping and billing method address fields

How can I get the choosen shipping and billing fields during checkout? (I want to show them in sidebars)
I use this in shipping.phtml but ofcourse that's just for the current 'address' (and I want to use it in methods.phtml and other pages)
$this->getAddress()->getFirstname()
So I assumed that this would work out...
Mage::getSingleton('checkout/session')->getShippingAddress()->getFirstname()
But it didn't, anybody has a tip?
Addition:
This one was helping me a lot, but I'm stuck :-S
How do I get the shipping method the user has chosen during checkout?
Shipping and billing addresses are children of quote object. So something like this shall work:
Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getFirstname();

Shipping Methods are not working in magento 1.7

I activated flat shipping in the shipping options and whenever you do checkout it says “Sorry, no quotes are available for this order at this time.”Any one please help me since i am a beginner in magento.
EDIT
I have tried other shipping methods too its also showing the same. we have upgraded Magento ver. 1.4.1.1 to magento 1.7. Any help would be greatly appreciated..
EDIT 2
After upgrading community folder contains only Phoenix folder. After that i added Biebersdorffolder by seeing an error in checkout page. I don't the the purpose of folders AW and RocketWeb. Since i am not familiar with magento.
If the image is not visible i have added the image in this url
http://i47.tinypic.com/14smix1.jpg
do you have any Checkout files modified on your project? Or maybe custom checkout.
I will list the code locations you need to check to make sure your Shipping works correctly.
So to begin with: Magento has very special work process with Shipping rates - it's called "collectRates" and is some modification of pattern "composite".
To make sure that everything works correctly on the code basis you need to first check the Onepage.php model (app/code/core/Mage/Checkout/Model/Type/Onepage.php): lines 330, 341, 556, 616; There should be code
{address}->setCollectShippingRates(true)
where {address} is current address variable.
This code is significant for future "collectRates" processes, because just when the Onepage Checkout page is initializing the "collectRates" process has already been processed, and the flag "collect_shipping_rates" is set to "false". If it's not set back to true, the next "collectRates" process will not be performed.
After you check the location above, and it still doesn't work - you might want to add some logging to Mage_Checkout_Block_Onepage_Shipping_Method_Available::getShippingRates method. If method is properly executed and return some rates from $this->getAddress()->getGroupedAllShippingRates() call, there might be some issues with .phtml template on your locan theme (default path to .phtml is app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml).
Here's how you can log the outcome from $this->getAddress()->getGroupedAllShippingRates() call (Mage_Checkout_Block_Onepage_Shipping_Method_Available::getShippingRates method):
$groups = $this->getAddress()->getGroupedAllShippingRates();
$printGroupes = array();
foreach ($groups as $code => $groupItems) {
foreach ($groupItems as $item) {
$printGroupes[$code][] = $item->getData();
}
}
Mage::log($printGroupes, null,'special.log');
Please note, that the result array with all rates will be logged into "special.log" under var/logs folder.
I wish I could be more of help, but the issue requires some digging into code, the debugger will be even more helpful than logging, if you can get hold of one.
Cheers!
Price should be entered for Flat Rate shipping to work
The problem might be of the country selection
Ship to applicable countries is set to "Specific Country" and you selected "Canada".
So you will see this shipping method only if you select Canada on the frontend during the checkout.
Or
You can make this to All Countries and check whether its working or not.

Magento. How to change shipping method before save order?

I must change shipping method before saving order if (condition) is true, and don't change it if false. I tried out function checkout_type_onepage_save_order($observer).
$checkout = Mage::getSingleton('checkout/type_onepage');
$checkout->saveShippingMethod('freeshipping_freeshipping');
but it doesn't work.
Sorry for my English.
Thanks.
I have had problems with things not saving properly in checkout, e.g. shipping address. I think you have to save the quote object again, but I cannot remember for sure.
However, why don't you write your own shipping module? This is the place for doing it properly and within your own module you can put together all the rules you need to set the price to what it needs to be, plus the frontend label, e.g. 'Free!' if a zero price is calculated.
Here is a tutorial that has worked very well for me in the past:
http://www.excellencemagentoblog.com/magento-create-custom-shipping-method

Virtuemart Coupon Plugin based on quantity not value

I've had a look at available Virtuemart plugins and I can't find anything close to what I am after. This is what I need.
Allow admin user to create coupon codes. An import feature would be nice as there will be thousands but I can handle this bit if needed anyway.
The admin user selects the number of products the customer is allowed for each coupon code.
When the customer uses the coupon code they are allowed to choose any product on the website up to the total amount of products issued to the coupon. Regardless of the products price.
Nice extra would be to allow free shipping with the coupon.
I've looked at the possibility of extending virtuemart and I think it would be possible. It would however require quite a lot of changes and if I can find something that is halfway there it would help me on my way.
Thanks in advance.
OK well time was running out and I didn't get an answer so I rolled my own. It was actually fairly painless. I can't release the code but I can give you a good idea of the steps and a direction to go in.
extend vm_ps_coupon and override the update, add and process methods. Add and update should only require a change to the array that is sent to the DB. See here for more info on extending classes
Alter the enum in the database to allow for quantity as well as total and percent.
Within your new update method handle the variation of quantity to do as you need.
In the update method you can also set a flag for free shipping in a session variable.
In templates/checkout edit list_shipping_methods.php. Simply check for the free shipping flag and load the free_shipping class. You can then call free_shipping->list_rates($vars);
extend vm_ps_checkout, override the add method, call the parent add method and then check the result so you can delete the session variable for the free shipping.
Finally you will need to make some changes in the HTML. Unfortunatly i could not find a way to override this easily and since its only two small changes to the markup i just went ahead and hacked the core. If anyone knows of another way that would be great? I did see something online about using a Joomla hook and a System plugin but I'd rather keep it reliant on Virtuemart only.
In administrator/components/com_virtuemart/html/ edit coupon.coupon_form.php to show the new quantity radio button.
Then edit coupon.coupon_list.php to display the correct values. Currently it will only display percent and total.
Hope this helps someone in the future. If you need some assistance then post on here and I'll be happy to help.

Resources