Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Paypal mod needs clarification


darp

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_session_unregister('shipping');

 

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;

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...