Author: Dave

  • The Perfect ISPConfig Ubuntu 18.04 Server

    The Perfect ISPConfig Ubuntu 18.04 Server

    ISPConfig on Ubuntu 18.04

    Ubuntu 18.04 with Apache, BIND, Dovecot, PureFTPD and ISPConfig

    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, BIND or MyDNS nameserver, PureFTPd, SpamAssassin, ClamAV, and many more. This setup covers Apache (instead of nginx), BIND, and Dovecot. I have changed a fair bit of the original tutorial, even the one they have up there now for 18.04 isn’t complete, which is where this one came from … I thought if I was going to have to correct a lot of their instructions, I may as well publish them here on my own tools for when I need them again. The fact it helps the rest of you that view it, double bonus. (I also like to have everything available on one page when I am working through stuff, so I have also removed the annoying pagination.)

    (more…)
  • 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.

    (more…)

  • 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.

    (more…)

  • 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 the criteria of the coupon are met.

    (more…)

  • 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 to extend the coupon system proved time consuming.

    (more…)

  • 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 ] : ”;
    update_post_meta($post_id, $field, $value);
    }
    }
    add_filter( ‘woocommerce_process_shop_coupon_meta’, ‘webdav_newcoupon_save_data’, 10, 1 );
    [/php]

  • 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’, ‘webdav_get_product_search_form’, 10, 1);
    ?>[/php]