Table of Contents

bact-flexpass-checkout

The BACT FlexPass Checkout plugin modifies the workflow for using coupons that are identified as being of the FlexPass type.

GitHub: https://github.com/ginkgostreet/bact_flexpass_checkout

Prerequisites

  1. Make Sure the “Flexpass” Taxonomy added in the coupon section
    • To add taxonomy to the coupon click Woo-commerce >Coupon Categories
  2. Please Make Sure before purchasing flexpass, check flexpass product is assigned with “CiviCRM Financial Type” to “Flex Passes”
  3. Please check the configuration of flexpass product properly for which event or all event date you need to apply flexpass
  4. Exclude Donation product from coupon code while adding flexpass coupon code product or manual coupon code creation.

Expected Behaviors

  1. If any user purchases the flexpass then the user get flex pass coupon code and in the admin panel the coupon is added with taxonomy flexpass
  2. While creating manual flexpass coupon please check for which event date you want to apply the coupon and set the discount amount or discount %age

Technical Notes

Frontend Section (Directory Name: frontend)

File Name: frontend/class-bact-flexpass-checkout-add-popup-form.php

add_filter( 'qsot-before-ticket-selection-form', array( $this, 'add_popup_form' ), 10 );

// Adding coupon Flex Pass popup form on checkout page.
add_action( 'woocommerce_before_checkout_form', array( $this, 'add_popup_form_checkout' ), 10 );

// Adding coupon Flex Pass popup form on cart page.
add_action( 'woocommerce_before_cart', array( $this, 'add_popup_form_checkout' ), 10 );

// Adding sold out label to product.
add_filter( 'woocommerce_sale_flash',  array( $this, 'lx_custom_onsale_label'), 10, 2 );