This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This function loops over cart items, and moves any item with shipping class 'special-class' into a new package. | |
* The new package in this example only takes flat rate shipping. | |
*/ | |
function split_special_shipping_class_items( $packages ) { | |
$found_item = false; | |
$special_class = 'special-class'; // edit this with the slug of your shippig class | |
$new_package = current( $packages ); | |
$new_package['contents'] = array(); | |
$new_package['contents_cost'] = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// VIN API decoder for PHP 4.x+ | |
define('ELEMENT_CONTENT_ONLY', true); | |
define('ELEMENT_PRESERVE_TAGS', false); | |
function getXML($vin) { | |
$curl = curl_init(); | |
curl_setopt ($curl, CURLOPT_URL, 'http://vinapi.skizmo.com/vins/'. $vin.'.xml'); | |
curl_setopt ($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/xml', 'X-VinApiKey: #YOURAPIKEYGOESHERE#')); //use your API key here |