2015-06-24 27 views
3

我目前正在客戶的woocommerce網站/網上商店工作,它幾乎已完成。Woocommerce下拉式過濾器在iOS上不起作用

除了我在我的(標準)woocommerce分層導航小部件之一中遇到缺陷/錯誤/名稱 - 它是你想要的。在任何設備上:pc/android-tablet/android-phone都可以工作,但在任何iOS設備上,(可能)onchange動作不會觸發。

我已經看到我的產品排序字段被包圍在一種叫做

<li class="woocommerce widget_layered_nav"> 

    <h2 class="widgettitle"> 
    --TITLE (sort)-- 
    </h2> 

    <form class="woocommerce-ordering has-validation-callback" method="get"> 
    <select name="orderby" class="orderby"> 
    --Options (sort)-- 
    </select> 
    </form> 

</li> 

而我的其他過濾器不

<li id="woocommerce_layered_nav-5" class="widget woocommerce widget_layered_nav"> 

    <h2 class="widgettitle"> 
    --Title (brands)-- 
    </h2> 

    <select class="dropdown_layered_nav_merk"> 
    --Options (brands)-- 
    </select> 

</li> 

有任何解決方法或解決此問題?

回答

3

試試這個。輸入以下代碼到你的主題functions.php文件:

add_action('wp_enqueue_scripts', 'agentwp_dequeue_stylesandscripts', 100); 

function agentwp_dequeue_stylesandscripts() { 
if (class_exists('woocommerce')) { 
wp_dequeue_style('select2'); 
wp_deregister_style('select2'); 

wp_dequeue_script('select2'); 
wp_deregister_script('select2'); 

} 
} 

的代碼這個簡單的位將禁用增強盒,給你一個良好的老式下拉菜單。此方法已在WooCommerce 2.5.5中測試過。

+0

此代碼仍適用於WordPress 4.7.5。真棒。 – Krishneil