I have a two methods for shipping. Standard FedEx options and if the customer orders over $100 they get free FedEx 2nd Day Shipping. I have setup the Free Shipping under a table based rate with the necessary filters. Two questions.
1) Is it possible to set the table based rate to be the default when it is displayed (ie it only shows up when someone orders over $100 in product)?
2) Can I change the display order of shipping methods somehow? I can't figure out how to get the Table Rate above the FedEx module output.
Page 1 of 1
Setting Default Shipping Method and Shipping Method Sort Order
#2
Posted 12 October 2010 - 03:03 PM
Hi!
Not sure if I understood you correctly, but you can auto-select the table rate shipping method with the following code. Place it to the Post Action Code of your Checkout page:
You will need to assign some API code to the table rate shipping method. In the example I used the "default" API code.
No, at the moment there is no way to do it. But I added this request to our task list.
Thank you
Quote
1) Is it possible to set the table based rate to be the default when it is displayed (ie it only shows up when someone orders over $100 in product)?
Not sure if I understood you correctly, but you can auto-select the table rate shipping method with the following code. Place it to the Post Action Code of your Checkout page:
if (Shop_cart::total_price() > 100)
{
Shop_CheckoutData::set_shipping_method(Shop_ShippingOption::find_by_api_code('default')->id);
} else
Shop_CheckoutData::reset_shiping_method();You will need to assign some API code to the table rate shipping method. In the example I used the "default" API code.
Quote
2) Can I change the display order of shipping methods somehow? I can't figure out how to get the Table Rate above the FedEx module output.
No, at the moment there is no way to do it. But I added this request to our task list.
Thank you
#3
Posted 13 October 2010 - 06:25 AM
I have multiple free shipping table based rules that kick in at different dollar amounts, so using the code you suggest would have to be expanded with a bunch of else statements. However, with that said, only one at a time would ever show, could I just change the display code to include the selected="selected" instead?
#4
Posted 13 October 2010 - 02:17 PM
Hi!
Try this code then :-) It selects first available shipping option.
Thank you
Try this code then :-) It selects first available shipping option.
$available_options = Shop_CheckoutData::list_available_shipping_options($this->customer);
if ($available_options)
{
$indexes = array_keys($available_options);
Shop_CheckoutData::set_shipping_method($available_options[$indexes[0]]->id);
}
else
Shop_CheckoutData::reset_shiping_method();Thank you
Share this topic:
Page 1 of 1

Help














