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 'core-js/es6/array'; | |
import 'core-js/es6/object'; | |
import 'core-js/es6/string'; | |
// Global options | |
import defaults from './_config'; | |
// general helper functions | |
import Helper from './_helpers'; | |
// general pricing and currency functions | |
import Pricing from './_pricing'; | |
// throttle and debounce manager |
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
FROM php:7.2-fpm | |
COPY app /var/www/ | |
EXPOSE 9000 |
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
/// Display Excluding VAT for role bedrijf on single product page | |
function edit_price_display() { | |
global $product; | |
if(is_singular('product') && is_user_logged_in() && current_user_can( 'bedrijf' )) { | |
$price = $product->price; | |
$price_excl_tax = $price + round($price / ( 21 / 100 ), 2); | |
$price_excl_tax = number_format($price_excl_tax, 2, ",", "."); | |
$price = number_format($price, 2, ",", "."); | |
$display_price = '<span class="price">'; |
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 | |
/** | |
* == About this Gist == | |
* | |
* Code to add to wp-config.php to enhance information available for debugging. | |
* | |
* You would typically add this code below the database, language and salt settings | |
* | |
* Oh.. and *do* make sure you change the path to the log file to a proper file path on your server (make sure it exists). | |
* |
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
add_filter( 'alg_wc_pq_get_product_qty_min', 'my_product_qty_min_by_user_role', 10, 2 ); | |
function my_product_qty_min_by_user_role( $qty, $product_id ) { | |
$current_user = wp_get_current_user(); | |
return ( in_array( 'bedrijf', $current_user->roles ) ? 10 : $qty ); | |
} |
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: Gist oEmbed | |
Plugin URI: http://ninnypants.com | |
Description: Embed gists into posts | |
Version: 1.0 | |
Author: ninnypants | |
Author URI: http://ninnypants.com | |
License: GPL2 |
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
add_action( 'woocommerce_register_form', 'wc_extra_registation_fields' ); | |
function wc_extra_registation_fields() { | |
?> | |
<p class="form-row form-row-first"> | |
<label for="reg_role"><?php _e( 'Privat or commercial?', 'woocommerce' ); ?></label> | |
<select class="input-text" name="role" id="reg_role"> | |
<option <?php if ( ! empty( $_POST['role'] ) && $_POST['role'] == 'customer') esc_attr_e( 'selected' ); ?> value="customer">private</option> | |
<option <?php if ( ! empty( $_POST['role'] ) && $_POST['role'] == 'reseller') esc_attr_e( 'selected' ); ?> value="reseller">commercial</option> | |
</select> | |
</p> |
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 | |
if( function_exists('acf_add_local_field_group') ): | |
acf_add_local_field_group(array( | |
'key' => 'group_5e44e23f16db9', | |
'title' => 'Custom Registration', | |
'fields' => array( | |
array( | |
'key' => 'field_5e44e2456a4a9', | |
'label' => 'Particulier of Bedrijf', |
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: Custom Registration Fields | |
Plugin URI: | |
Description: | |
Version: 0.1 | |
Author: CSSIgniter | |
Author URI: | |
License: GPLv2 or later | |
License URI: http://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
/** | |
* Add tax exempt fields to checkout | |
**/ | |
add_action('woocommerce_before_order_notes', 'taxexempt_before_order_notes'); | |
function taxexempt_before_order_notes( $checkout ) { | |
woocommerce_form_field( 'tax_exempt_checkbox', array( | |
'type' => 'checkbox', | |
'class' => array('tiri taxexempt'),array( 'form-row-wide', 'address-field' ), |