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
/** | |
* Añade el campo NIF a la página de checkout de WooCommerce | |
*/ | |
add_action( 'woocommerce_before_checkout_billing_form', 'agrega_mi_campo_personalizado' ); | |
function agrega_mi_campo_personalizado( $checkout ) { | |
woocommerce_form_field( 'nif', array( | |
'type' => 'text', |
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
#include <SPI.h> | |
#include <WiFi101.h> | |
char ssid[] = "myNetwork"; // your network SSID (name) | |
char pass[] = "myPassword"; // your network password | |
int keyIndex = 0; // your network key Index number (needed only for WEP) | |
int status = WL_IDLE_STATUS; | |
const char server[] = "example.com"; // name address for Google (using DNS) |
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: Require Weight field (WooCommerce) | |
Plugin URI: https://charrua.es | |
Description: Make weight field required when adding/editing product. Usefull when using weight shipping. | |
Author: Daniel Pereyra Costas | |
Author URI: https://charrua.es | |
Version: 0.1 | |
*/ |
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 NIF | |
* Description: Adds NIF fields to WooCommerce | |
* Version: 1.0 | |
* Author: Daniel Pereyra Costas | |
* Author URI: https://charrua.es | |
* License: GPL v2 or later | |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html |
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
#!/bin/bash | |
TXTDEST="/home/<username>/mysqlbackup/dblist.txt" | |
BKPDEST="/home/<username>/mysqlbackup" | |
PLESK="/usr/sbin/plesk" | |
DATEYMD=`date +"%Y-%m-%d"` | |
# Create Lockfile | |
LOCKFILE=/tmp/myBkup.lock | |
if [ -f $LOCKFILE ]; then | |
echo "Lockfile $LOCKFILE exists, exiting!" |
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 | |
/** | |
* Restrict permission on WooCommerce REST API based on user_login and request type | |
* Let 'daniel' access ONLY to products data | |
*/ | |
add_filter( 'woocommerce_rest_check_permissions', 'charrua_allow_only_products', 10, 4 ); | |
function charrua_allow_only_products( $permission, $context, $object_id, $type ) { |
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 | |
/** | |
* Generate invoices only when company field (on WooCommerce checkout) is filled | |
* | |
* Plugin: WooCommerce PDF Invoices & Packing Slips | |
*/ | |
add_filter( 'wpo_wcpdf_document_is_allowed', 'wpo_wcpdf_only_allow_invoices_for_companies', 10, 2 ); | |
function wpo_wcpdf_only_allow_invoices_for_companies( $allowed, $document ) { | |
if ( $document->type == 'invoice' && !empty( $order = $document->order ) ) { |
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 | |
/** | |
* Disable loading gift card code on coupon field on cart/checkout | |
* | |
* Plugin: YITH WooCommerce Gift Cards (free version) | |
*/ | |
if ( ! function_exists( 'yith_ywgc_dont_allow_gift_cards_in_coupons' ) ) { | |
function yith_ywgc_dont_allow_gift_cards_in_coupons() { |
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 | |
/** | |
* Hide shipping rates when free shipping is available, but keep "Local pickup" | |
* Updated to support WooCommerce 2.6 Shipping Zones | |
*/ | |
function hide_shipping_when_free_is_available( $rates, $package ) { | |
$new_rates = array(); | |
foreach ( $rates as $rate_id => $rate ) { |
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 | |
//https://github.com/woocommerce/woocommerce/wiki/Product-CSV-Importer-&-Exporter | |
/** | |
* Process the data read from the CSV file | |
* If the field yikes_woo_products_tabs exists as a meta field, read it and decode the JSON. Then WooCommerce will insert it as serialized data to DB. | |
* This just saves the decoded JSON in meta data, but you can do anything you want here with the data. | |
* | |
* @param WC_Product $object - Product being imported or updated. |
OlderNewer