Web

IP filtering in Google Analytics

Remember to Google search: What’s my IP address and copy the IP Address to place in GA. Click image to view settings:

Section 508 Compliance

This is a checker to make sure websites are Section 508 Compliant. https://www.powermapper.com/products/sortsite/checks/accessibility-checks/ The refresh in January of 2017 updated accessibility guidelines and requirements for information and communication technology (ICT) in the federal sector. It also updated guidelines for telecommunications and reorganized Section 508 and Section 255 guidelines to better align with and reflect recent […]

Force Uppercase on form submission input

To force the input to be uppercase, you add this code after the type=”text”… onkeyup=”this.value = this.value.toUpperCase();” An example of this would look like the code below.. <input class=”infusion-field-input” id=”inf_custom_KioskCode” name=”inf_custom_KioskCode” placeholder=”Kiosk Code *” type=”text” onkeyup=”this.value = this.value.toUpperCase();” />

User Meta Form Redirect

add_action( “user_meta_after_user_update”, “user_meta_after_user_update_function”, 10, 2 ); function user_meta_after_user_update_function( $response, $formName ){ global $userMeta; if ( $formName == “formname” ){ echo $userMeta->jsRedirect( “http://test.com” ); } }

Automated Coupon Codes in WooCommerce plus Coupon Validation

Sometimes we need to implement coupons that automatically apply themselves based on what’s in the cart, frequently as part of some sort of discount. Below is a snippet of commented code that I used to automatically apply a coupon based on two factors: A quantity of a specific product is in the cart The current […]

Smooth Scroll to Anchor Points when the Navbar covers the Anchor Point

Sometimes the scrolling to anchors is screwed up due to the sticky nav covering the content of the page. To fix this issue, we can apply some math to the ‘scrollTop’ value of an element. Here’s the script that does just that:   <script> //Adds this to the onload event listener window.addEventListener(‘load’, function(){ //Gets all […]

Manually Setting Discounts for Specific Products

Below is code that will set the price in a product’s description and the cart based upon cookies. It can, obviously, be changed to suit whatever is on sale. This can be placed into the functions.php file.   function getDiscountIndex(){ $discounts = array( array(‘cookie’ => ’24_sale’, ‘product_id’ => ‘15753’, ‘discount’ => 0.5), array(‘cookie’ => ’24_sale’, […]