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( 'iconic_wlv_group_data', 'iconic_lv_add_custom_linked_variations', 10, 2 ); | |
| function iconic_lv_add_custom_linked_variations( $group_data, $product_id ) { | |
| // Todo1. Add the actual linked variation ID here | |
| $linked_variation_id = 93; | |
| if ( $group_data['group']->post->ID !== $linked_variation_id ) { | |
| return $group_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 | |
| // Iconic Linked variation: Custom snippet to mark products as in stock if they're not currently in stock | |
| add_action( 'woocommerce_single_product_summary', 'iconic_lv_add_force_instock_filter', 24 ); | |
| function iconic_lv_add_force_instock_filter() { | |
| add_filter( 'woocommerce_product_get_stock_status', 'iconic_lv_force_product_instock_filter', 10, 2 ); | |
| } | |
| function iconic_lv_force_product_instock_filter( $stock_status, $product ) { | |
| // Force the product to be in stock regardless of current status |
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 tasks = [ | |
| {id: 1, fav: false}, | |
| {id: 2, fav: true}, | |
| {id: 3, fav: true}, | |
| {id: 4, fav: false}, | |
| ]; | |
| tasks.reduce((p,c) => { | |
| return c.fav ? p++ : p; | |
| }, 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 | |
| /** | |
| * Iconic WDS: Disable timeslots for products in cart. | |
| */ | |
| function iconic_wds_disable_timeslots_for_products( $timeslots ) { | |
| // These timeslots will be disabled for the given product IDs. | |
| // How to get the timeslot ID: https://www.loom.com/share/96bd5674116e416e933eb932742adf7b | |
| // Todo - update this map with the actual timeslots and products. | |
| $disable_timeslots_product_map = array( | |
| // Example: timeslot_id => [product_id1, product_id2, ...] |
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 | |
| /** | |
| * Modify allowed days based on cart items. | |
| * | |
| * @param array $allowed_days | |
| * @param bool $minmax | |
| * * @return mixed | |
| */ | |
| function iconic_wds_modify_allowed_days( $allowed_days, $minmax ) { | |
| if ( $minmax ) { |
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 cart for given product id product. | |
| * | |
| * @param array $categories Categories. | |
| * | |
| * @return bool | |
| */ | |
| function iconic_check_for_cart_item_in_cart( $product_ids = array() ) { | |
| if ( empty( $product_ids ) || empty( WC()->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
| <?php | |
| /** | |
| * Flux checkout: Move position of shipping container to below the Shipping Adress. | |
| */ | |
| add_action( 'woocommerce_after_order_notes', function() { | |
| ?> | |
| <div class="flux-shipping-container--desktop"></div> | |
| <?php | |
| } ); |
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 | |
| /** | |
| * Modify Philippine Peso currency to display ₱ symbol instead of PHP text. | |
| * | |
| * @param array $currencies The current currencies registered in Gravity Forms. | |
| * @return array List of currencies with modified PHP currency. | |
| */ | |
| function modify_php_currency_symbol( $currencies ) { | |
| $currencies['PHP'] = array( | |
| 'name' => 'Philippine Peso', |
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 UAE Dirham (AED) currency to Gravity Forms. | |
| * | |
| * @param array $currencies The current currencies registered in Gravity Forms. | |
| * @return array List of supported currencies with AED added. | |
| */ | |
| function add_aed_currency_to_gf( $currencies ) { | |
| $currencies['AED'] = array( | |
| 'name' => 'United Arab Emirates Dirham', |
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 | |
| /** | |
| * Flux checkout - add custom fields. | |
| * | |
| * @param array $fields Checkout Fields. | |
| * | |
| * @return array. | |
| */ | |
| function flux_add_custom_field( $fields ) { | |
| $fields['billing']['billing_birthday'] = array( |
NewerOlder