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 | |
| pre_debug('import product variations'); | |
| $data = '[{"price":8.05,"sku":"334079-1","attributes":{"attribute_pa_qty":"","attribute_pa_colours":"","attribute_pa_print-type":""}}]'; | |
| $data = json_decode($data, true); | |
| $product_id = 2766; | |
| foreach( $data as $variation_data ) { |
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 | |
| pre_debug('import product variation attributes'); | |
| $data = '{"_product_attributes":{"pa_qty":{"name":"pa_qty","value":"","position":2,"is_visible":1,"is_variation":1,"is_taxonomy":1},"pa_capacity":{"name":"pa_capacity","value":"","position":3,"is_visible":1,"is_variation":1,"is_taxonomy":1},"usb-speed":{"name":"USB Speed","value":"2.0 Standard | 3.0","position":4,"is_visible":0,"is_variation":1,"is_taxonomy":0},"colour":{"name":"Colour","value":"Maple | Bamboo | Walnut | Redwood","position":5,"is_visible":0,"is_variation":1,"is_taxonomy":0},"pa_print-type":{"name":"pa_print-type","value":"","position":7,"is_visible":1,"is_variation":1,"is_taxonomy":1},"printable-area":{"name":"Printable Area","value":"30mm x 12mm","position":8,"is_visible":1,"is_variation":0,"is_taxonomy":0},"material":{"name":"Material","value":"Wood | Bamboo","position":9,"is_visible":1,"is_variation":0,"is_taxonomy":0},"pa_usb-extras":{"name":"pa_usb-extras","value":"","position":11,"is_visible":1,"is_variation":1,"is_taxonomy":1},"p |
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
| let current_scroll = 0; | |
| let delta_scroll = 0; | |
| let ease = 0.08; | |
| let container = document.querySelector('.container'); | |
| let detect_elements = []; | |
| function init(){ | |
| document.body.style.height = container.getBoundingClientRect().height + 'px'; |
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 canvas = document.getElementById('canvas_1'); | |
| const ctx = canvas.getContext('2d'); | |
| canvas.width = window.innerWidth; | |
| canvas.height = window.innerHeight; | |
| const config = { | |
| mouse_radius: 50, | |
| max_distance: 200, | |
| particle_size: 2, | |
| image_scale: 10, |
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
| // html | |
| <div class="item item-team" onclick="team_popup(this)"> | |
| <div class="e1 image"><div class="img-con"><img decoding="async" class="blazy" src="https://www.fivebyfive.com.au/wp-content/uploads/2016/01/jon@2x-640x640.webp" alt="" width="640" height="640"></div></div> | |
| <div class="e2 name">Jon Hollenberg</div> | |
| <div class="e3 position">Founder</div> | |
| <div class="description hide">With over 17 years experience within the web industry, Jon is an expert in online marketing and online growth strategies. Over the last eight years he has worked with over 500 Australian and international businesses, presented seminars and delivered hundreds of online projects. Jon’s design background coupled with his strong project management skills have made him successful in merging account management and leading a creative team. Jon has a Bachelor of Multimedia from Monash University. | |
| Jon is a keen surfer, enjoys distance running and working out in the gym.</div> | |
| </div> | |
| // js |
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
| <span class="custom_tab_nav active" onclick="custom_tab(this,'#talking_points')"><i class="icon-z-icomic"></i>Talking points</span> | |
| <span class="custom_tab_nav" onclick="custom_tab(this, '#ideal_audiences')"><i class="icon-z-icouser"></i>Ideal Audiences</span> | |
| <script> | |
| var custom_tab_nav = null; | |
| var custom_tab_content = null; | |
| function custom_tab(e, selector){ | |
| if( custom_tab_nav ) custom_tab_nav.classList.remove('active'); | |
| custom_tab_nav = e; | |
| custom_tab_nav.classList.add('active'); |
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_filter( 'woocommerce_package_rates', function( $rates, $package ){ | |
| $shipping_options_alias = [ | |
| 'free' => 'free_shipping:24', | |
| 'bulk' => 'free_shipping:23', | |
| 'local_pickup' => 'local_pickup:25', | |
| 'express' => 'flat_rate:22', | |
| ]; | |
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
| (function(){ | |
| document.addEventListener("DOMContentLoaded", function(){ | |
| var container = document.getElementById('sticky_buttons'); | |
| var callback = function(entries, observer) { | |
| var entry = entries[0]; | |
| if( !entry.isIntersecting ) { | |
| entry.target.classList.add('sticky'); | |
| } else { | |
| entry.target.classList.remove('sticky'); | |
| } |
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('wp_ajax_woocommerce_ajax_add_to_cart', 'woocommerce_ajax_add_to_cart'); | |
| add_action('wp_ajax_nopriv_woocommerce_ajax_add_to_cart', 'woocommerce_ajax_add_to_cart'); | |
| function woocommerce_ajax_add_to_cart() { | |
| $product_id = apply_filters('woocommerce_add_to_cart_product_id', absint($_POST['product_id'])); | |
| $quantity = empty($_POST['quantity']) ? 1 : wc_stock_amount($_POST['quantity']); | |
| $variation_id = absint($_POST['variation_id']); | |
| $passed_validation = apply_filters('woocommerce_add_to_cart_validation', true, $product_id, $quantity); | |
| $product_status = get_post_status($product_id); |
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
| var upload_files_complete = false; | |
| var form = $('form.checkout'); | |
| form.on( 'checkout_place_order', function() { | |
| if( !upload_files_complete ) { | |
| // uploading files... | |
| // loading indicator | |
| form.block({ message: null, overlayCSS: { background: '#fff', opacity: .6 } }) |