WOOT - WooCommerce 活动产品表

[woot_popup_iframe_button]

此简码生成按钮,其中onclick显示带有页面iframe的弹出窗口。

  • popup_page_link:链接到页面,模板“WOOT空白页”应该被选中
  • button_text: 链接文本,例如: '发送消息给产品经理
  • popup_title:弹出标题
  • css_class:链接的CSS类
  • help_title:从右起的弹出标题上的链接文本
  • help_link:弹出标题中的链接

演示页面: https://demo.products-tables.com/product/single-product-example/

演示简码: https://demo.products-tables.com/woot_popup_iframe_button/

还读: 如何在单个产品页面中插入简码


该代码以开发人员为例:

//file functions.php - 为表创建列 add_action('woot_profile_extend', function($profile, $action_name) { if ($action_name === 'woot_woocommerce_tables') { $profile['ask_me'] = [ 'title' => 'Ask Me', 'order' => FALSE, 'action' => function($post_id) { return WOOT_HELPER::draw_html_item('a', [ 'href' => 'javascript: new Popup23({iframe: "https://demo.products-tables.com/wpform-contact-ask-me/?product_id='. $post_id .'", ' .'allow:"加速度计;自动播放;加密媒体;陀螺仪;画中画-图片", ' . 'title:"向经理询问产品",help_title:"在弹出窗口中阅读 iframe",help_link:"https://products-tables.com/shortcode/woot_popup_iframe_button/"});void(0); ', 'class' => 'woot-btn' ], 'Ask Me'); } ]; } return $profile; }, 10, 2);

 

add_shortcode('woot_popup_iframe_button', function($args) { wp_enqueue_script('woot-helper', WOOT_ASSETS_LINK .'js/helper.js', [], WOOT_VERSION, true); wp_enqueue_script('popup-23', js WOOT_LINKAS /popup-23.js', ['woot-helper'], WOOT_VERSION, true); wp_enqueue_style('woot-popup-23', WOOT_ASSETS_LINK .'css/popup-23.css', [], WOOT_VERSION); wp_enqueue_style ('woot-general', WOOT_ASSETS_LINK .'css/general.css', [], WOOT_VERSION); $popup_page_link = ''; if (isset($args['popup_page_link'])) { $popup_page_link = $args[' popup_page_link']; } $button_text = '给产品经理发消息'; if (isset($args['button_text'])) { $button_text = $args['button_text']; } $popup_header_text = ''; if (isset($args['popup_header_text'])) { $popup_header_text = $args['popup_header_text']; } $css_class = ''; if (isset($args['css_class'])) { $css_class = $args ['css_class']; } return WOOT_HELPER::draw_html_item('a', [ 'href' => "javascript: new Popup23({iframe:\"{$popup_page_link}\", title:\"{$po pup_header_text}\", style:\"height: 100vh\"});void(0);", 'class' => $css_class ], $button_text); });