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 | |
/* DO NOT ADD SAMPLE PRODUCT WITHIN DYNAMIC DISCOUNT RULES */ | |
add_filter( 'woocommerce_dynamic_pricing_process_product_discounts', 'exclude_sample_products', 10, 2 ); | |
function exclude_sample_products( $include, $product ) { | |
$products_to_exclude = array(); | |
foreach (WC()->cart->cart_contents as $cart_item_key => $cart_item){ | |
if ($cart_item['variation']['attribute_pa_buy-or-try'] == 'try-before-you-buy') { | |
$products_to_exclude[] = $cart_item['variation_id']; | |
} |
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 | |
$customer_orders = get_posts( array( | |
'numberposts' => -1, | |
'meta_key' => '_customer_user', | |
'meta_value' => get_current_user_id(), | |
'post_type' => wc_get_order_types(), | |
'post_status' => array_keys( wc_get_order_statuses() ), | |
) ); | |
$nonPurchaseable = array(); |
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 | |
function custom_add_validation_rules() { | |
if ( ! isset( WC()->cart ) ) { | |
return; | |
} | |
// Check if emails are ligitimate, if its not set add an error. | |
if ( isset($_POST['additional_field_644']) && ! is_email( $_POST['additional_field_644'] ) ){ | |
wc_add_notice( 'Email Address For Summaries is not a valid email address.', 'error' ); | |
} |
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: Pinit Only On Selected Media | |
* Plugin URI: http://www.rayflores.com/plugins/pinit-onlyon/ | |
* Version: 1.0 | |
* Author: Ray Flores | |
* Author URI: http://www.rayflores.com | |
* Description: Adds ability to select media attachments to be unpinned. | |
* Requires at least: 4.0 | |
* Tested up to: 4.1 |
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 | |
/** | |
* Theme: Flat Bootstrap | |
* | |
* Template Name: ACF Lathes | |
* | |
* This is the most generic template file in a WordPress theme | |
* and one of the two required files for a theme (the other being style.css). | |
* It is used to display a page when nothing more specific matches a query. | |
* E.g., it puts together the home page when no home.php file exists. |
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 Modify CSV output | |
* Plugin URI: http://rayflores.com/plugins/csv-modifier/ | |
* Description: Dan Colucci modifier | |
* Version: 1.0.1 | |
* Author: Ray Flores | |
* Author URI: http://rayflores.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 | |
function taxonomy_dropdowns_box( ) { | |
$brand_taxonomy = 'pa_marcas'; | |
$taxonomy_name = 'MARCAS'; | |
wp_nonce_field('custom-dropdown', 'dropdown-nonce'); | |
$terms = get_terms( $brand_taxonomy, 'hide_empty=0'); | |
foreach ($terms as $term) { | |
$all_terms[] = $term->term_id; |
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 | |
* Returns all the orders made by the user | |
* | |
* @param int $user_id | |
* @param string $status (completed|processing|canceled|on-hold etc) | |
* @return array of order ids | |
*/ | |
function get_all_user_orders($user_id,$status='completed'){ | |
if(!$user_id) | |
return false; |
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 | |
$args = array( | |
'post_type' => 'product', | |
'meta_key' => '_limited_dates_to', | |
'orderby' => 'meta_value', | |
'order' => 'DESC', | |
'meta_query' => array( | |
array( | |
'key' => '_limited', | |
'value' => 'yes', |
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 Modify CSV Exported file | |
* Description: Adds and removes desired and undesired fields respectively | |
* Version: 1.0.0 | |
* Author: Ray Flores | |
* Author URI: http://www.rayflores.com | |
* Requires at least: 3.9 | |
* Tested up to: 3.9 | |
* |