• DONATE to NULLED!
    Вы можете помочь Форуму и команде, поддержать финансово.
    starwanderer - модератор этого раздела будет Вам благодарен!

Помощь Всплывающая форма обратной связи + Price Table

Alexeina66

Мой дом здесь!
Регистрация
26 Авг 2013
Сообщения
422
Реакции
439
Всем привет!

Необходима помощь в решении следующей проблемы.

Исходный данные - Wordpress 4.4.2, плагин price table, плагин contact form 7

В настройках плагина price table есть поле где можно привязать (вставить) ссылку к кнопке.
52f0613ab25d.png


Задача - сделать всплывающую форму обратной связи использую плагин contact form 7 либо любой другой и привязать к кнопке из Price table. Задача осложняется тем что все формы обратной связи будут разные по своим полям, и привязать код формы на прямую в файлах вряд ли получится.
 
1. Делаешь разные формы
2. каждой форме присваиваешь свой id
3. в ссылке указываешь этот id: "#contact_form_pop1", "#contact_form_pop2" ..... и т.д.
соотв. будет откр. та форма, по id которой кликнули.
 
Хорошо это понятно. А всплытие формы как будет происходить?
Методов есть много (точнее с разными fancybox-ами). Погугли "contact form 7 во всплывающем окне" и выбери тот, кот. понравится
Например - Для просмотра ссылки Войди или Зарегистрируйся
 
Либо я что-то не понимаю.
Скорее всего :)

В статьях все варианты либо вставка в шаблон страницы либо в статью.
1. Ссылку
Код:
#contact_form_pop
вставляешь в прайс
2.
Код:
<div style="display:none" class="fancybox-hidden">
    <div id="contact_form_pop">
        [ contact-form-7 id="420" title="Заказать звонок" ]
    </div>
</div>
Куда нибудь в код. Например в footer.

Ну и плаг. fancybox установить надо не забыть.
 
сайт на localhost


Не отрабатывает потому как price table вставляется в шаблон шорткодом.
Как внедрить шорткод внутри шорткода в данном случае?

PHP:
function cobian_vc_theme_pricetable($atts){
  extract(shortcode_atts(array(
  'section_id'  => '',   
  'css'  => '',
  'orderby'  => 'date',
  'order'  => 'DESC',
  'post_number'  => '4',
  'price_category'  => 'all',
  'heading'  => '',
  'subtitle'  => '',
  'sectioniconname' => ''
  ), $atts));
  global $post;
  $args = array( 'post_type' => 'price',
  'posts_per_page' => $post_number,
  'order' => $order,
  'orderby' => $orderby,
  'post_status' => 'publish'
  );
  if($price_category != 'all'){
  $str = $price_category;
  $arr = explode(',', $str);
  $args['tax_query'][] = array( 'taxonomy'  => 'price_category', 'field'  => 'slug', 'terms'  => $arr );
  }
  query_posts( $args );
  $out = '';
  $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ),  $atts );
  $id = ($section_id != '') ? 'id="'. esc_attr($section_id) . '"' : '';
  $out = '';
  $out .= '<!-- Start Pricing -->';
  $out .= '<section '.$id.' class="gray'. esc_attr($css_class) . '">';
  $out .= '<div class="container">';
  $out .= '<!-- Start Title -->';
  $out .= '<div class="row">';
  $out .= '<div class="col-md-10 col-md-offset-1 title-section">';
  $out .= '<h4 class="title"><span>'. esc_html($heading) . '</span>'. esc_html($subtitle) . '</h4>';
  $out .= '<div class="line"><i class="iconi '. esc_attr($sectioniconname) . '"></i></div>';
  $out .= '</div>';
  $out .= '</div>';
  $out .= '<!-- End Title -->';
  $out .= '<!-- Start Pricing -->';
  $out .= '<div class="row wrap-price">';
  if( have_posts() ) :
  $count = 0;       
  while ( have_posts() ) : the_post();
  $count++;
  $pricecategories  = get_post_meta( get_the_ID(), 'ninetheme_cobian_pricecategories', true );
  $packname  = get_post_meta( get_the_ID(), 'ninetheme_cobian_packname', true );   
  $currency  = get_post_meta( get_the_ID(), 'ninetheme_cobian_table_currency', true );
  $pricenumber1  = get_post_meta( get_the_ID(), 'ninetheme_cobian_price_firsttext', true );
  $pricenumber2  = get_post_meta( get_the_ID(), 'ninetheme_cobian_price_secondtext', true );
  $btn_link  = get_post_meta( get_the_ID(), 'ninetheme_cobian_btn_link', true );
  $btn_title  = get_post_meta( get_the_ID(), 'ninetheme_cobian_btn_title', true );
  $disablesecondtext  = get_post_meta( get_the_ID(), 'ninetheme_cobian_disablesecondtext', true );
  $tablefeatures  = get_post_meta( get_the_ID(), 'ninetheme_cobian_features_list', true );
  $current  = get_post_meta( get_the_ID(), 'ninetheme_cobian_features_list_current', true );
  $out .= '<div class="col-md-3">';
  $out .= ' <!-- Start Pricing Info -->';
  $out .= '<div class="table-price '. esc_html($pricecategories) . '">';
  $out .= '<div class="title-price">';
  $out .= '<h4>'. $packname . '</h4>';
  $out .= ' </div>';
  $out .= '<div class="price">';
$out .= '<h2>'. esc_html($pricenumber1) . '';if($disablesecondtext != '1') {$out .= '<small class="point">'. esc_html($pricenumber2) . '</small>';}
$out .= '<span> '. $currency . '</span></h2>';
$out .= '</div>';
  $out .= '<ul class="list-feature">';
  foreach ($tablefeatures as $listitem) {
  $out .= '<li>'.$listitem.'</li>';}
  $out .= '</ul>';
  $out .= '<div class="footer-price">';
  $out .= '<a href="'. esc_html($btn_link) . '" class="btn btn-'. esc_attr($pricecategories) . '">'. esc_html($btn_title) . '</a>';
  $out .= '</div>';
  $out .= ' </div>';
  $out .= '<!-- End Pricing Info -->';
  $out .= '</div>';
  endwhile;
  $out .= '</div>';
  $out .= '<!-- End Pricing -->';
  $out .= '</div>';
  $out .= '</section>';
  $out .= '<!-- End Pricing -->';
  $out .= '<div class="clearfix"></div>';
  endif; return $out;
}
add_shortcode('vc_price_table', 'cobian_vc_theme_pricetable');
 
Последнее редактирование:
Назад
Сверху