隐藏与Woocommerce不匹配的变体 [英] Hide variations that don't match Woocommerce

查看:69
本文介绍了隐藏与Woocommerce不匹配的变体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我目前正在一家拥有很多变化的Woocommerce商店中工作.

So I'm currently working on a Woocommerce store that has lots of variations.

我基本上要寻找的是根据之前选择的版本所选择的内容刷新下一个版本.

What I'm basically looking for is for the next variation to refresh based on what was chosen on the variation chosen before that.

例如, 如果您继续 http://freelance.tstwebdesign.co.uk/platino/product/plain-platinum-court/ (为加载时间慢而道歉) 我想从宽度"中选择一个选项,然后应刷新深度",仅显示与该宽度匹配的可用深度.

For example, If you go on http://freelance.tstwebdesign.co.uk/platino/product/plain-platinum-court/ (Apologies for the slow load time) I want to choose a selection from "Width" which should then refresh "Depth" showing only the depths available that match with that width.

这可能吗?

谢谢!

推荐答案

这是默认版本,功能不多.对于许多变体,您可以使用

It's default function for not many variations. For many variations you can do it with function

    // Woo Commerce – Make Variations only appear when available
function custom_wc_ajax_variation_threshold( $qty, $product ) {
return 500;
}

add_filter( ‘woocommerce_ajax_variation_threshold’, ‘custom_wc_ajax_variation_threshold’, 10, 2 );

这篇关于隐藏与Woocommerce不匹配的变体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆