如何解决隐藏/禁用单个产品页面而不转发到主页
我在隐藏单个产品页面时发现this super helpful thread。
//Removes links
add_filter( 'woocommerce_product_is_visible','product_invisible');
function product_invisible(){
return false;
}
//Remove single page
add_filter( 'woocommerce_register_post_type_product','hide_product_page',12,1);
function hide_product_page($args){
$args["publicly_queryable"]=false;
$args["public"]=false;
return $args;
}
但是当我在我的functions.php中使用它,然后单击购物车中已有的项目时,该链接会将我发送回首页。
有没有办法添加某种弹出消息来说明“物品已添加到汽车中”或类似的方法来阻止链接转发回首页?
干杯!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。