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 | |
| // ========================================================================= | |
| // CHECK IF SPECIFIC CATEGORY IS IN THE CART | |
| // ========================================================================= | |
| function check_specific_category_in_cart() { | |
| // Set $cat_in_cart to false | |
| $cat_in_cart = false; | |
| // Loop through all products in the Cart | |
| foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { | |
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
| jQuery(document).ready(function () { | |
| jQuery(".checkout-date-picker").datepicker({ | |
| // Disable Weekends | |
| beforeShowDay: jQuery.datepicker.noWeekends, | |
| // Disable Previous Dates | |
| minDate: 0 | |
| }); | |
| }); |
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 | |
| // ========================================================================= | |
| // Changes the redirect URL for the Return To Shop button in the cart. | |
| // ========================================================================= | |
| function wc_empty_cart_redirect_url() { | |
| if( WC()->cart->is_empty() ) { | |
| return wc_get_page_permalink( 'shop' ); | |
| } else{ | |
| return $_SERVER['HTTP_REFERER']; |
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 // Don't copy the opening tag | |
| // ========================================================================= | |
| // SHORTEN THE TITLE | |
| // ========================================================================= | |
| function shortenTitle(){ | |
| $thetitle = get_the_title(); | |
| $getlength = strlen($thetitle); | |
| $thelength = 45; | |
| echo substr($thetitle, 0, $thelength); |
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 // Don't copy the opening php tag | |
| // ========================================================================= | |
| // SEPARATE PRODUCTS AND SUBCATEGORY ON ARCHIVE PAGES | |
| // ========================================================================= | |
| function display_product_subcategories( $args = array() ) { | |
| $parentid = get_queried_object_id(); | |
| $args = array( | |
| 'parent' => $parentid |
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
| { | |
| "name": "version-4", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "webpack.config.js", | |
| "scripts": { | |
| "test": "echo \"Error: no test specified\" && exit 1" | |
| }, | |
| "keywords": [], | |
| "author": "", |
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 path = require('path'); | |
| module.exports = { | |
| mode: process.env.NODE_ENV === 'production' ? 'production' : 'development', | |
| entry: [ | |
| __dirname + '/assets/js/app.js', | |
| __dirname + '/assets/sass/style.scss' | |
| ], | |
| output: { |
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 path = require('path'); | |
| module.exports = { | |
| entry: './src/index.js', | |
| output: { | |
| path: path.resolve(__dirname, 'build'), | |
| filename: 'bundle.js' | |
| }, | |
| mode: "development" | |
| } |
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
| // ========================================================================= | |
| // DISPLAY PRODUCT CATEGORY SUBTITLE | |
| // ========================================================================= | |
| function add_product_cat_subtitle(){ | |
| $term_id = get_queried_object()->term_id; | |
| $post_id = 'product_cat_'.$term_id; | |
| $subtitle = get_field('alcim', $post_id); // | |
| echo $subtitle; |
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 addGoogleMapsKey($api) { | |
| $api['key'] = 'your_api_key'; | |
| return $api; | |
| } | |
| add_filter('acf/fields/google_map/api', 'addGoogleMapsKey'); |