This file contains hidden or 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.' |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
<snippet> | |
<!-- Wraps selected text in JSX style comment, e.g. {/* <Component /> */} --> | |
<!-- Save this to ~/Application Support/Sublime Text 3/Packages/User/ --> | |
<!-- You'll need to add a keybinding in Sublime Text > Preferences > Key Bindings --> | |
<!-- { | |
"keys": ["alt+command+j"], | |
"command": "insert_snippet", | |
"args": { "name": "Packages/User/jsx-wrap-comment.sublime-snippet" } | |
} --> | |
<content><![CDATA[ |
This file contains hidden or 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
<!-- Save to ~/Library/Application Support/Sublime Text 3/Packages/User/ --> | |
<!-- Example: if you have some liquid like: {{ settings.site_bg_col }}; in your .scss.liquid file, | |
select that (except for the closing ; and use the keybinding set below. --> | |
<!-- Output: #{" {{ settings.site_bg_col }} "}; --> | |
<snippet> | |
<content><![CDATA[ | |
#{" $SELECTION "} | |
]]></content> | |
<!-- this tab trigger won't really work when using $SELECTION --> |
This file contains hidden or 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 | |
// just a sample function to see what's going on | |
// not tied to a particular action yet | |
// we are on a user profile edit screen | |
add_action( 'wp', function() { | |
$form_id = 4; // GF user registration form | |
$choice_field_id = 13; // ACF 'time_slots' field | |
$choice_value = ''; // initializing the variable (otherwise PHP 7 freaks out) | |
$field_key = "field_5996299aee5a9"; // ACF 'time_slots' field |
This file contains hidden or 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_action("gform_after_submission_6", "update_usar_sponsorship_amount", 10, 2); | |
function update_usar_sponsorship_amount($entry, $form) { | |
// get required GF fields | |
$team = rgar( $entry, "14"); // GF radio buttons (select Team to sponsor) | |
$amount = rgar($entry, "2"); // donation amount | |
// query through users | |
$users = get_users(); |
NewerOlder