Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
Author « Topic »  

OrientalOutpost
Advanced Member

China
302 Posts

Pre-sales questions only
(More Details...)

Posted - 01/24/2022 :  09:10:49  
For those in the USA or Australia using Sendle.com (shipping service that is like Stamps.com or Endicia.com, but without the high monthly fees - and lower First Class rates for packages that are 1 lb or less) here is a mod to automatically send your customer's address and details to the Sendle site:

in incorders.php, around line 1612 find:

if(! ($isprinter || $doedit)){ ?>
<div class="billing container container12">
<div class="clipboard left"></div>

Replace with:

if(! ($isprinter || $doedit) && $alldata['ordShipName']==''){ ?>
<div class="billing container container12">
<div class="clipboard left"><?php print '<a href="https://www.sendle.com/dashboard/prepare_form?description=Artwork&customer_reference=' . $alldata['ordID']
. '&delivery_address_line1=' . $alldata['ordAddress']
. '&delivery_address_line2=' . $alldata['ordAddress2']
. '&delivery_country=USA'
. '&delivery_address_suburb=' . $alldata['ordCity']
. '&delivery_address_state=' . $alldata['ordState']
. '&delivery_address_postcode=' . $alldata['ordZip']
. '&receiver_name=' . $alldata['ordName']
. '&receiver_email=' . str_replace('@','%40',$alldata['ordEmail'])
. '&receiver_contact_number=' . $alldata['ordPhone'] . '" target="_Sendle">
<img src="adminimages/sendle.png" width=87 height=22 alt="Sendle"></a>';?></div>


Find near line 1708:

<div class="ship container container12">
<div class="clipboard left"></div>

Replace with:

<div class="ship container container12">
<div class="clipboard left"><?php print '<a href="https://www.sendle.com/dashboard/prepare_form?description=Artwork&customer_reference=' . $alldata['ordID']
. '&delivery_address_line1=' . $alldata['ordShipAddress']
. '&delivery_address_line2=' . $alldata['ordShipAddress2']
. '&delivery_country=USA'
. '&delivery_address_suburb=' . $alldata['ordShipCity']
. '&delivery_address_state=' . $alldata['ordShipState']
. '&delivery_address_postcode=' . $alldata['ordShipZip']
. '&receiver_name=' . $alldata['ordShipName']
. '&receiver_email=' . str_replace('@','%40',$alldata['ordEmail'])
. '&receiver_contact_number=' . $alldata['ordShipPhone'] . '" target="_Sendle">
<img src="adminimages/sendle.png" width=87 height=22 alt="Sendle"></a>';?></div>

Get/save this image and upload it to your /vsadmin/adminimages: [img]https://www.orientaloutpost.com/vsadmin/adminimages/sendle.png[/img]

You will need to be logged in to your Sendle.com account for this to work (otherwise, you just find a page that asks you to log in or sign up). The link opens in a new _Sendle target tab on your browser (change that if you want).

You will want to change the default description from description=Artwork to something appropriate for your business. I sell artwork, so that's my placeholder. Sendle requires a brief description. Use + signs if there are spaces like description=Amazing+Products so the link does not break.

At the top, I added a $alldata['ordShipName']=='' question, which determines if there is shipping info. It will only show the Sendle and Copy buttons on the billing if that is the only info. This helps you not make a mistake (and ship to billing if there is a shipping address).

If you are in Australia, you will need to tinker with the delivery_country=USA part. Sendle is only domestic in the USA, but Australia has more options that I don't have access to.

[url="https://www.OrientalOutpost.com"]Oriental Outpost Custom Wall Scrolls[/url]

OrientalOutpost
Advanced Member

China
302 Posts

Pre-sales questions only
(More Details...)

Posted - 01/26/2022 :  07:44:54  
There are 6 additional parameters you can add so that the size/weight/service of the package is automatically selected. It takes all 6 of these to be defined for this selection to be automatic on Sendle. Here is an example of what you could add:

. '&parcel_weight_value=15'
. '&parcel_weight_units=oz'

. '&parcel_size_length=21'
. '&parcel_size_width=2'
. '&parcel_size_height=3'
. '&parcel_size_units=in'

A 15oz package that measures 21x2x3 inches goes in the very cheap "Mini up to 1lb" category on Sendle. Currently between $5.15 and $5.65 depending on zone/distance in the USA.

parcel_weight_value must be kg, g, oz, or lb.
parcel_size_units seems to work with ft or in.

ECT does have a $totweight variable that could be plugged into Sendle's parcel_weight_value, but that variable is calculated much farther down the code in incorders.php so the Sendle link would need to be near the bottom of the order view.

It's very hard to calculate package dimensions in ECT (or any e-commerce platform), so you can just use these parameters for your most common package size and weight. Or just select manually each time on Sendle, as my original code will have you do.

All of this is based on a hard-to-find document here on the Sendle Developers/API site: https://developers.sendle.com/reference/prepare-form-url

[url="https://www.OrientalOutpost.com"]Oriental Outpost Custom Wall Scrolls[/url]

Edited by - OrientalOutpost on 01/27/2022 07:22:31
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.02 seconds. Snitz Forums 2000