Target WooCommerce Product Gallery Image (rather than Featured Image) for og:image

You will need to use the methods on one of the WooCommerce product object for example: function insert_fb_in_head() { global $post; if ( !is_singular()) //if it is not a post or a page return; echo ‘<meta property=”og:title” content=”‘ . get_the_title() . ‘”/>’; echo ‘<meta property=”og:type” content=”article”/>’; echo ‘<meta property=”og:url” content=”‘ . get_permalink() . ‘”/>’; echo … Read more

paypal not showing on woocommerce payments

Paypal standard is now hidden for new installs, possible to read about it in https://developer.woocommerce.com/2021/07/12/developer-advisory-paypal-standard-will-be-hidden-on-new-installs/ for those who want to use it copy paste this code on functions.php add_filter( ‘woocommerce_should_load_paypal_standard’, ‘__return_true’ ); Since july 2021 woocommerce recommends users to use the recommended PayPal extension instead

Remove action added through function

Found the answer here: http://code.tutsplus.com/tutorials/a-guide-to-overriding-parent-theme-functions-in-your-child-theme–cms-22623 <?php function child_remove_parent_function() { remove_action( ‘woocommerce_before_main_content’, ‘mod_output_content_wrapper’, 10 ); } add_action( ‘wp_loaded’, ‘child_remove_parent_function’ ); ?> Explanation is in the link.

WooCommerce shipping – Different product different shipping? [closed]

Create shipping classes for each of your product variations which require one. On your product page, add the attributes for the product, then add the variations, based on the added attributes. Once loaded, you may select the individual product variations to modify price, size, weight, inventory, and shipping class for each specific product variation. To … Read more

How do you add custom metadata to WooCommerce orders? Specifically a second external order ID

you can use woocommerce_checkout_update_order_meta hook to update order meta. Please check sample code add_action(‘woocommerce_checkout_update_order_meta’, ‘custom_checkout_field_update_order_meta’); function custom_checkout_field_update_order_meta($order_id) { session_start(); if ($_SESSION[‘mapics_order’]) update_post_meta($order_id, ‘mapics_order’, esc_attr(htmlspecialchars($_SESSION[‘mapics_order’]))); }