Created
July 4, 2017 08:08
-
-
Save thinhbg59/aca7f24f9f9ba78c9c60705c372bcfb9 to your computer and use it in GitHub Desktop.
Popup form for 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"> | |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium animi autem cumque eum iste | |
itaque, laboriosam maiores minima necessitatibus neque numquam, odio pariatur quaerat, quam | |
quia. Beatae provident sequi voluptas.</p> | |
</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