Add Store Name instead of Display Name

Theme and Plugin Support

Add Store Name instead of Display Name Resolved

Tagged: 

Viewing 5 reply threads
  • Author
    Posts
    • #78533
      Simon Davies
      Participant

      Hi there
      I have been using the code below in the content-product.php template to successfully add the Vendors “Display Name” underneath the product title on my shop page. However, I would like to display the “Store Name” rather than the users’ Display Name. Could you please tell me how to do this? I assume I need to replace the section “$vendor->user_data->display_name” with something else?

      Thank you
      Simon

      global $WCMp, $product; /* Tzvook 4 back-to-store link */
      $vendor = get_wcmp_product_vendors( $product->id );
      if( $vendor ) {
      $term_vendor = wp_get_post_terms( $product->id, ‘dc_vendor_shop’ );
      $html .= ‘<div>permalink . ‘”>» back to store: ‘ . $vendor->user_data->display_name . ‘</div>’;
      echo $html;

    • #78534
      Simon Davies
      Participant

      Actually this is the exact code I have been using to date..

      global $WCMp, $product; /* Vendor name under product title */
      $vendor = get_wcmp_product_vendors( $product->id );
      if( $vendor ) {
      $term_vendor = wp_get_post_terms( $product->id, ‘dc_vendor_shop’ );
      $html .= ‘<div class=”vendor-sub-title”><p>by ‘ . $vendor->user_data->display_name . ‘</p></div>’;
      echo $html;

    • #78551
      sumit singh
      Moderator

      Hi, you can get vendor’s store name using following code
      $store_name = get_user_meta($vendor->user_data->ID, '_vendor_page_title', true );

    • #78562
      Simon Davies
      Participant

      Thank you.

      I still can’t seem to get this to work. How would I use this code within the structure above, to print the store name in the div?

      Thanks
      Simon

    • #78656
      Simon Davies
      Participant

      I have found a workaround. Thank you

    • #78680
      susmita
      Moderator

      @Simon Davies,

      Great to know that.
      We are closing this thread.
      Kindly open a new thread if you face any further query.

Viewing 5 reply threads

The topic ‘Add Store Name instead of Display Name’ is closed to new replies.