Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

is there a way to do this?


wkrecords

Recommended Posts

You can add conditions to the shipping modules based on just about anything.

 

I have set them up to appear/disappear based on various criteria.

 

In this example, I use a function to determine if Free Shipping should be the only module showing based on cart content. Just setup an IF or case paramater to handle whether or not this is set:

 

This is /includes/modules/shipping/flat.php

 

// BOF: WebMakers.com Added: Free Payments and Shipping

if ( tep_get_free_shipper($this->code) ) {

     $this->enabled = MODULE_SHIPPING_FLAT_STATUS;

}

// EOF: WebMakers.com Added: Free Payments and Shipping

Link to comment
Share on other sites

I am sorry, I thought you were trying to setup the modules so that when a customer is from one place you see one set of shipping modules and when from another you would see another set of shipping modules.

 

You can, however, use this to do something similar.

 

Make a copy of the current shipping module and rename it.

 

Have one set to the US rates and the other for outside of the US.

 

Then, based on customer address use the IF statement idea I showed you to determine which shipping module actually shows.

 

This would allow you to maintain two sets of rates and only one set appears when the customer is checking out based on address.

Link to comment
Share on other sites

You would do a check to see what the country is for the current address.

 

Then, you have two shipping modules ... like table.php and tableuk.php

 

Then, add a function to validate the shipping address and return true or false for US.

 

function tep_get_valid_address_us or something like that.

 

If it returns true, then the table.php will run. If not, it will be hidden.

 

Set the other shipping module so when it returns false that it will show, otherwise when true, it will be hidden.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...