Skip to content

Instantly share code, notes, and snippets.

View bizzthemes's full-sized avatar

BizzThemes bizzthemes

View GitHub Profile
@bizzthemes
bizzthemes / wc-appointments-calendar-day-view.php
Created April 28, 2016 07:56
Default calendar view set to current day
<?php
//* Do NOT include the opening php tag, only copy the code below to functions.php file
if ( class_exists( 'WC_Appointments' ) ) {
// Default Calendar view: 'day' or 'month'
add_filter( 'woocommerce_appointments_calendar_view', 'appointments_default_view' );
function appointments_default_view() {
$default_view = 'day';
return $default_view;
@bizzthemes
bizzthemes / wc-appointments-discounts.php
Created March 25, 2016 13:31
Experimentally show discounts
add_theme_support( 'woocomerce-appointments-show-discounted-slots' );
@bizzthemes
bizzthemes / gcal-sync-unpaid.php
Last active October 3, 2016 11:36
Sync Google Calendar with unpaid appointments
<?php
//* Do NOT include the opening php tag, only copy the code below to functions.php file
add_filter( 'woocommerce_appointments_gcal_sync_statuses', 'gcal_sync_unpaid_statuse' );
function gcal_sync_unpaid_statuse( $sync_statuses ) {
//* Sync with unpaid appointments
array_push( $sync_statuses, 'unpaid' );
return $sync_statuses;
}
@bizzthemes
bizzthemes / appointment-form-shortcode.html
Last active November 9, 2015 16:14
Appointment/booking form shortcode arguments
$array(
'id' => '',
'sku' => '',
'show_title' => 1, // use 1 or 0
'show_rating' => 1, // use 1 or 0
'show_price' => 1, // use 1 or 0
'show_excerpt' => 1, // use 1 or 0
'show_meta' => 1, // use 1 or 0
'show_sharing' => 1 // use 1 or 0
);
@bizzthemes
bizzthemes / appointment-form-in-tab.php
Last active October 13, 2015 08:55
Move appointment booking form to separate tab
<?php
//* Do NOT include the opening php tag, only copy the code below to functions.php file
//* Remove scheduling form
add_action( 'wp_head', 'bizzwoo_remove_appointment_form', 0 );
function bizzwoo_remove_appointment_form() {
global $wc_appointment_cart_manager;
remove_action( 'woocommerce_appointment_add_to_cart', array( $wc_appointment_cart_manager, 'add_to_cart' ), 30 );
}
@bizzthemes
bizzthemes / bizznis-responsive-menu.css
Last active September 10, 2015 14:20
Responsive menu for Bizznis child themes
/*
Modify the breakpoint per your choice, 768px by default.
Add any/all of these styles to your child theme's custom CSS.
*/
@media only screen and ( max-width: 768px ) {
.mobile-menu-icon {
cursor: pointer;
display: block;
@bizzthemes
bizzthemes / booking-form.css
Created August 18, 2015 08:47
WooCommerce Appointments CSS for the frontend
/*
Modify the color styles of the WooCommerce Appointments booking form.
Add any/all of these styles to your theme's custom CSS, but be sure to change
the color hex codes to your choice. They're all default here.
*/
/* Booking form wrapper */
.wc-appointments-appointment-form {
background-color: #fff;
border: 1px solid #ddd;
@bizzthemes
bizzthemes / discount-without-coupon.php
Created June 10, 2015 12:36
Apply Discount without a Coupon Code for Car Hire
<?php
//* Do NOT include the opening php tag, only copy the code below to custom_functions.php file
add_filter( 'bizz_coupon_filter', 'custom_coupon_filter' );
function custom_coupon_filter( $coupon_post ) {
$coupon_post['type'] = 'percentage'; // 'percentage', 'fixed_unit', 'fixed_block'
$coupon_post['amount'] = '10';
$coupon_post['car'] = array( 'all' ); // accepts array of vehicle ID's or 'all' for all vehicles
$coupon_post['extra'] = array( 'all' ); // accepts array of extra ID's or 'all' for all extras
@bizzthemes
bizzthemes / coupon-min-3-days.php
Created May 4, 2015 10:07
Require minimum of 3 days hire for coupon to work
<?php
//* Do NOT include the opening php tag, only copy the code below
add_filter( 'coupon_filter', 'custom_coupon_filter', 10, 7 );
function custom_coupon_filter( $return, $car_id, $carhire_cookie, $days_array, $pricing_posts, $coupon_post, $opt_s ) {
// count days
$count_days = ( $isobject==1 ) ? $carhire_cookie->count_days : $carhire_cookie['count_days'];
// minimum 3 days hire
@bizzthemes
bizzthemes / disable-customer-notifications.php
Created May 4, 2015 10:01
Disable customer email notification
<?php
//* Do NOT include the opening php tag, only copy the code below
add_action( 'bizzthemes_send_notification_shortcut', 'disable_customer_notification', 10, 3 );
function disable_customer_notification( $status, $customer_email, $subject, $body, $headers ) {
// Stop customer email notifications
if ( $status == 'customer' ) {
return '';
}