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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<script> | |
// Assign Google autocomplete to pob | |
$scope.autocompletePOB = function(input){ | |
console.log(input); | |
// This is a fix for Google Map Autocomplete unable to tap on result | |
$timeout(function() { | |
var predictionContainer = angular.element(document.getElementsByClassName('pac-container')); | |
predictionContainer.attr('data-tap-disabled', true); | |
predictionContainer.css('pointer-events', 'auto'); |
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
// Suggestion filter in Job listing page | |
function get_job_listing_taxonomy_on_ajax($query_args){ | |
// Get the array of the taxonomy of type job_listing_category | |
$taxonomy_array = $query_args['tax_query']; | |
if(is_array($taxonomy_array)){ | |
foreach ($taxonomy_array as $key => $ta) { | |
if($ta['taxonomy'] == 'job_listing_category' ){ | |
$cat_terms = $ta['terms']; |
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
public function showQuantityBasedPricing($price, $product) | |
{ | |
global $wp_query; | |
$product_id = self::getProductId($product); | |
if ($wp_query->queried_object_id != $product_id) { | |
$csp_prices = self::getQuantityBasedPricing($product_id); | |
//print_r($csp_prices); | |
if(sizeof($csp_prices)){ | |
// Fix zero price issue |
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
var formatedMysqlString = (new Date ((new Date((new Date(new Date())).toISOString() )).getTime() - ((new Date()).getTimezoneOffset()*60000))).toISOString().slice(0, 19).replace('T', ' '); | |
console.log( formatedMysqlString ); |
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 | |
//woocommerce-delivery-notes/includes/class-wcdn-print.php | |
public function get_order_invoice_number( $order_id ) { | |
// Custom random invoice no | |
$invoice_count = mt_rand(1,9999); | |
$invoice_prefix = mt_rand(1,9999); | |
$invoice_suffix = mt_rand(1,99999); |
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 | |
//Plugin Name:WooCommerce Print Invoice & Delivery Note | |
//File Path:woocommerce-delivery-notes/includes/class-wcdn-print.php | |
// Depended upon: https://github.com/sambhalgithub/woocommerce-sequential-order-numbers | |
/** | |
* Exit if accessed directly | |
*/ | |
if ( !defined( 'ABSPATH' ) ) { | |
exit; | |
} |
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
//eecom-multiple-products-add-to-cart\templates\js/eecom_mpatc.js | |
//Function to open loader | |
function open_loader() | |
{ | |
jQuery('.maskloader').show(); | |
} | |
//Function to close loader | |
function close_loader() | |
{ |
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
jQuery(($) => { | |
//Set quantity to 0 by default on product category page | |
if (location.href.match(/product-category/)) { | |
$('.input-text.qty.text').val(0); | |
} | |
//Hide the quantity dropdown | |
$('.quantity-cat').hide(); | |
//Event for value change of quantity and update the dropdown value | |
$('.input-text.qty').on("change paste keyup", function() { |
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
.qty.quantity-cat{ | |
display:none; | |
} | |
.button.wc-forward{ | |
display:inline-block; | |
} | |
.products .check { | |
display:none; | |
} |
OlderNewer