Support » Plugin: WooCommerce » [Plugin: WooCommerce – excelling eCommerce] Bug in WooCommerce_Widget_Product_Categories

  • There is a bug in WooCommerce when using it with WPML and language indication way via ?lang=XX parameter.

    The bug can be found here:

    <script type='text/javascript'>
                /* <![CDATA[ */
                    var dropdown = document.getElementById("dropdown_product_cat");
                    function onCatChange() {
                        if ( dropdown.options[dropdown.selectedIndex].value !=='' ) {
                            location.href = "<?php echo home_url(); ?>/?product_cat="+dropdown.options[dropdown.selectedIndex].value;
                        }
                    }
                    dropdown.onchange = onCatChange;
                /* ]]> */
                </script>

    echo home_url() produces for example http://site.com/?lang=es and then you add /?product_cat=XXXX resulting http://site.com/?lang=es/?product_cat=XXXX

    Can be seen here:
    http://fridja.com/product-category-f-1000-fr/?lang=fr

    I consider it a bug because you may not rely on home_url() this way since it may be filtered by plugins (as in this case).

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WooCommerce – excelling eCommerce] Bug in WooCommerce_Widget_Product_Categories’ is closed to new replies.