Author: Dave

  • The Perfect ISPConfig Ubuntu 18.04 Server

    The Perfect ISPConfig Ubuntu 18.04 Server

    This tutorial shows how to prepare an Ubuntu 18.04 server (with Apache2, BIND, Dovecot) for the installation of ISPConfig, and how to install ISPConfig. The web hosting control panel ISPConfig allows you to configure the following services through a web browser: Apache or nginx web server, Postfix mail server, Courier or Dovecot IMAP/POP3 server, MySQL,…

  • HTML 5 Audio Tags are not all equal with Javascript and PHP

    HTML 5 Audio Tags are not all equal with Javascript and PHP

    Recently I was asked to create an audio proxy, whereby no files were contained within DOCROOT. Straight forward I thought, how hard can it be when all it requires is a range resume delivery system. Well, I was once again thwarted by the changes Apple make to their products without telling anyone.

  • WooCommerce >= 3.XX Gallery Lightbox Features

    For those of you who remember the little check box on the Woocommerce display settings page, well if you haven’t looked for a while, it is no longer there to make you feel warm and fluffy.

  • Custom Coupon Types in WooCommerce continued

    Further to creating a valid new coupon type, you may wish to extend some certain other functions along with it. A good example of this would be validity of the coupon. Sometimes you may wish to add a coupon that can be added at the beginning of the cart cycle but only applies itself once…

  • How to create Custom Coupon Types in WooCommerce

    Coupons are one of WooCommerce’s greatest assets; everyone loves a discount. However, the default types and restrictions may not be exactly what you’re looking for and you may need to extend the functionality. After being recently commissioned to extend the coupon functionality of a stable (all be it old), 2.3.11 installation, finding the right places to hook into…

  • woocommerce_process_shop_coupon_meta

    This is the filter that is responsible for saving your field data for the coupon. [php] function webdav_newcoupon_save_data( $post_id ) { $newcoupon_fields = array ( // Your fields should be listed here as an array of // strings. ); foreach ($newcoupon_fields as $field) { $value = isset($_POST[ $field ]) ? $_POST[ $field ] : ”;…

  • woocommerce_coupon_data_panels

    This is the contents of the options panel and where you will list all of your fields to display and how they will be displayed. [php] function webdav_newcoupon_data_panels() { global $woocommerce, $post; echo ‘<div id="webdav_newcoupon_data" class="panel woocommerce_options_panel">’; // Your coupon type options will go in here echo ‘</div>’; } add_action(‘woocommerce_coupon_data_panels’, ‘webdav_newcoupon_data_panels’); [/php]

  • woocommerce_coupon_data_tabs

    This is for creating a tab panel in the admin coupon screen when creating a new coupon. [php] function webdav_newcoupon_data_tabs( $tabs ) { $tabs[‘webdav_newcoupon_data’] = array( ‘label’  => __( ‘WebDav Coupon’, ‘webdav-coupon-plugin’ ), ‘target’ => ‘webdav_newcoupon_data’, ‘class’  => ‘webdav_newcoupon_data’ ); return $tabs; } add_filter( ‘woocommerce_coupon_data_tabs’, ‘webdav_newcoupon_data_tabs’, 100, 1 ); [/php]  

  • woocommerce_coupon_discount_types

    Intercept the coupon types and do what you will, add or remove as you see fit. [php] <?php function webdav_newcoupon_type ($discount_types) { // Custom Code here return $discount_types; } add_filter (‘woocommerce_coupon_discount_types’, ‘webdav_newcoupon_type’, 10, 1); ?> [/php]

  • get_product_search_form

    The filter used for intercepting the default WooCommerce product search form. Assigning a new function to this filter allows the search form to be redesigned to specific requirements [php]<?php function webdav_get_product_search_form () { // Insert custom code here $output = ”; // function should return html code in a string return $output; } add_filter (‘get_product_search_form’,…