View gist:0072e03437728849186816c576f83f8b
This file contains 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
function sg_filter_woocommerce_cart_needs_payment( $needs_payment, $cart ) { | |
// Set true | |
$needs_payment = true; | |
return $needs_payment; | |
} | |
add_filter( 'woocommerce_cart_needs_payment', 'sg_filter_woocommerce_cart_needs_payment', 10, 2 ); |
View checkout-long-lat
This file contains 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('woocommerce_checkout_update_order_review','sg_get_latlong',20,2); | |
function sg_get_latlong($posted_data ){ | |
parse_str($posted_data, $output); | |
// error_log(print_r($posted_data,true)) ; | |
if(isset($output['shipping_lat'])){ |
View all-angular-material-components-imports.txt
This file contains 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
import { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule } from '@angular/core'; | |
import { AppComponent } from './app.component'; | |
//Angular Material Components | |
import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; | |
import {MatCheckboxModule} from '@angular/material'; | |
import {MatButtonModule} from '@angular/material'; |
View .gitignore
This file contains 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
# This is a template .gitignore file for git-managed WordPress projects. | |
# | |
# Fact: you don't want WordPress core files, or your server-specific | |
# configuration files etc., in your project's repository. You just don't. | |
# | |
# Solution: stick this file up your repository root (which it assumes is | |
# also the WordPress root directory) and add exceptions for any plugins, | |
# themes, and other directories that should be under version control. | |
# | |
# See the comments below for more info on how to add exceptions for your |
View class-wc-check-availability-email.php
This file contains 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 | |
/** | |
* An email to ask the vendor to check availability of a booking. | |
* | |
* @extends \WC_Email | |
* | |
* Code copied from: https://www.skyverge.com/blog/how-to-add-a-custom-woocommerce-email/ | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
View gist:b2446c7d60d2ab636d0f70aee38e4f2d
This file contains 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
sudo chmod 777 -R /opt/lampp/htdocs |
View PhpFireBaseNotificationSample.php
This file contains 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 | |
#API access key from Google API's Console | |
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' ); | |
$registrationIds = $_GET['id']; | |
#prep the bundle | |
$msg = array | |
( | |
'body' => 'Body Of Notification', |
View WCVendors-Get-Vendor-Bookable-Products
This file contains 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
//WP Query to get all bookable products of a vendor | |
$args = array( | |
'post_type' => 'product', | |
'author' => $vendor, | |
'meta_query' => array( | |
array( | |
'key' => '_wc_booking_availability', | |
'compare' => 'EXISTS', | |
), |
View wc-bookings-availability-search.php
This file contains 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 | |
/** | |
* WooCommerce Bookings Availability Search | |
* | |
* This is almost pseudo code, it only serves to explain the "how to do it" and does not attempt to be "The Way" to do it. | |
* NOTE: This NEEDS to be refined in order to work as expected. | |
* | |
* @author António Pinto <apinto@vanguardly.com> | |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License | |
* |
View Woocommerce Bookings Dropdown
This file contains 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 | |
/* | |
Plugin Name: Woocommerce Bookings Dropdown | |
Description: Swaps the date picker for a dropdown of dates | |
Version: 1.0.0 | |
Author: Webby Scots | |
Author URI: http://webbyscots.com/ | |
*/ | |
$wswp_dates_built = false; | |
add_filter('booking_form_fields','wswp_booking_form_fields'); |
NewerOlder