What is the Javascript event for an item being added to the cart in Woocommerce?

Read the source. From woocommerce-ajax.php (in the plugin’s root folder) Javascript/Ajax add to cart /** * AJAX add to cart * * @access public * @return void */ function woocommerce_ajax_add_to_cart() { global $woocommerce; check_ajax_referer( ‘add-to-cart’, ‘security’ ); $product_id = (int) apply_filters(‘woocommerce_add_to_cart_product_id’, $_POST[‘product_id’]); $passed_validation = apply_filters(‘woocommerce_add_to_cart_validation’, true, $product_id, 1); if ($passed_validation && $woocommerce->cart->add_to_cart($product_id, 1)) : // … Read more

WP_Query meta_query results date by date

My idea is following. 1. Get the array of all meta dates your events have. DISTINCT in the MySQL query means do not include duplicates. <?php /* * From https://wordpress.stackexchange.com/a/9451/11761 */ function get_all_possible_meta_dates( $key = ‘event_dates_wp’, $type=”page”, $status=”publish” ) { global $wpdb; $result = $wpdb->get_col( $wpdb->prepare( ” SELECT DISTINCT pm.meta_value FROM {$wpdb->postmeta} pm LEFT JOIN … Read more

Short code for Venues

There aren’t currently any shortcodes for venue information (address, postcode, other meta etc). However, you can copy the single-event.php template (find it in the templates directory of the plug-in) into your theme and edit it there to include venue information via provided template functions: Available functions When used inside the loop, you don’t need to … Read more

How to use get_categories() with Event Organiser plugin

Event categories are terms in a custom taxonomy, ‘event-category’, so you should use get_terms instead: //Args for which terms to retrieve $args = array(‘type’=> ‘post’, ‘order’ => ‘ASC’, ‘hide_empty’ => 1 ); //Array of taxonomies from which to collect the terms $taxonomies = array(‘event-category’); //Get the terms $terms = get_terms( $taxonomies, $args); //loop through the … Read more

Filtering more than one term in a taxonomy in WP

You can use tax_query and use the AND condition: Reference: WP_Query under Taxonomy Parameters $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘hotels’, ‘field’ => ‘slug’, ‘terms’ => array( ‘1 Star’ ) ), array( ‘taxonomy’ => ‘location’, ‘field’ => ‘slug’, ‘terms’ => array( ‘loc1’ ) ) ) ); … Read more