This file contains 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 | |
use Automattic\WooCommerce\Admin\Features\ProductBlockEditor\ProductTemplates\GroupInterface; | |
add_filter( | |
'woocommerce_rest_prepare_product_object', | |
function ( $response, $post ) { | |
$custom_regular_prices_encoded = get_post_meta( $post->get_id(), '_custom_regular_prices', true ); | |
$custom_regular_prices = json_decode( |
This file contains 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
/** | |
* Restricts which products can be added to the cart at the same time. | |
* Version for WooCommerce 3.x and later. | |
* | |
* HOW TO USE THIS CODE | |
* 1. Add the code to the bottom of your theme's functions.php file (see https://www.skyverge.com/blog/add-custom-code-to-wordpress/). | |
* 2. Set the IDs of the products that are allowed to be added to the cart at the same time. | |
* 3. Amend the message displayed to customers when products are unavailable after the specified | |
* products have been added to the cart (see function woocommerce_get_price_html(), below). | |
* |
This file contains 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
/** | |
* Return a formated string from a date Object mimicking PHP's date() functionality | |
* | |
* format string "Y-m-d H:i:s" or similar PHP-style date format string | |
* date mixed Date Object, Datestring, or milliseconds | |
* | |
*/ | |
function date_format(format,date){ | |
if(!date || date === "") |
This file contains 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
// Step 1 - Keep track of cart contents | |
add_action('wp_loaded', function() { | |
// This variable must be global, we will need it later. If this code were | |
// packaged as a plugin, a property could be used instead | |
global $allowed_cart_items; | |
// We decided that products with ID 737 and 832 can go together. If any of them | |
// is in the cart, all other products cannot be added to it | |
$restricted_cart_items = array( | |
737, | |
832, |
This file contains 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 GestPay Starter | |
Plugin URI: http://wordpress.org/plugins/woocommerce-gestpay/ | |
Description: Estende WooCommerce fornendo il gateway di pagamento GestPay Starter di Banca Sella. | |
Version: 20150930 | |
Author: Mauro Mascia (baba_mmx) | |
Author URI: http://www.mauromascia.com | |
License: GPLv2 | |
Support: info@mauromascia.com |
This file contains 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 | |
/** | |
* Earnings / Sales Stats | |
* | |
* @package EDD | |
* @subpackage Classes/Stats | |
* @copyright Copyright (c) 2015, Pippin Williamson | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License | |
* @since 1.8 | |
*/ |
This file contains 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
// This code is no longer required as of WooCommerce 2.5 | |
/** | |
* Disables the product price cache. This function looks for the cache key | |
* that is about to be retrieved by WooCommerce, and deletes the cached data | |
* associated to it. | |
* | |
* IMPORTANT | |
* This function can have an impact on WooCommerce's performance, and it | |
* should not be used unless necessary. | |
* |
This file contains 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
/** | |
* Alters the key used to store cached prices. This code snippet allows | |
* to use dynamic cache keys, thus making it possible to store multiple | |
* sets of prices in the cache. | |
* You can add this code to the functions.php file in your child theme | |
* folder, or to a custom plugin. | |
* | |
* @param array cache_key_args The arguments that form the cache key. | |
* @param WC_Product product The product for which the key is being generated. | |
* @param bool display Indicates if the prices are being retrieved for display |
This file contains 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 | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly | |
} | |
/** | |
* Admin Report | |
* | |
* Extended by reports to show charts and stats in admin. |
This file contains 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 | |
/** | |
* @copyright Vanilla Forums Inc. | |
* @license GNU GPL2 | |
*/ | |
/** | |
* Instantiating this class will store current user's ID from cookie as $this->UserID. | |
* | |
* Usage |