Skip to content

Instantly share code, notes, and snippets.

View zarankumar's full-sized avatar

sarankumar zarankumar

View GitHub Profile
zarankumar / gist:0072e03437728849186816c576f83f8b
Created August 18, 2022 12:52
enable pre order for zero orders
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 );
zarankumar / checkout-long-lat
Created December 29, 2020 05:35
Get long/lat in checkout page woocommerce
function sg_get_latlong($posted_data ){
parse_str($posted_data, $output);
// error_log(print_r($posted_data,true)) ;
zarankumar / all-angular-material-components-imports.txt
Created December 15, 2018 12:16 — forked from pimatco/all-angular-material-components-imports.txt
All Angular Material Components Imports from app.module.ts
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';
zarankumar / .gitignore
Created December 15, 2018 10:47
Wordpress default git ignore file sample
# 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
* An email to ask the vendor to check availability of a booking.
* @extends \WC_Email
* Code copied from:
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
sudo chmod 777 -R /opt/lampp/htdocs
zarankumar / PhpFireBaseNotificationSample.php
Created October 9, 2017 09:55 — forked from MohammadaliMirhamed/PhpFireBaseNotificationSample.php
Simple PHP FireBase (FCM) script showing how to send an Android push notification. Be sure to replace the SERVER_API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call The main Code For GCM is…
#API access key from Google API's Console
$registrationIds = $_GET['id'];
#prep the bundle
$msg = array
'body' => 'Body Of Notification',
//WP Query to get all bookable products of a vendor
$args = array(
'post_type' => 'product',
'author' => $vendor,
'meta_query' => array(
'key' => '_wc_booking_availability',
'compare' => 'EXISTS',
zarankumar / wc-bookings-availability-search.php
Created September 18, 2017 14:54 — forked from apintocr/wc-bookings-availability-search.php
WooCommerce Bookings Availability Search
* 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 <>
* @license GNU Public License
zarankumar / Woocommerce Bookings Dropdown
Created July 22, 2017 07:30 — forked from LiamBailey/Woocommerce Bookings Dropdown
Changes out the Woocommerce Bookings date picker fields for a nice dropdown showing only available dates
Plugin Name: Woocommerce Bookings Dropdown
Description: Swaps the date picker for a dropdown of dates
Version: 1.0.0
Author: Webby Scots
Author URI:
$wswp_dates_built = false;