Where do I find the functions triggered within a hook?

Looking at the current version of Storefront’s header.php: /** * Functions hooked into storefront_header action * * @hooked storefront_skip_links – 0 * @hooked storefront_social_icons – 10 * @hooked storefront_site_branding – 20 * @hooked storefront_secondary_navigation – 30 * @hooked storefront_product_search – 40 * @hooked storefront_primary_navigation_wrapper – 42 * @hooked storefront_primary_navigation – 50 * @hooked storefront_header_cart – … Read more

Limit users to one active subscription in WooCommerce Subscriptions? [closed]

Unless I’m misunderstanding you, WC Subscriptions already has this functionality. Firstly, set your subscription product to be variable or grouped, rather than having multiple individual products. Set the subscription product to limit purchasing: https://docs.woocommerce.com/document/subscriptions/store-manager-guide/#limit-subscription Then turn on allow switching: https://docs.woocommerce.com/document/subscriptions/switching-guide/#section-2 Hope that helps

Display orders instead of woocommerce my account dashboard for logged in users [closed]

How to redirect a user to my-account/orders correctly Try this: add_action( ‘parse_request’, ‘redirect_to_my_account_orders’ ); function redirect_to_my_account_orders( $wp ) { // All other endpoints such as change-password will redirect to // my-account/orders $allowed_endpoints = [ ‘orders’, ‘edit-account’, ‘customer-logout’ ]; if ( is_user_logged_in() && preg_match( ‘%^my\-account(?:/([^/]+)|)/?$%’, $wp->request, $m ) && ( empty( $m[1] ) || ! in_array( … Read more

How do I display certain products via their category on a section of a page using PHP?

you can still use a shortcode inside of php if you aren’t customizing the output. see https://docs.woocommerce.com/document/woocommerce-shortcodes/#scenario-5-specific-categories and https://developer.wordpress.org/reference/functions/do_shortcode/ <?php echo do_shortcode(‘[products category=”new-arrivals”]’); ?> Alternatively, If you need to customize the output of the products then just use wc_get_products to get a list of products and iterate through it. See https://github.com/woocommerce/woocommerce/wiki/wc_get_products-and-WC_Product_Query <?php $args = array( … Read more

How to get rid of the hover zoom in WooCommerce single products

This is possible using woocommerce_single_product_zoom_enabled dedicated filter hook: add_filter( ‘woocommerce_single_product_zoom_enabled’, ‘__return_false’ ); Code goes in functions.php file of your active child theme (or active theme). Tested and work. It is possible using woocommerce_single_product_zoom_enabled dedicated filter hook. The hook undocumented available parameters in the options array are: $zoom_options = array ( ‘url’ => false, ‘callback’ => … Read more

Save Custom Fields for Variations Product

Okay, based on answers on link above (where I got the old code and there are people that help to answered), I put the modification code for my website. I tried it and it’s working like charm. Change: add_action( ‘woocommerce_product_after_variable_attributes’, ‘variable_fields’, 10, 2 ); Into : add_action( ‘woocommerce_variation_options’, ‘variable_fields’, 10, 3 ); And change : … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)