LemonStand Forum: Setting Default Shipping Method and Shipping Method Sort Order - LemonStand Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Setting Default Shipping Method and Shipping Method Sort Order

#1 User is offline   SoccerGuy3 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 118
  • Joined: 18-March 10
  • LocationNorthern California

Posted 11 October 2010 - 07:44 PM

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.
0

#2 User is offline   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,633
  • Joined: 31-October 09

Posted 12 October 2010 - 03:03 PM

Hi!

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 User is offline   SoccerGuy3 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 118
  • Joined: 18-March 10
  • LocationNorthern California

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?
0

#4 User is offline   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,633
  • Joined: 31-October 09

Posted 13 October 2010 - 02:17 PM

Hi!

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

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users