Created
July 5, 2017 06:27
-
-
Save thinhbg59/83ace625279391d9f2feda5ceca8aae5 to your computer and use it in GitHub Desktop.
popup form woocommerce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ot_popup_form() | |
{ | |
if (is_singular('product')): | |
?> | |
<div id="dathang" class="lightbox-by-id lightbox-content mfp-hide lightbox-white" style="padding: 20px;"> | |
<div class="row"> | |
<div class="col medium-6"> | |
<?php the_post_thumbnail(); ?> | |
<?php woocommerce_template_single_title(); ?> | |
<?php woocommerce_template_single_price(); ?> | |
<?php woocommerce_template_single_excerpt(); ?> | |
</div> | |
<div class="col medium-6"> | |
<?php echo do_shortcode('[contact-form-7 id="10" title="Contact form"]'); ?> | |
</div> | |
</div> | |
</div> | |
<?php | |
endif; | |
} | |
add_action('wp_footer', 'ot_popup_form'); | |
function ot_popup_btn() | |
{ | |
?> | |
<a href="#dathang" class="button">Yêu cầu tư vấn</a> | |
<?php | |
} | |
add_action('woocommerce_before_add_to_cart_form', 'ot_popup_btn'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment