Woocommerce 永久链接属性

问题描述

我经营着一家甜品店,并使用 Mix and Match 框插件让客户能够选择 10 种不同产品的 Pick n Mix。我为每种产品设置了变体,因此我可以以不同的重量出售它们。

如果我将鼠标悬停在此插件或购物车中选择的链接上,它会显示https://mysite.co.uk/product/jelly-and-gummy/freaky-fish/?attribute_weight=100g

我想让它只显示

https://mysite.co.uk/product/jelly-and-gummy/freaky-fish/ 这是没有添加 ?attribute_weight=100g 的主要产品,也没有删除插件中永久链接方法,因此它只显示产品名称,但将永久链接留在购物车、结帐页面中。

有人可以帮忙吗?

我已设法通过使用以下内容阻止它在产品名称显示 Freaky Fish - 100g,所以我只获得了 Freaky Fish,但我不知道如何更改永久链接

function custom_product_variation_title($should_include_attributes,$product){
    if(is_cart()) {
        $should_include_attributes = false;
        return $should_include_attributes;
    }
}
add_filter( 'woocommerce_product_variation_title_include_attributes','custom_product_variation_title',10,2 );

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)