PHP code example of onedesign / oneshipstation

1. Go to this page and download the library: Download onedesign/oneshipstation library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

onedesign / oneshipstation example snippets


class MyPlugin extends BasePlugin {

    public function oneShipStationShippingMethod() {
        return function($order) {
            if ($order->getShippingAddress()->country == 'US') {
                return 'Ground';
            }
        }
    }

}

class MyPlugin extends BasePlugin {

    public function oneShipStation_trackingURL($shippingInfo) {
        return 'https://mycustomlink?tracking=' . urlencode($shippingInfo->trackingNumber);
    }

}