WooCommerce: VAT on grouped products

code update: add_action( ‘woocommerce_grouped_product_list_before_price’, ‘woocommerce_grouped_product_tax_on_single’, 10, 1, $child_product, $mode ); function woocommerce_grouped_product_tax_on_single( $child_product, $mode = null ) { //uncomment next line and choose one of the output options from »switch case “{OPTION}”« //$mode=”tax-name-rate-amount”; $_taxobj = new WC_Tax(); $obj = $_taxobj->get_shop_base_rate($child_product->get_tax_class()); $i_or_e = get_option(‘woocommerce_prices_include_tax’) == ‘no’ ? ‘excl.’ : ‘incl.’; ?> <td class=”grp_tax”> <?php foreach ( … Read more

Can plugin variables cause conflict?

They can. Say you have plugin one, with only this: // Plugin one $variable = “henk”; And then you have plugin two, with only this: // Plugin two echo $variable; And now you activate these plugins, you will probably see the variable of plugin one echo’d by plugin two (at least it did here, but … Read more

How do I change the default WordPress e-mail ID for sent e-mail?

Add the following to your functions.php: add_filter(‘wp_mail_from’, ‘new_mail_from’); add_filter(‘wp_mail_from_name’, ‘new_mail_from_name’); function new_mail_from($old) { return ‘your email address’; } function new_mail_from_name($old) { return ‘your name or your website’; }

How to add a privacy-checkbox in comment-template?

You can use the provided filters to do all that: //add your checkbox after the comment field add_filter( ‘comment_form_field_comment’, ‘my_comment_form_field_comment’ ); function my_comment_form_field_comment( $comment_field ) { return $comment_field.'<input type=”checkbox” name=”privacy” value=”privacy-key” class=”privacyBox” aria-req=”true”><p class=”pprivacy”>Hiermit akzeptiere ich die <a target=”blank” href=”http://wp.cloudstarter.de/?page_id=156″>Datenschutzbedingungen</a><p>’; } //javascript validation add_action(‘wp_footer’,’valdate_privacy_comment_javascript’); function valdate_privacy_comment_javascript(){ if (is_single() && comments_open()){ wp_enqueue_script(‘jquery’); ?> <script type=”text/javascript”> jQuery(document).ready(function($){ … Read more

How to check if WordPress is updating plugins?

Instead of re-ordering your plugins to load in a specific order, have each of them that requires some other plugin to be loaded to defer their initialization until the “plugins_loaded” action hook. In other words, when a plugin with a dependency is included and ran, it shouldn’t do anything directly. Instead, it should have functions, … Read more

Dropzone.js and wordpress plugin

I assume the issue is that your form targets an external file, where WordPress isn’t properly loaded to access the API. WordPress has a handler built in that you can use to process POST requests, via the admin_post action: Example form with hidden action field: <form action=”<?php echo admin_url( ‘admin-post.php’ ); ?>” method=”post”> <input type=”hidden” … Read more