====== Auto-Check Extras ====== This tutorial will walk you through the steps necessary to create an addon, that will cause any "listing extras" to start out automatically checked when placing a new listing. **Requires Geo 4.0.0** This tutorial assumes a basic understanding of PHP and knowledge of how to FTP files from and to your server. - In the **addons/** directory, create a new directory named **auto_check_extras**. < - Inside the new directory, create a file named **info.php**. This file is what tells the Geo addon system what this particular addon can do. Use the following contents for this file: < - Now, inside **addons/auto_check_extras/** directory, create a new sub-directory named **order_items**. This directory is parsed by the order system, to look for any order items in the addon. To accomplish our task, we will be creating just such an order item. < - Inside the new directory, create a file named **auto_check_listing_extras.php**. This file will serve as a new **order item**, although the order item will never actually be added to an order. Use the following contents for this file: site->session_variables['auto_check_ran'])) { //make sure we only auto-check the first time the page //loads! return; } $cart->site->session_variables['auto_check_ran'] = 1; //Un-Comment the lines for the extras you want to auto-check //un-comment for better placement //$cart->site->session_variables ['better_placement'] = 1; //un-comment for bolding //$cart->site->session_variables ['bolding'] = 1; //un-comment for featured level 1 //$cart->site->session_variables ['featured_ad'] = 1; //un-comment for featured level 2 //$cart->site->session_variables ['featured_ad_2'] = 1; //un-comment for featured level 3 //$cart->site->session_variables ['featured_ad_3'] = 1; //un-comment for featured level 4 //$cart->site->session_variables ['featured_ad_4'] = 1; //un-comment for featured level 5 //$cart->site->session_variables ['featured_ad_5'] = 1; } protected $type = "auto_check_listing_extras"; const type = 'auto_check_listing_extras'; protected $defaultProcessOrder = 10; const defaultProcessOrder = 10; //required by system public function displayInAdmin() { return false; } //required by system, doesn't have to do anything though public static function geoCart_initSteps($allPossible=false){ } //required by system public static function geoCart_initItem_forceOutsideCart() { return false; } //required by system public static function getParentTypes(){ return array('classified','auction'); } //required by system public function getDisplayDetails ($inCart){ return false; } //required by system public static function geoCart_initSteps_addOtherDetails(){ return false; } } < - In the contents of the file, in the method **geoCart_other_detailsDisplay**, un-comment the line for each listing extra type that you want to be auto-checked. For instance, if you wanted bolding to be auto-checked, in the file you would change the code: //un-comment for bolding //$cart->site->session_variables ['bolding'] = 1; And change to: //un-comment for bolding $cart->site->session_variables ['bolding'] = 1; < - Now, go into addon management, and you should see the addon named "Auto-Check Listing Extras". Install and enable that addon. < - If everything is done correctly, when placing a listing, the listing extras should start out checked by default. <