vendor name in h1

WCMp Core

Resolved
Viewing 11 reply threads
  • Author
    Posts
    • #121982
      l.gan
      Participant

      Hi, I am using a code to add the vendor name to the product page.
      ________
      function add_vendor_after_product_title(){
      global $post;
      if (‘Enable’ === get_wcmp_vendor_settings(‘sold_by_catalog’, ‘general’) && apply_filters(‘wcmp_sold_by_text_after_products_shop_page’, true, $post->ID)) {
      $vendor = get_wcmp_product_vendors($post->ID);
      if ($vendor) {
      $sold_by_text = apply_filters(‘wcmp_sold_by_text’, __(‘Sold By’, ‘dc-woocommerce-multi-vendor’), $post->ID);
      echo ‘permalink . ‘”>’ . $sold_by_text . ‘ ‘ . $vendor->page_title . ‘‘;
      }
      }
      }
      ___________

      Everything works fine, but how can you add the vendor name not on top of h1 (like in the picture), but inside the tag h1 (like in the picture with yellow)??

      Thank you

    • #121998

      HI,
      kindly share us the full code you are using in code block and please share the frontend image what do you actually want.

      Regards,

    • #122060
      l.gan
      Participant

      Hello to you! With the location of the visulano, everything is fine in the interface. The vendor name is above the product name.

      I mean, in the product card code, the product name is in H1, and the vendor name (which I display using the php code above) does not go there. The vendor name is above H1 and does not fall into it, and I have a question – is it possible to add (correct the php code that I have and which adds the vendor name above the product name) the vendor name inside H1?

      I’m sorry, I didn’t quite understand how I can show you the code, because I myself look through google chrome and f12

    • #122061
      l.gan
      Participant
      This reply has been marked as private.
    • #122062
      l.gan
      Participant
      This reply has been marked as private.
    • #122166
      This reply has been marked as private.
    • #122582
      l.gan
      Participant

      It turns out that I have this code, but how and where can I insert the php function, which is located above, so that the vendor name moves to h1? I just inserted this function there between h1 and nothing happened …
      this is my theme file
      Please help me

      if ( ! defined( ‘ABSPATH’ ) ) {
      exit; // Exit if accessed directly.
      }

      $is_quick_view = woodmart_loop_prop( ‘is_quick_view’ );

      ?>

      <h1 itemprop=”name” class=”product_title wd-entities-title”><?php if( $is_quick_view ): ?>“><?php endif; ?><?php echo get_the_title(); ?><?php if( $is_quick_view ): ?><?php endif; ?></h1>

    • #122648

      Hi,
      We are very sorry to say that this is quite impossible for us to give you instruction to add code by checking few of your theme code. And it is also not structural. If your theme gives an update then all changes will be removed. This will be so pathetic for you. And you can’t add this type of code to your theme file. You need to write code ( CSS/backend ) using hooks and filters.
      thanks

    • #122658
      l.gan
      Participant

      Hello, thanks for your reply and support,the developers of my theme helped me by examining the code that the support of your theme gave me the code and told me to insert it into the child theme (I wrote this code above).

      “You need to insert the code that was provided by the plugin support.
      This code:
      if ( ! defined( ‘ABSPATH’ ) ) {
      exit; // Exit if accessed directly.
      }
      $is_quick_view = woodmart_loop_prop( ‘is_quick_view’ );
      ?>
      <h1 itemprop=”name” class=”product_title wd-entities-title”><?php add_vendor_after_product_title(); ?><?php if( $is_quick_view ): ?>“><?php endif; ?><?php echo get_the_title(); ?><?php if( $is_quick_view ): ?><?php endif; ?></h1>

      but now my vendor name is displayed 2 times (looks at the photo). The code that you gave me earlier (it is above) is also in functions php. They only work together.

      How do I remove the top 2 output of the vendor name? which is generated by the code?

      Note: if I completely delete the code, the product page breaks. Maybe I need to remove some of the code from there? Please help me.

    • #122724

      Hi,
      We can only help you out by backend code. For basic code ( using hooks and filter ). Style and design managed by theme. We don’t have a single idea for your theme. A theme has a thousand numbers of code. Every code is related to each other.
      But what we understand from #post-122658 this post you have an issue to double vendor names and you want to delete one. Then just remove all your custom code. Menas revert back to the initial one. Then add your theme developer given code. You may have added the same code/ functions two times. That’s why this is happening.

    • #123528
      l.gan
      Participant

      thank you very much for your help, my issue has been resolved

    • #123539

      I hope you are satisfied with our assistance and plugin. A 5/5 review here- https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/reviews/#new-post , would be a great way to share your experience with others.

      This motivates us to continue providing the best experience possible and also helps others know how WC-Marketplace can make their life easier

Viewing 11 reply threads

The topic ‘vendor name in h1’ is closed to new replies.