Dieser Shortcode generiert eine Schaltfläche, klicken Sie auf Popup anzeigen mit Seiten-Iframe im Inneren.
- popup_page_link: Link zur Seite, Vorlage "WOOT Leere Seite"sollte ausgewählt werden
- button_text: Linktext, zum Beispiel: 'Nachricht an den Produktmanager senden'
- popup_title: Popup-Titel
- css_class: CSS-Klasse des Links
- help_title: Text des Links in der Popup-Kopfzeile von rechts
- help_link: Link im Popup-Header
Demoseite: https://demo.products-tables.com/product/single-product-example/
Demo-Shortcode: https://demo.products-tables.com/woot_popup_iframe_button/
lesen Sie auch: So fügen Sie Shortcodes in die einzelne Produktseite ein
Der Code als Beispiel für Entwickler:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | //file functions.php - creating column for table 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:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture", ' . 'title:"Ask manager about the product",help_title:"READ about iframe in popup",help_link:"https://products-tables.com/shortcode/woot_popup_iframe_button/"});void(0);', 'class' => 'woot-btn' ], 'Ask Me'); } ]; } return $profile; }, 10, 2); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 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', WOOT_ASSETS_LINK . 'js/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 = 'Send message to the product manager'; 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:\"{$popup_header_text}\", style:\"height: 100vh\"});void(0);", 'class' => $css_class ], $button_text); }); |
