Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 06-26-2013 07:57:22

btr
Member
Registered: 10-19-2007
Posts: 10

Custom and UPS online tools script

I am trying to setup a custom ship method in ClickCartPro 7 that will do the following.  For all products whose part# start with RC we offer free ground shipping to the continental U.S. only.    We also need to offer other UPS options using UPS online tools as well as UPS international shipping.  I have played around with some custom scripts I have found in this forum, but have not been able to do everything I need.  If anyone has a script that accomplishes this, I would greatly appreciate some help.

Offline

 

#2 06-28-2013 06:02:48

btr
Member
Registered: 10-19-2007
Posts: 10

Re: Custom and UPS online tools script

This is the custom script I am using currently to offer free shipping to the contiguous U.S.  It works, but it does not offer any of the other UPS shipping options (overnight, second day ...).  Is there a simple line to add to offer the realtime shipping options as well as free shipping to the script?

<?php

// +--
// | Set up variables.
// +--

$info     = $this->globals('ecom.customship');
$custom   = array();

$carriers = 'UPSTOOLS';
$freetext = 'Free Wireless Shipping In Contiguous U.S.';

// +--
// | Flat Rate/Free US
// +--

if ($info['country'] == 'United States') {

     $custom[$freetext] = 0.00;

// +--
// | Realtime
// +--

} else {

     $delinfo = array('stateprov'     => $info['stateprov'],
                      'country'       => $info['country'],
                      'postalcode'    => $info['postalcode'],
                      'rescom'        => $info['rescom'],
                      'shipstateprov' => $info['shipstateprov'],
                      'shipcountry'   => $info['shipcountry'],
                      'shipzip'       => $info['shipzip'],
                      'shipmethods'   => $carriers,
                      'shiptype'      => 'R');

     $result = $this->include_namespace('ecom','shiprealtime',array('delinfo'  => $delinfo,
                                                                    'packages' => $info['packages']));

     foreach ($result as $num => $service) {

          $custom[$service['name']] = $service['amount'];

     } // End of foreach statement.


} // End of if statement.

// +--
// | Globalize and return.
// +--

$this->globals('ecom.customship_response',$custom);

?>

Offline

 

Board footer