Advertisement
Guest User

Untitled

a guest
Sep 16th, 2011
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. *if there is no presence of postcode for estimate , make shipping cost 0
  5. * @param object $options shipping detail
  6. * @author vinay
  7. *
  8. */
  9. if ( !function_exists("show_initial_shipping_cost") ):
  10. function show_initial_shipping_cost($options) {
  11. global $Shopp;
  12. if ( $Shopp->Shopping->data->Order->Shipping->postcode != "" ){
  13. //do nothing for now
  14. } else {
  15. $options["Domestic Shipping"]->amount = 0;
  16. }
  17. #if ( $_SERVER['REMOTE_ADDR'] == "110.44.113.254" )
  18. //$Shopp->Shipping->postcodes
  19. #print_r($Shopp->Shipping);
  20. }
  21. endif;
  22. //hook to calculate total shipping
  23. add_action('shopp_calculate_shipping','show_initial_shipping_cost',100);
  24.  
  25. function jake_add_scripts {
  26.  
  27. if (is_home() || is_front_page()) {
  28.  
  29. $scripturl = WP_PLUGIN_URL .'/easing-slider/js/';
  30.  
  31. if(get_option('jquery') == 'true') {
  32. if ( !is_admin() ) {
  33. wp_deregister_script('jquery');
  34. wp_register_script('jquery', $scripturl.'jquery.js', '', '1.4.2');
  35. wp_enqueue_script('jquery');
  36. }
  37. }
  38.  
  39. wp_register_script('easing', $scripturl.'jquery.easing.js', '', '1.3');
  40. wp_enqueue_script('easing');
  41. wp_register_script('script', $scripturl.'script.js', '', '1.1.9');
  42. wp_enqueue_script('script');
  43.  
  44. }
  45. }
  46.  
  47. function jake_add_styles() {
  48. if (is_home() || is_front_page()) {
  49. $sliderstyle = WP_PLUGIN_URL .'/easing-slider/css/slider.css';
  50.  
  51. wp_register_style('slider', $sliderstyle, '', '1.1.9');
  52. wp_enqueue_style('slider');
  53. }
  54.  
  55. }
  56. remove_action('wp_print_styles','add_styles');
  57. remove_action('wp_print_scripts','add_scripts');
  58. add_action('wp_print_styles','jake_add_styles');
  59. add_action('wp_print_scripts','jake_add_scripts');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement