• Hi there!

    I’m trying to call the Questions and Answers tab title outside of the plugin. I found the section:

    /**
    		 * Add a tab for question & answer
    		 *
    		 * @param array $tabs tabs with description for product reviews
    		 *
    		 * @return mixed
    		 */
    		public function show_question_answer_tab( $tabs ) {
    			global $product;
    			
    			$tab_title = __ ( 'Questions & Answers', 'yith-woocommerce-questions-and-answers' );
    			
    			$product_id = yit_get_prop ( $product, 'id' );
    			if ( isset($product_id) ) {
    				$count = $this->get_questions_count ( $product_id);
    				
    				if ( $count ) {
    					$tab_title .= sprintf ( " (%d)", $count );
    				}
    			}
    			
    			if ( ! isset( $tabs["questions"] ) ) {
    				$tabs["questions"] = array(
    					'title'    => $tab_title,
    					'priority' => 99,
    					'callback' => array( $this, 'show_question_answer_template' )
    				);
    			}
    			
    			return $tabs;
    		}

    but how do I call just the title elsewhere? Any help would be great!

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi,
    the code above adds a new page to the tab in the single product page, what are you trying to do?

    Thread Starter amishdirect

    (@amishdirect)

    I’m trying to call the tab title “Questions & Answers” or “Questions & Answers (2)” if there are answers on a different portion of the page. We have a sticky header which is where our tabs section is. I’d like to have the title also next to the review area near the product title. I’m just not sure which portion creates the title so I can just re-add it elsewhere.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Call Questions and Answers Title outside of Tab’ is closed to new replies.