Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter ghabhishek

    (@ghabhishek)

    Dear Team,

    Can you please help me out?

    Thanks

    Plugin Author Dotstore

    (@dots)

    Hello ghabhishek,

    Thanks for reaching out to us.

    I have reviewed your query that, you want to display the size chart using the short code.

    Sorry to say but, in our current plugin version there is no any short code to display the size chart.

    There is default functionality to display the size chart at two places.

    1. Before the add to cart button position.

    2. Additional tab.

    Please let me know if you facing any issue on this position.

    Thanks,

    Thread Starter ghabhishek

    (@ghabhishek)

    We are using a very custom product page implementation and therefore these hooks are not available on the page. That is the reason why I was looking for a shortcode as that could be very much continent.

    Thread Starter ghabhishek

    (@ghabhishek)

    So if anyone else came up here search for the same, this is my solution for the time being:

    
        function show_size_chart() {
            if(is_product()) {
                $product_tabs = apply_filters( 'woocommerce_product_tabs', array() );
                if(isset($product_tabs['custom_tab'])){
                    ?>
                        <div id="wc-size-chart-content">
                            <?php
                                $product_tabs['custom_tab']['callback']['0']->size_chart_custom_product_tab_content_callback();
                            ?>
                        </div>
                    <?php
                }
            }
        }
        add_shortcode('wc_size_chart','show_size_chart');

    Just add this to your theme’s functions.php and then you can simply call the [wc_size_chart] short code on the product page (in the description maybe) to see the appropriate size chart.

    P.S.:
    I know it might not be very elegant but it works so that’s that.

    • This reply was modified 4 years, 6 months ago by ghabhishek.
    Plugin Author Dotstore

    (@dots)

    Hello ghabhishek,

    Thanks for providing the solution over here.

    Yes, that code helps other to add attachments as short code if they theme is custom.

    Sorry to say but, we can’t do this changes in our plugin code because, we provides functionality to display the default attachments based on the woocommerce hooks.

    So, you can use this site specific solution.

    Thanks,

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Do we have Shortcode for size charts?’ is closed to new replies.