Title: Kasp's Replies | WordPress.org

---

# Kasp

  [  ](https://wordpress.org/support/users/kasp/)

 *   [Profile](https://wordpress.org/support/users/kasp/)
 *   [Topics Started](https://wordpress.org/support/users/kasp/topics/)
 *   [Replies Created](https://wordpress.org/support/users/kasp/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/kasp/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/kasp/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/kasp/engagements/)
 *   [Favorites](https://wordpress.org/support/users/kasp/favorites/)

 Search replies:

## Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Flat Rate, Free Shipping and Local Pickup missing](https://wordpress.org/support/topic/flat-rate-free-shipping-and-local-pickup-missing/)
 *  Thread Starter [Kasp](https://wordpress.org/support/users/kasp/)
 * (@kasp)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/flat-rate-free-shipping-and-local-pickup-missing/#post-10597057)
 * PS: The missing image from the first post: [http://pasteall.org/pic/show.php?id=097f257a85f091df99bd93082802b97f](http://pasteall.org/pic/show.php?id=097f257a85f091df99bd93082802b97f)
    -  This reply was modified 7 years, 10 months ago by [Kasp](https://wordpress.org/support/users/kasp/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Flat Rate, Free Shipping and Local Pickup missing](https://wordpress.org/support/topic/flat-rate-free-shipping-and-local-pickup-missing/)
 *  Thread Starter [Kasp](https://wordpress.org/support/users/kasp/)
 * (@kasp)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/flat-rate-free-shipping-and-local-pickup-missing/#post-10597042)
 * Okay, the `woocommerce_shipping_methods` hook is what we are using to load our
   custom shipping methods. I thought maybe we are simply somehow overriding the
   default shipping methods with our custom ones.
 * I went to our custom shipping methods plugin’s code and checked what’s there:
 *     ```
       function add_custom_shipping_methods($methods) {
           return SmartieShipping::gI()->allShippingMethods();
       }
   
       add_filter( 'woocommerce_shipping_methods', 'add_custom_shipping_methods' );
       ```
   
 * I realized the `$methods` argument contains an array of default shipping methods
   loaded before this hook and any custom shipping methods are supposed to be attached
   to this array.
 * Perhaps someone somewhen changed this to return just our custom shipping methods
   from `allShippingMethods()`.
 * Changing the return line to the following made the default shipping methods available
   again:
    `return array_merge($methods, SmartieShipping::gI()->allShippingMethods());`
 * This problem is now resolved.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Flat Rate, Free Shipping and Local Pickup missing](https://wordpress.org/support/topic/flat-rate-free-shipping-and-local-pickup-missing/)
 *  Thread Starter [Kasp](https://wordpress.org/support/users/kasp/)
 * (@kasp)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/flat-rate-free-shipping-and-local-pickup-missing/#post-10596992)
 * Hm nope, the default shipping methods are hardcoded in `WC::get_shipping_method_class_names()`
   and this one is called AFTER the above.
 * In `WC::get_shipping_method_class_names()` the `$shipping_methods` array contains
   the default shipping methods before the `return`. But it seems like in `WC::load_shipping_methods()`
   the return value of `WC::get_shipping_method_class_names()` does not contain 
   the default shipping methods anymore, just our custom ones.
 * So perhaps the default shipping methods are lost somewhere in: `apply_filters('
   woocommerce_shipping_methods', $shipping_methods )`
    -  This reply was modified 7 years, 10 months ago by [Kasp](https://wordpress.org/support/users/kasp/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Flat Rate, Free Shipping and Local Pickup missing](https://wordpress.org/support/topic/flat-rate-free-shipping-and-local-pickup-missing/)
 *  Thread Starter [Kasp](https://wordpress.org/support/users/kasp/)
 * (@kasp)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/flat-rate-free-shipping-and-local-pickup-missing/#post-10596948)
 * It seems like there’s a problem with `WC::load_shipping_methods()`, because it
   expects a `$package = array()` argument and then there’s a condition:
 *     ```
       if ( ! empty( $package ) ) {
           // ...
       } else {
           $this->shipping_methods = array();
       }
       ```
   
 * Because `WC()->shipping->load_shipping_methods()` is called without argument,
   the default shipping methods get always erased from the array within the `else`
   block.
 * Location: WC::load_shipping_methods() in /wp-content/plugins/woocommerce/includes/
   class-wc-shipping.php at 152
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Flat Rate, Free Shipping and Local Pickup missing](https://wordpress.org/support/topic/flat-rate-free-shipping-and-local-pickup-missing/)
 *  Thread Starter [Kasp](https://wordpress.org/support/users/kasp/)
 * (@kasp)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/flat-rate-free-shipping-and-local-pickup-missing/#post-10596821)
 * It seems like this part, which generates the dropdown items:
 *     ```
       foreach ( WC()->shipping->load_shipping_methods() as $method ) {
           if ( ! $method->supports( 'shipping-zones' ) ) {
             continue;
           }
           echo '<option data-description="' . esc_attr( wp_kses_post( wpautop( $method->get_method_description() ) ) ) . '" value="' . esc_attr( $method->id ) . '">' . esc_attr( $method->get_method_title() ) . '</li>';
       }
       ```
   
 * …does only get the custom shipping methods from `WC()->shipping->load_shipping_methods()`,
   no Flat Rate, Free Shipping or Local Pickup is in the returned array.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events, Calendars & Tickets - Event Kikfyre] Calendar Widget](https://wordpress.org/support/topic/calendar-widget-28/)
 *  [Kasp](https://wordpress.org/support/users/kasp/)
 * (@kasp)
 * [9 years ago](https://wordpress.org/support/topic/calendar-widget-28/#post-9241562)
 * To make this work, I changed the line **668** in **service/class-em-event.php**
   to:
 * `$filter_results[]= $event_dao->get_events_at_date($start_date,true);`
 * And I have added this method to dao/class-em-event.php:
 *     ```
           // Get events at a date
           public function get_events_at_date($date, $format = false) {
   
               $start_time = em_time($date);
               $end_time = $start_time + 86340;
   
               $event_ids = array();
               $filter = array(
                   'orderby' => 'date',
                    'numberposts'=> -1,
                   'post_status'=> 'publish',
                   'order' => 'DESC',
                   'meta_query' => array(// WordPress has all the results, now, return only the events after today's date
                      'relation' => 'AND', 
                       array(
                           'key' => em_append_meta_key('start_date'), // Check the start date field
                           'value' => $start_time, // Set today's date (note the similar format)
                           'compare' => '>=', // Return the ones greater than today's date
                           'type' => 'NUMERIC,' // Let WordPress know we're working with numbers
                       ),
                       array(
                           'key' => em_append_meta_key('start_date'), // Check the start date field
                           'value' => $end_time, // Set today's date (note the similar format)
                           'compare' => '<=', // Return the ones greater than today's date
                           'type' => 'NUMERIC,' // Let WordPress know we're working with numbers
                       )
                   ),
                   'post_type' => EM_EVENT_POST_TYPE);
   
               $events = $this->get_events($filter);
   
               if (!empty($events)):
                   foreach ($events as $event):
                       $event_ids[] = $event->ID;
                   endforeach;
               endif;
   
               $recurring_events= $this->get_recurring_events_by_date($date);
               $event_ids= array_merge($event_ids,$recurring_events->ids);
   
               return $event_ids;
           }
       ```
   
    -  This reply was modified 9 years ago by [Kasp](https://wordpress.org/support/users/kasp/).
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Shapely] Homepage scroll anchor links](https://wordpress.org/support/topic/homepage-scroll-anchor-links/)
 *  Thread Starter [Kasp](https://wordpress.org/support/users/kasp/)
 * (@kasp)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/homepage-scroll-anchor-links/#post-8845780)
 * I’ved checked the topics thanks. I suppose there is no way to add fancy anchors
   like #contact as of now. Might be a feature to consider.
 * Thank you very much for this theme and for your help! 🙂
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Shapely] Homepage scroll anchor links](https://wordpress.org/support/topic/homepage-scroll-anchor-links/)
 *  Thread Starter [Kasp](https://wordpress.org/support/users/kasp/)
 * (@kasp)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/homepage-scroll-anchor-links/#post-8840110)
 * Thanks for the plugin 🙂
 * I need to anchor the links first through. Any idea about that? 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simple Event Planner] Side bar out of #content](https://wordpress.org/support/topic/side-bar-out-of-content/)
 *  Thread Starter [Kasp](https://wordpress.org/support/users/kasp/)
 * (@kasp)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/side-bar-out-of-content/#post-8581576)
 * Everything works great now. Thank you very much guys. 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simple Event Planner] Side bar out of #content](https://wordpress.org/support/topic/side-bar-out-of-content/)
 *  Thread Starter [Kasp](https://wordpress.org/support/users/kasp/)
 * (@kasp)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/side-bar-out-of-content/#post-8580589)
 * Okay, sounds great. Is there any estimation when could it be?
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Point] How to add the header menu item sub-titles?](https://wordpress.org/support/topic/how-to-add-the-header-menu-item-sub-titles/)
 *  Thread Starter [Kasp](https://wordpress.org/support/users/kasp/)
 * (@kasp)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/how-to-add-the-header-menu-item-sub-titles/#post-7039173)
 * That worked. Thank you very much!
 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[Project Manager by TPC] Does not work well at all with WP 4.1.1 – had to uninstall](https://wordpress.org/support/topic/does-not-work-well-at-all-with-wp-411-had-to-uninstall/)
 *  [Kasp](https://wordpress.org/support/users/kasp/)
 * (@kasp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/does-not-work-well-at-all-with-wp-411-had-to-uninstall/#post-7943671)
 * Really there seem to be several UI issues in the backend with the latest WP version,
   at least in Chrome.

Viewing 12 replies - 1 through 12 (of 12 total)