Changeset 1398102
- Timestamp:
- 04/18/2016 07:38:03 AM (10 years ago)
- Location:
- wc-pro-conversion-google-facebook-bing/trunk
- Files:
-
- 4 edited
-
inc/class-wc-cat-cn-settings.php (modified) (3 diffs)
-
inc/functions.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
wc-category-conversion-code.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wc-pro-conversion-google-facebook-bing/trunk/inc/class-wc-cat-cn-settings.php
r1373521 r1398102 40 40 41 41 $this->save_default_scripts( $_POST ); 42 43 $this->save_thankyou_script( $_POST ); 42 44 43 45 echo '<div id="message" class="updated"><p><strong>Changes has been saved successfully.</strong></p></div>'; … … 68 70 69 71 echo $this->general_code_fields(); 72 73 echo '<h3>Thank you page scripts.</h3>'; 74 75 echo '<p>Below code will be added to checkout success page.</p>'; 76 77 echo $this->thankyou_fields(); 78 //$thankyou_script = get_option('_woocommerce_conversion_thankyou_script'); 79 //print_r( $thankyou_script ); 70 80 71 81 echo '<input name="save_cn_code_settings" class="button-primary" type="submit" value="Save changes"/>'; … … 276 286 277 287 } 278 288 289 public function thankyou_fields(){ 290 291 $thankyou_script = get_option('_woocommerce_conversion_thankyou_script'); 292 293 294 295 $html ='<table class="form-table"> 296 297 <tbody> 298 299 <tr valign="top"> 300 301 <th scope="row" class="titledesc"><label>Google Conversion Code</label></th> 302 303 <td><textarea name="wc_thankyou_cn_gcode" rows="5" cols="40">'.strip_slashes_script($thankyou_script['_cn_gcode']).'</textarea></td> 304 305 </tr> 306 307 <tr valign="top"> 308 309 <th scope="row" class="titledesc"><label>Yahoo Conversion Code</label></th> 310 311 <td><textarea name="wc_thankyou_cn_ycode" rows="5" cols="40">'.strip_slashes_script($thankyou_script['_cn_ycode']).'</textarea></td> 312 313 </tr> 314 315 <tr valign="top"> 316 317 <th scope="row" class="titledesc"><label>Bing Conversion Code</label></th> 318 319 <td><textarea name="wc_thankyou_cn_bcode" rows="5" cols="40">'.strip_slashes_script($thankyou_script['_cn_bcode']).'</textarea></td> 320 321 </tr> 322 323 </tbody> 324 325 </table>'; 326 327 return $html; 328 } 329 330 public function save_thankyou_script( $post){ 331 332 if(isset($post['save_cn_code_settings'])){ 333 334 $thankyou_script = array(); 335 336 $thankyou_script['_cn_gcode'] = wc_cat_cn_sanitize_script($post['wc_thankyou_cn_gcode']); 337 338 $thankyou_script['_cn_ycode'] = wc_cat_cn_sanitize_script($post['wc_thankyou_cn_ycode']); 339 340 $thankyou_script['_cn_bcode'] = wc_cat_cn_sanitize_script($post['wc_thankyou_cn_bcode']); 341 342 if( !empty( $thankyou_script['_cn_gcode'] ) || !empty( $thankyou_script['_cn_ycode'] ) || $thankyou_script['_cn_bcode'] ){ 343 $res = update_option( '_woocommerce_conversion_thankyou_script', $thankyou_script ); 344 }else{ 345 delete_option( '_woocommerce_conversion_thankyou_script' ); 346 } 347 348 return true; 349 } 350 351 } 352 353 public function print_thankyou_script( $order_id ){ 354 355 $thankyou_script = get_option('_woocommerce_conversion_thankyou_script'); 356 357 } 279 358 280 359 -
wc-pro-conversion-google-facebook-bing/trunk/inc/functions.php
r1373521 r1398102 34 34 35 35 function get_conversion_code(){ 36 37 36 37 38 39 if( is_order_received_page() ){ 40 $thankyou_script = get_option('_woocommerce_conversion_thankyou_script'); 41 if(!empty($thankyou_script)) return $thankyou_script; 42 } 38 43 39 44 if(is_product()){ … … 101 106 102 107 $cat_script = get_woocommerce_term_meta( $cat_id, $key ); 103 104 105 108 106 109 if( $cat_script ) return $cat_script; // return code of current category 107 110 108 //return count($cat_script);109 //return $parent_id;110 111 if( !$cat_script ){ 111 112 if($cat->parent > 0){ // if category has parent category … … 164 165 } 165 166 166 echo "<!-- Convers tion Code -->\n";167 echo "<!-- Conversion Code -->\n"; 167 168 168 169 if(!empty($gcode)) echo strip_slashes_script($gcode)."\n\n"; -
wc-pro-conversion-google-facebook-bing/trunk/readme.txt
r1373684 r1398102 53 53 2. Go to plugins interface and activate the plugin. 54 54 55 3. Go to "Woocommerce" menu and click on submenu "Conversion Code Settings" for settings55 3. Go to "Woocommerce" menu and click on submenu "Conversion Code" for settings 56 56 57 57 4. Set default code for facebook,bing and yahoo. … … 84 84 85 85 3. Category conversion code, which will show on category pages. 86 87 == Changelog == 88 89 = 1.3 = 90 * Latest updates : Show conversion on woocommerce thank you page. 91 92 = 1.2 = 93 * Change settings menu name in under woocommerce menus 94 95 = 1.1 = 96 * Fix issues in with subcategories and product page -
wc-pro-conversion-google-facebook-bing/trunk/wc-category-conversion-code.php
r1373521 r1398102 231 231 $wc_cat_cn_settings = new Wc_Conversion_Code_Settings; 232 232 233 add_submenu_page( 'woocommerce', 'Conversion Code Settings', 'Conversion Code Settings', 'manage_options', 'can-cn-code-settings', array($wc_cat_cn_settings, 'cn_code_settings_callback') );233 add_submenu_page( 'woocommerce', 'Conversion Code', 'Conversion Code', 'manage_options', 'can-cn-code-settings', array($wc_cat_cn_settings, 'cn_code_settings_callback') ); 234 234 235 235 }
Note: See TracChangeset
for help on using the changeset viewer.