VVWC Global Helpers

/** * VVWC Helper Functions */ // Elementor safety post injection (used during cron) function vvwc_inject_dummy_post_context() { if ( defined( ‘DOING_CRON’ ) && DOING_CRON ) { global $post; if ( ! isset( $post ) || ! $post instanceof WP_Post )…Continue reading

Enable quantity field on shop page

// Remove the default add to cart button remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 10 ); // Add custom add to cart form for both simple and variable products add_action( ‘woocommerce_after_shop_loop_item’, ‘custom_add_to_cart_form_on_shop_page’, 10 ); function custom_add_to_cart_form_on_shop_page() { global $product; if ( $product->is_type( ‘simple’…Continue reading

defer-om-embed-wordpress.php

function your_prefix_om_defer_script( $campaign_embed ) { $campaign_embed = str_replace( ‘s.async=true;’, ‘s.defer=true;’, $campaign_embed ); return $campaign_embed; }; add_filter( ‘optin_monster_campaign_embed_output’, ‘your_prefix_om_defer_script’ ); add_filter( ‘optin_monster_embed_script_tag’, ‘your_prefix_om_defer_script’ );Continue reading