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 01-28-2019 01:39:45

polarize
Member
Registered: 11-15-2004
Posts: 293

Local Delivery Zip Code Based Along With UPS and USPS Realtime

Hello,

I am trying to construct a custom shipping script that can do the following...

1. Only Available for chosen Multisite -- Default Site or All Sites if it can be core_users based
2. Include Shipping Carrier Choices from Inventory Record to be either UPS or USPS or both
3. Apply only to Local Stocked Items
4. Add OUR TRUCK to the shipping choices only for zip codes (or user accounts preferred) we choose free delivery
5. Add OUR TRUCK to the shipping choices only for zip codes (or user accounts preferred) we choose handling charge of say 10 dollars
6. Works only for logged in accounts and be used by us in POS for these customers as well that are shipping to zip codes or user accounts we entered in for approval for either free or designated handling charge
7. Have the ability to add a percentage handling charge to UPS and/or USPS if desired

The closest script I've seen so far is in V8 support here..
https://forum.kryptronic.com/viewtopic.php?id=30536

I have tried to include bits of other custom scripts in there but have a feeling that it looks more like my A.D.D. kicking in than a functional script.

Code:

<?php 

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

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

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

if ($info['shipzip'] != '00000, 00001, 00002') {$this->globals('ecom.ship_freehandled',1);}

if ($info['shipzip'] != '00000, 00001, 00002') {$this->globals('ecom.ship_?????',1);}

// +--
// | Or better yet this...
// + --

if ($info['core_users'] != 'johndoe@email.com, janedoe@email.com, etc@email.com') {$this->globals('ecom.ship_freehandled',1);}

if ($info['core_users'] != 'johndoe@email.com, janedoe@email.com, etc@email.com') {$this->globals('ecom.ship_?????',1);}   <<<Handling Charge option

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

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

} // End of foreach statement.

$custom['Our Truck'] = '0.00';

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

?>

Because I've lost where and how everything ties in together can't seem to get going again to make it work.

My first choice was to use the K9 built-in local pickup option and just rename it Our Truck but the orders all default back to my shipping address by doing so and we had only allowed it for back end POS only.  We would like to have it work on the front end with designated accounts by zip code or user account id if that's possible so we can control who gets delivery on our truck.  Additionally they would also be able to to UPS or USPS as an option and for all others we haven't approved for Our Truck to only see realtime rates designated from the inventory record. Any ideas how we can write this script to make it work like that?  I hope I didn't confuse it even more.. LOL Thank you


Using Kryptronic K9! smile
Previous Versions:
ClickCartPro 8
ClickCartPro 7
ClickCartPro 6
ClickCartPro 5.1

Offline

 

#2 01-28-2019 09:27:15

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Local Delivery Zip Code Based Along With UPS and USPS Realtime

You should contact the custom shop and get a quote on having us handle this scripting for you. 

You've got holes in your logic: You mention one multisite, but not how to handle each in (1); You appear to want to split shipments within a custom shipping script based on inventory info in (2), which is not entirely possible without heavy mods; you want this to work for only logged in users, but provide no case for non-logged in users in (6). 

You will probably want to make use of user account custom data fields, but from your explanation, it's not clear that you know how to do this, or are aware such capabilities exist.  You may or may not have disabled purchasing and/or checkout for users.  You may or may not know the ability to do that exists.  All bases need to be covered.  The best way to handle this is to have us do it for you.  This is a bit too complex to work out on the forum, and I don't think your requirements are defined well enough to be successful with that, anyway.


Nick Hendler

Offline

 

#3 01-28-2019 12:14:00

polarize
Member
Registered: 11-15-2004
Posts: 293

Re: Local Delivery Zip Code Based Along With UPS and USPS Realtime

I apologize for making it sound complicated here in the forum.  The dynamics can change drastically if we can refer to account based for this as follows...

1. This can be available for All Sites if it can be core_users based and log in is not relevant if it only applies to the selected "core_users" that we code into the script
2. Include Shipping Carrier Choices from Inventory Record to be either UPS or USPS or both
3. Apply only to Local Stocked Items
4. Add OUR TRUCK to the shipping choices only for user accounts we choose in the script for free delivery
5. Add OUR TRUCK to the shipping choices only for user accounts we choose handling charge of say 10 dollars
6. Can be used by us in POS for these customers whose user accounts we entered in for approval for either free or designated handling charge
7. Have the ability to add a percentage handling charge to UPS and/or USPS if desired

I want to understand better how these scripts work so thats why I wanted to try and make a go of it with some guidance if possible.  Does this simplify it more?  I'll still send a request over to the custom shop so we can talk about it more.  Thanks again smile


Using Kryptronic K9! smile
Previous Versions:
ClickCartPro 8
ClickCartPro 7
ClickCartPro 6
ClickCartPro 5.1

Offline

 

#4 01-29-2019 07:50:06

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Local Delivery Zip Code Based Along With UPS and USPS Realtime

We've got a ticket open for you now.  We'll work out your specific requirements there, and will get a solution in place.


Nick Hendler

Offline

 

Board footer