Woocommerce price in meta data

You can try the following filters available in Yoast WordPress SEO: apply_filters( ‘wpseo_twitter_metatag_key’, ‘name’ ); Source: wpseo_twitter_metatag_key apply_filters( ‘wpseo_og_’ . $og_property, $content ); Source: wpseo_og_’ . $og_property EDIT – Review after seeing the product URL Yoast SEO is not generating the Twitter/FB meta tags. Open Graph for Facebook, Google+ and Twitter Card Tags plugin is … Read more

WooCommerce related products load random posts per page

You need to change the value of $orderby. Maybe the current value of $orderby is rand ‘orderby’ => $orderby, Now you need to change the value of **orderby => ” ** according to your need. for example ‘orderby’ => ‘title’ ‘orderby’ => ‘menu_order title’ ‘orderby’ => ‘comment_count’ ‘orderby’ => ‘meta_value_num’ ‘orderby’ => ‘title menu_order’ Order … Read more

Replace “Add to cart” by a link to contact page on specific product

You can try this. I think it works fine. /*PUT THIS IN YOUR THEME FUNCTIONS FILE*/ /*STEP 1 – REMOVE ADD TO CART BUTTON ON PRODUCT ARCHIVE (SHOP) */ add_action(‘init’,’remove_loop_button’); function remove_loop_button(){ remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 10 ); } /*STEP 2 -ADD NEW BUTTON THAT LINKS TO PRODUCT PAGE FOR EACH PRODUCT */ add_action(‘woocommerce_after_shop_loop_item’,’replace_add_to_cart’); function replace_add_to_cart() … Read more

login or register then access woocommerce website

You can use “template_redirect” action to check if the current user is logged in or not then redirect the user to my-account page if not. add_action( ‘template_redirect’, function() { $url_parts = array_filter( explode( “https://wordpress.stackexchange.com/”, $_SERVER[‘REQUEST_URI’] ), ‘strlen’ ); if ( ! is_user_logged_in() && ( end( $url_parts ) != ‘my-account’ ) ) { wp_redirect( home_url( ‘/my-account’ … Read more