This is an old revision of the document!
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.
<?php //file /addons/auto_check_extras/info.php class addon_auto_check_extras_info { var $name = 'auto_check_extras'; var $version = '1.0.0'; var $title = 'Auto-Check Listing Extras'; var $author = "Geo Developer Tutorial"; var $description = 'Automatically checks listing extas when a user places a new auction or classified listing.'; var $auth_tag = 'my_addons'; }
<
<?php //file /addons/auto_check_extras/order_items/auto_check_listing_extras.php class auto_check_listing_extrasOrderItem extends geoOrderItem { //Note: only the most necessary methods needed for the current task //are defined here. For a complete list of methods, see the file //classes/order_items/_template.php //This is where the action happens for this order item! public static function geoCart_other_detailsDisplay (){ $cart = geoCart::getInstance(); if (isset($cart->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(){ } //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, Geo 4.0.0 RC10 and earlier. Can be removed in RC11 and after public function geoCart_cartDisplay(){ return ''; } //required by system, in Geo 4.0.0 RC11 and after. public function getDisplayDetails ($inCart){ return false; } //required by system public static function geoCart_initSteps_addOtherDetails(){ return false; } }
<
//un-comment for bolding //$cart->site->session_variables ['bolding'] = 1;
And change to:
//un-comment for bolding $cart->site->session_variables ['bolding'] = 1;
<
Note: This is a brand new tutorial.