add_action(‘woocommerce_before_single_product’, function () { global $post; if (!is_product()) return; $product = wc_get_product($post->ID); if (!$product) return; $tags = wp_get_post_terms($post->ID, ‘product_tag’, [‘fields’ => ‘names’]); $tag_string = !empty($tags) ? esc_attr(implode(‘, ‘, $tags)) : ”; echo ‘Continue reading
add_shortcode(‘product_features_boxes’, function () { if (!function_exists(‘wc_get_product’)) { return ”; } global $product; if (!$product || !is_a($product, ‘WC_Product’)) { $product = wc_get_product(get_the_ID()); } if (!$product) { return ”; } $attributes = $product->get_attributes(); if (empty($attributes)) { return ”; } $items = array();…Continue reading
/** * EA Elementor Hooks Fallback * * Prevents Essential Addons frontend scripts from breaking custom JS * when they reference window.elementor.hooks before Elementor has fully * initialized. * * Required for: * – Hero card scroll behavior * –…Continue reading
/** * Notification Panel Content Loader * * Loads the Elementor template with the slug: * notification-container * * This template contains the Notification Listing Grid and * is injected into a hidden container for the global * notification panel.…Continue reading
add_shortcode(‘site_notification_count’, function () { $today = current_time(‘timestamp’); $query = new WP_Query(array( ‘post_type’ => ‘notification’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘fields’ => ‘ids’, ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘notification_active’, ‘value’ => ‘show’, ‘compare’ => ‘=’ ),…Continue reading
‘options’ => array( ” => ‘Maak een keuze’, ‘Google’ => ‘Google’, ‘Via Marktplaats’ => ‘Via Marktplaats’, ‘ChatGPT’ => ‘ChatGPT’, ‘Facebook’ => ‘Facebook’, ‘Instagram’ => ‘Instagram’, ‘Via een vriend of kennis’ => ‘Via een vriend of kennis’, ‘Anders’ => ‘Anders’, ),Continue reading
add_action(‘wp_head’, function() { echo ‘‘ . “\n”; }, 1);Continue reading
add_action( ‘woocommerce_checkout_process’, function() { $coupon_code = ‘your_coupon_code’; $billing_phone = wc_clean( wp_unslash( $_POST[‘billing_phone’] ?? ” ) ); $billing_addr1 = strtolower( wc_clean( wp_unslash( $_POST[‘billing_address_1’] ?? ” ) ) ); if ( ! WC()->cart ) { return; } $applied = array_map( ‘wc_format_coupon_code’, WC()->cart->get_applied_coupons()…Continue reading
add_filter(‘vc_media_grid_build_query’, ‘auto_sort_all_vc_media_grids’, 999, 2); function auto_sort_all_vc_media_grids_v2($query_args, $grid_data) { // Работи само за Images режим с include if (!empty($query_args[‘include’]) && $query_args[‘post_type’] == ‘attachment’) { $ids = explode(‘,’, $query_args[‘include’]); // Взимаме ID-тата и ги сортираме по Title $sorted_ids = get_posts(array( ‘post__in’ =>…Continue reading
$guard = function( $add_products ) { if ( ! is_array( $add_products ) ) { return $add_products; } return array_values( array_filter( $add_products, function( $item ) { return ! empty( $item[‘product_id’] ) && wc_get_product( $item[‘product_id’] ) !== false; } ) ); };…Continue reading