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 | |
| /** | |
| * Disable Orderable ASAP settings for Local Pickup shipping method. | |
| */ | |
| add_action( 'orderable_location_object_init', function( $location ) { | |
| // Only run on the frontend/checkout and ensure WooCommerce is active. | |
| if ( is_admin() || ! function_exists( 'WC' ) || ! WC()->session ) { | |
| return; | |
| } | |
| if ( ! class_exists( 'Orderable_Services' ) ) { |
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 | |
| /** | |
| * Kadence theme - change icon colors in the admin | |
| */ | |
| function kadence_admin_change_icon_color() { | |
| ?> | |
| <style> | |
| svg { | |
| /* todo: replace black with the color of your choice */ | |
| --kadence-color: black !important; |
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 | |
| // Orderable - by default set the date field to "Select a date.." | |
| add_action( 'wp_footer', function() { | |
| ?> | |
| <script> | |
| (function() { | |
| let hasCleared = false; | |
| let observer = null; | |
| let userPickedDate = false; |
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 | |
| function orderable_set_minimum_selection() { | |
| ?> | |
| <script> | |
| /** | |
| * Orderable: Enforce Minimum Selections for Checkbox Addons | |
| * | |
| * Instructions: | |
| * 1. Update the 'minSelections' object below. | |
| * 2. Use the exact Title of your field as the key. |
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 Sales booster: Frequently bought together - link product images. | |
| */ | |
| // 1) AJAX: return permalink for a given product ID. | |
| add_action( 'wp_ajax_iconic_wsb_fbt_get_permalink', 'iconic_wsb_fbt_get_permalink' ); | |
| add_action( 'wp_ajax_nopriv_iconic_wsb_fbt_get_permalink', 'iconic_wsb_fbt_get_permalink' ); | |
| function iconic_wsb_fbt_get_permalink() { | |
| $product_id = isset( $_POST['product_id'] ) ? absint( $_POST['product_id'] ) : 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 | |
| /** | |
| * Prevent Flux Stepper from advancing to the next step if EU VAT number is invalid. | |
| */ | |
| add_filter( 'flux_checkout_check_for_inline_errors', 'flux_validate_eu_vat_number', 10, 1 ); | |
| function flux_validate_eu_vat_number( $messages ) { | |
| // Check if fields were sent in the AJAX request | |
| if ( ! isset( $_POST['fields'] ) || ! is_array( $_POST['fields'] ) ) { | |
| return $messages; | |
| } |
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 | |
| /** | |
| * Prevent Flux Stepper from advancing to the next step if EU VAT number is invalid. | |
| */ | |
| add_filter( 'flux_checkout_check_for_inline_errors', 'flux_validate_eu_vat_number', 10, 1 ); | |
| function flux_validate_eu_vat_number( $messages ) { | |
| // Check if fields were sent in the AJAX request | |
| if ( ! isset( $_POST['fields'] ) || ! is_array( $_POST['fields'] ) ) { | |
| return $messages; | |
| } |
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 Orderable time slot and date to a given order ID. | |
| * | |
| * @param int $order_id The WooCommerce Order ID. | |
| * @param string $date The Date (e.g., '2026-02-26'). | |
| * @param string $time The Time (e.g., '10:00 - 11:00' or '10:00'). | |
| * @param string $service_type The Service Type (e.g., 'delivery' or 'pickup'). Default 'delivery'. | |
| * @return bool True if successful, false otherwise. | |
| */ |
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 | |
| /** | |
| * Restrict Orderable service dates if a specific product is in the cart. | |
| * | |
| * @param array|bool $service_dates The currently available service dates. | |
| * @param string $type The service type ('delivery' or 'pickup'). | |
| * @param Orderable_Location_Single $location The location instance. | |
| * @return array|bool | |
| */ | |
| function orderable_restrict_service_dates( $service_dates, $type, $location ) { |
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 Product configurator - compatibility with Avada theme's swatches. | |
| */ | |
| add_action( 'wp_footer', function() { | |
| ?> | |
| <script> | |
| jQuery(document).ready(function($) { | |
| jQuery('.avada-color-select').click(function() { | |
| const siblings = jQuery(this).siblings('.avada-select-parent'); |
NewerOlder