SHARE
TWEET

Untitled

a guest Aug 19th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_action( 'woocommerce_before_main_content', 'shopping_location_text', 10 );
  2.     global $current_user;
  3.     get_currentuserinfo(); // wordpress global variable to fetch logged in user info
  4.     $userID = $current_user->ID; // logged in user's ID
  5.     $havemeta = get_user_meta($userID, 'location_select', true); // stores the value of logged in user's meta data for 'location_select'.
  6.     var_dump($havemeta);
  7.  
  8.         function shopping_location_text() {
  9.           if( is_shop() ) {
  10.             print '<p class="shopping-location-text">YOUR ARE CURRENTLY SHOPPING IN <span style="FONT-WEIGHT: 700;COLOR: #fa4516;">' . $havemeta . '</span></p>';
  11.           }
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top