This file contains hidden or 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
| <?php | |
| function alter_feed_item( $attributes, $feed_id, $product_id ) { | |
| // The $attributes variable is an array that contains all the product data that goes into the feed. Each item | |
| // can be accessed by it's feed key. So if in the feed file an item has a key like 'description', you | |
| // can access that specific item by $attributes['description']. | |
| // The $feed_id (string) makes it possible to only edit a specific feed. You can find the id of a feed in the | |
| // url of the Feed Editor, right after id=. | |
| // The $product_id (string) makes it possible to select a specific product id that you want to filter. |
This file contains hidden or 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 hidden or 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 |