add_action(‘woocommerce_subscription_renewal_payment_complete’, function($object) { $logger = wc_get_logger(); $log_context = array(‘source’ => ‘auto-complete-renewal’); // Handle subscription objects vs order IDs $order = null; if (is_a($object, ‘WC_Subscription’)) { $logger->info(“Received subscription {$object->get_id()}, fetching last renewal order”, $log_context); $order = $object->get_last_order( ‘renewal’ ); if (!$order)…Continue reading
add_filter(‘post_class’, function($classes, $class, $post_id) { if (get_post_type($post_id) !== ‘shop_order’) return $classes; $order = wc_get_order($post_id); $logger = wc_get_logger(); $context = [‘source’ => ‘order-row-highlighting’]; // — Subscriptions (parent or renewal) — if (function_exists(‘wcs_order_contains_subscription’) && wcs_order_contains_subscription($order, ‘any’)) { $classes[] = ‘order-subscription’; } //…Continue reading
add_action(‘init’, function() { if (!is_admin()) return; $order_id = 65588; // Replace this with the actual order ID $order = wc_get_order($order_id); if (!$order) { error_log(“Order $order_id not found.”); return; } $removed = []; foreach ($order->get_items(‘shipping’) as $item_id => $item) { $method_id…Continue reading
add_action(‘wp_enqueue_scripts’, function () { // This runs after the theme’s main script (theme-js) to override Owl Carousel config wp_add_inline_script(‘theme-js’, ” jQuery(window).on(‘load’, function () { var \$carousel = jQuery(‘.featured-products ul.products’); if (\$carousel.length && \$carousel.data(‘owl.carousel’)) { // Destroy the existing Owl instance…Continue reading
echo do_shortcode(‘[smartslider3 slider=”7″]’);Continue reading
echo do_shortcode(‘[smartslider3 slider=”6″]’);Continue reading
/** Adds script to header ** Scroll to top of page – only on Pager facet interaction ** For more info see: ** https://facetwp.com/help-center/facets/facet-types/pager/#how-to-add-pagination-scrolling **/ add_action( ‘wp_head’, function() { ?>Continue reading
add_filter( ‘rank_math/frontend/breadcrumb/items’, function( $crumbs, $class ) { //Adding to single products // change to match the post type name $value[] = array( ‘Shop’, // change to the actual name shown on the frontend ‘/shop/’, // change to the actual URL…Continue reading
class PIM_Metaboxes { public function __construct() { add_action( ‘admin_init’, array($this, ‘add_metaboxes’) ); add_action( ‘save_post’, array($this, ‘save_metabox_data’), 10 , 3 ); add_action( ‘admin_enqueue_scripts’, array($this, ‘category_enqueue_scripts’) ); add_action(‘pa_brand_add_form_fields’, array($this, ‘add_pa_brand_fields’), 10, 2 ); add_action(‘pa_brand_edit_form_fields’, array($this, ‘edit_pa_brand_fields’), 10, 2 ); // Voor pa_merk…Continue reading
/** * WPCode Snippet: Expose GravityView ACF Fields to REST API (MANUAL SYNC ONLY) * Description: Makes ALL GravityView data accessible ONLY when manually synced * Location: Run Everywhere * Priority: 15 */ defined( ‘ABSPATH’ ) || exit; /** *…Continue reading