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'); |
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
| /** | |
| * Orderable Pro: Disable auto select date time. | |
| */ | |
| function orderable_pro_disable_auto_select_date_time() { | |
| ?> | |
| <script> | |
| jQuery(document).ready(function($) { | |
| wp.hooks.addFilter('orderable_pro_timing_disable_auto_select_date_time','snippets', function() { | |
| return true; | |
| }); |
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_wds_force_load_reservation_calendar_assets', '__return_true' ); | |
| /** | |
| * Trigger custom event when .ays-pb-modal becomes visible. | |
| */ | |
| add_action( 'wp_footer', function() { | |
| ?> | |
| <script type="text/javascript"> | |
| (function() { |
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 addons: shortcode to display the total price of the product with addons | |
| */ | |
| function orderable_addons_price_total() { | |
| global $product; | |
| $price = $product->get_price(); | |
| return sprintf('<div class="orderable-product__actions-price">%s</div>', wc_price($price)); | |
| } | |
| add_shortcode( 'orderable_addons_price_total', 'orderable_addons_price_total' ); |
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 - change Fees description to "Collection Fee" for local pickup. | |
| * | |
| * @param string $label Label. | |
| * | |
| * @return string | |
| */ | |
| function iconic_wds_update_fee( $label ) { | |
| if ( empty( $_POST['post_data'] ) ) { |
NewerOlder