Skip to content

Instantly share code, notes, and snippets.

View Yogeshkad's full-sized avatar
🏠
Working from home

Yogesh Kadvekar Yogeshkad

🏠
Working from home
View GitHub Profile
@Yogeshkad
Yogeshkad / functions.php
Created May 12, 2021 18:28 — forked from tankbar/functions.php
Add 4 important product identifiers Brand, MPN, UPC, EAN, GTIN to simple and variabel products
<?php
/*
Woocommerce additional product identifier fields
Add 4 important product identifiers Brand, MPN, UPC, EAN, GTIN to simple and variabel products required for sales channels
*/
// Simple Product Hooks
// Display Fields
add_action( 'woocommerce_product_options_general_product_data', 'wpmr_custom_general_fields' );
@Yogeshkad
Yogeshkad / functions.php
Created May 12, 2021 18:24 — forked from tankbar/functions.php
WooCommerce - Add GTIN/EAN meta field for product and product variations
/**
* Adding Custom GTIN Meta Field
* Save meta data to DB
*/
// add GTIN input field
add_action('woocommerce_product_options_inventory_product_data','woocom_simple_product_gtin_field', 10, 1 );
function woocom_simple_product_gtin_field(){
global $woocommerce, $post;
$product = new WC_Product(get_the_ID());
echo '<div id="gtin_attr" class="options_group">';
@Yogeshkad
Yogeshkad / gist:8a36d17f66e8fa02beaaff74e5ead2d3
Created March 18, 2020 10:18 — forked from zaunaf/gist:6f234c5c93f0c95b120c
Extjs 3 - Barcode Reader Example
var barcodeWin = new Ext.Window({
title: 'Scan Barcode',
width: 220,
height: 110,
//minWidth: 300,
//minHeight: 200,
layout: 'fit',
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
@Yogeshkad
Yogeshkad / PhantomRunner.cs
Created May 10, 2017 17:54 — forked from DotNetNerd/PhantomRunner.cs
Grabbing a site in C# using phantomJS
class Program
{
static void Main(string[] args)
{
var grabby = new Grabby();
string output = grabby.Grab("http://www.dotnetnerd.dk/cv");
Console.WriteLine(output);
File.WriteAllText("c:\\test.html", output);
}
@Yogeshkad
Yogeshkad / csv-to-json.php
Created February 15, 2016 23:10 — forked from robflaherty/csv-to-json.php
Convert CSV to JSON
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed