This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Body Class functions | |
// Adds more slugs to body class so we can style individual pages + posts. | |
// In your SCSS/CSS, use .page-yourslug {} to add styles for that page or post. | |
add_filter( 'body_class', 'plate_body_class' ); | |
function plate_body_class( $classes ) { | |
global $post; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add this to your functions.php file of the active theme | |
add_action( 'wpmdb_migration_complete', 'wpmdb_clear_wp_super_cache', 2, 20 ); | |
function wpmdb_clear_wp_super_cache() { | |
if (function_exists('wp_cache_clear_cache')) { | |
wp_cache_clear_cache(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script for CodeKit hook to append processed css from scss file to liquid file | |
# (make sure to use 'Compressed' for scss->css output so everything is on one line) | |
# | |
# To use: | |
# 1. create a `/styles` directory in your Shopify theme for your .scss files | |
# 2. name the .scss file the same name as the liquid file; e.g. sample.scss/sample.liquid | |
# 3. IMPORTANT: add empty `<style></style>` tags to first line of liquid file; add empty line below | |
# 4. add this script to your project in CodeKit in Hooks | |
# 5. profit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* GC */ | |
let gcDataArray = [] | |
let gcCachedData = JSON.parse(localStorage.getItem('ma_pgc')) | |
// when customer adds physical gift card(s) to the cart | |
$('body').on('click', '.add-to-cart-physical', function () { | |
let notes = '' | |
console.log('atc pgc clicked') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gform_pre_render_2', 'populate_posts' ); | |
add_filter( 'gform_pre_validation_2', 'populate_posts' ); | |
add_filter( 'gform_pre_submission_filter_2', 'populate_posts' ); | |
add_filter( 'gform_admin_pre_render_2', 'populate_posts' ); | |
function populate_posts( $form ) { | |
foreach ( $form['fields'] as &$field ) { | |
if ( strpos( $field->cssClass, 'populate-posts' ) === false ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleAddToCart = (e) => { | |
e.preventDefault() | |
if ( | |
productOptions.embroidery === true && | |
productOptions.embroiderySubmitted === false | |
) { | |
setEmbroideryError(true) | |
alert( | |
'Please select all required embroidery options and submit before adding to your cart.' |
OlderNewer