• Resolved iulianmaftei

    (@iulianmaftei)


    I try to add in Search results page a heading block with make model year but I don’t see any search query parameter in “Elementor dynamic tags” section. (e.g instead of Search results for “BMW 1-Series 2004-2014 to display only BMW 1-Series 2004-2014). Any idea on how can achieve this? Many thanks!

    Viewing 3 replies - 1 through 3 (of 3 total)
    • Thread Starter iulianmaftei

      (@iulianmaftei)

      To give a bit more context: I’m looking to Include the YMM search result inside a Text Block on Search Results Page (in a text editor/heading at the top of the page).

      For instance, if the customer searches for “BMW 1-Series 2004-2014”, I want this snippet above the returned product listings.

      Plugin Author Pektsekye

      (@pektsekye)

      Hello,

      It is possible to display the selected ymm values with shortcode.

      Try to add the line:

      
      add_shortcode( 'ymm_selected_values', array( $this, 'show_selected_values_by_shortcode' ) );
          
      

      after the line:

      
      add_shortcode( 'ymm_selector', array( $this, 'show_selector_by_shortcode' ) );
      

      And add the code:

      
      public function show_selected_values_by_shortcode($atts) {
        
          include_once($this->getPluginPath() . 'Block/Selector.php');
                
          $block = new Pektsekye_Ymm_Block_Selector();    
          $values = $block->getSelectedValues();
          
          return !empty($values) ? implode(' ', $values) : '';
        }
      

      before the line:

      
        private function is_request( $type ) {
      

      in the file:
      wp-content/plugins/ymm-search/ymm-search.php

      Then add shortcode:
      [ymm_selected_values]

      to the content of the search results page.

      Stanislav

      Thread Starter iulianmaftei

      (@iulianmaftei)

      @pektsekye Thank you very much! Works great!

    Viewing 3 replies - 1 through 3 (of 3 total)
    • The topic ‘Pass YMM to dynamic tags’ is closed to new replies.