This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('woocommerce_xero_line_item_account_code', 'wc_custom_xero_account_code', 10, 2); | |
| function wc_custom_xero_account_code($account_code, $line_item) { | |
| // $line_item->get_item_code() returns the SKU of the line item. | |
| if( $line_item->get_item_code() == 'ACME') { | |
| return '460'; | |
| } | |
| return $account_code; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('wc_stripe_sofort_source', 'add_testing_details_sofort', 10, 2); | |
| function add_testing_details_sofort($post_data, $order) { | |
| $post_data['owner']->name = 'succeeding_charge'; | |
| return $post_data; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter('wc_stripe_supported_countries', 'wc_stripe_add_puerto_rico'); | |
| function wc_stripe_add_puerto_rico($countries) { | |
| $countries[] = 'PR'; | |
| return $countries; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('wp', 'delete_meta_bookings_no_products'); | |
| function delete_meta_bookings_no_products() { | |
| $booking_ids = get_posts( array( | |
| 'numberposts' => 100000, | |
| 'offset' => 0, | |
| 'orderby' => 'post_date', | |
| 'order' => 'DESC', | |
| 'post_type' => 'wc_booking', | |
| 'post_status' => get_wc_booking_statuses(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Monthly Sales Custom Shortcode | |
| */ | |
| add_shortcode( 'display_monthly_sales', 'print_monthly_sales_frontend' ); | |
| function print_monthly_sales_frontend() { | |
| global $woocommerce, $wpdb, $product; | |
| include_once($woocommerce->plugin_path() . '/includes/admin/reports/class-wc-admin-report.php'); | |
| // WooCommerce Admin Report |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter ('woocommerce_email_order_items_args', 'send_purchase_note_to_everyone'); | |
| function send_purchase_note_to_everyone( $args ) { | |
| $args['show_purchase_note'] = true; | |
| return $args; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ul.products li.product .img-wrap { | |
| background: transparent; | |
| -webkit-box-shadow: none; | |
| -moz-box-shadow:none; | |
| box-shadow: none; | |
| } | |
| ul.products li.product:hover .img-wrap { | |
| background: transparent; | |
| -webkit-box-shadow: none; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_get_price_html', 'custom_price_string', 100, 2 ); | |
| function custom_price_string( $price, $product ){ | |
| return $price . ' per hour'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Place in your theme's functions.php file | |
| function custom_booking_price( $price, $product ) { | |
| $target_product_types = array( | |
| 'booking' | |
| ); | |
| if ( in_array ( $product->product_type, $target_product_types ) ) { | |
| // if variable product change price output | |
| $price = ''; | |
| $price .= woocommerce_price($product->get_price()) . ' per person'; |