Jump to content
Sign in to follow this  

Paypal mod needs clarification

Recommended Posts

Krugeros' paypal express shipping module mod ( http://addons.oscommerce.com/info/7333 ) seems to break the code. Does it mean I am to replace all the original code that is quoted with the snippet that he wrote? That doesn’t seem to work. There are closing brackets in the first part of the original code and the code is broken if that portion is deleted. Could someone please clarify. Here it is.


1) If Paypal overrides your shipping method you should try this solution:


in catalog\ext\modules\payment\paypal\express.php find :


// select cheapest shipping method

$shipping = $shipping_modules->cheapest();

$shipping = $shipping['id'];




if (strpos($shipping, '_')) {

list($module, $method) = explode('_', $shipping);


if ( is_object($$module) || ($shipping == 'free_free') ) {

if ($shipping == 'free_free') {

$quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;

$quote[0]['methods'][0]['cost'] = '0';

} else {

$quote = $shipping_modules->quote($method, $module);



if (isset($quote['error'])) {



tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

} else {

if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {

$shipping = array('id' => $shipping,

'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),

'cost' => $quote[0]['methods'][0]['cost']);






and replace with this :


// load the selected shipping module

require(DIR_WS_CLASSES . 'shipping.php');

$shipping_modules = new shipping($shipping);


require(DIR_WS_CLASSES . 'order_total.php');

$order_total_modules = new order_total;

Share this post

Link to post
Share on other sites

I had the exact same problem and I'm not sure of the solution

I am a coder so I had a look at the code and I'm not sure what his intent was.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this