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
| function cart_notice() { | |
| $free_shipping_settings = get_option( 'woocommerce_free_shipping_settings' ); | |
| $maximum = $free_shipping_settings['min_amount']; | |
| $current = WC()->cart->subtotal; | |
| if ( $current < $maximum ) { | |
| echo '<div class="woocommerce-message">Get free shipping if you order $ ' . ($maximum - $current) . ' more!</div>'; | |
| } | |
| } | |
| add_action( 'woocommerce_before_cart', 'cart_notice' ); |
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
| /* Twitter API 1.1 tweets / favorites (likes) / following / followers backup in web browser | |
| * Get your access keys to use Twitter API 1.1: https://dev.twitter.com/docs/auth/tokens-devtwittercom | |
| * You can change Twitter API URL and Twitter screen_name, then execute script from a trusted web page without CSP protection like about:blank in a web browser console (F12 or Ctrl+Shift+K shortcut) | |
| * A textarea will appear so you can copy/paste to save data as a CSV file or search tweets / users in your web browser (Ctrl+F shortcut) | |
| * You can then view your backup in a spreadsheet editor like LibreOffice Calc | |
| * You can also compare the backup with another one to see who unfollowed you, who changed their Twitter username by looking at the user ID or which tweet you retweeted / favorited was deleted (e.g. with the Linux diff command) | |
| * | |
| * Note about the tweets backup: | |
| * Usually you will search tweets that you retweeted using Twitter web version (https://twitter.com/search) with a search like "from:your_username f |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>Home</title> | |
| <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.min.css"> | |
| <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/metisMenu/1.1.3/metisMenu.min.css"> | |
| </head> |
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
| import twitter # python-twitter | |
| import csv | |
| import cStringIO | |
| import codecs | |
| from requests_oauthlib import OAuth1Session | |
| REQUEST_TOKEN_URL = 'https://api.twitter.com/oauth/request_token' | |
| ACCESS_TOKEN_URL = 'https://api.twitter.com/oauth/access_token' | |
| AUTHORIZATION_URL = 'https://api.twitter.com/oauth/authorize' | |
| SIGNIN_URL = 'https://api.twitter.com/oauth/authenticate' |
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 | |
| class iCal | |
| { | |
| /** | |
| * @var string | |
| */ | |
| public $title; |
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 | |
| require_once 'database_connector.php'; | |
| class TableCheckCreateInsert{ | |
| /* | |
| * @var $conn | |
| * @var $databse | |
| * @var $config |
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
| (function(m){ | |
| /* | |
| * PHP => moment.js | |
| * | |
| * http://www.php.net/manual/en/function.date.php | |
| * http://momentjs.com/docs/#/displaying/format/ | |
| */ | |
| var formatMap = { | |
| d: 'DD', | |
| D: 'ddd', |
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
| SELECT product.ID as product_id, product.post_title as product_name, replace(product.post_content, '"', "'") as product_content, product_sku.meta_value as product_sku, product_price.meta_value as product_price, product_weight.meta_value as product_weight | |
| FROM wp_posts as product | |
| LEFT JOIN wp_postmeta as product_sku ON product.ID = product_sku.post_ID | |
| LEFT JOIN wp_postmeta as product_price ON product.ID = product_price.post_ID | |
| LEFT JOIN wp_postmeta as product_weight ON product.ID = product_weight.post_ID | |
| WHERE (product.post_type = 'product' OR product.post_type = 'product_variation') AND product_sku.meta_key = '_sku' AND product_price.meta_key = '_price' AND product_weight.meta_key = '_weight' | |
| ORDER BY product_id ASC |
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 Remove Billing Fields for Free Virtual Products | |
| * Plugin URI: https://gist.github.com/BFTrick/7873168 | |
| * Description: Remove the billing address fields for free virtual orders | |
| * Author: Patrick Rauland | |
| * Author URI: http://patrickrauland.com/ | |
| * Version: 2.0 | |
| * | |
| * This program is free software: you can redistribute it and/or modify |