Last active
November 13, 2021 16:16
-
-
Save tuongpgjz/70bf5bccda77a79b11758cca8de74452 to your computer and use it in GitHub Desktop.
Add popup sizechart from UX Block in flatsome theme - salesgen.io
This file contains 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
<?php | |
// Snippet by https://SalesGen.io | |
//display sizechart above add to cart button | |
// #1 put this code in to functions.php of your themes/child theme | |
// #2 create UX block with ID : sizechart. | |
// #3 Check your product page | |
//Notice: Change the width of popup on desktop by change the 800px with your expect value | |
add_action('woocommerce_before_add_to_cart_quantity', 'salesgen_size_chart'); | |
function salesgen_size_chart() { | |
?> | |
<div class="sg_size_chart_wrp"> | |
<a href="#lightboxsizechart" target="_self" class="button primary button primary is-underline"> | |
<span>Size chart</span> | |
</a> | |
<?php echo do_shortcode( '[lightbox width="800px" id="lightboxsizechart"][block id="sizechart"][/lightbox]' );?> | |
</div> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment