我很难在Woocommerce Force Sells扩展中禁用一个函数。这个函数在前端产品页面的“购买”按钮下添加了一些文本,我想删除它。
我想我已经在woocommerce-force-sells.php文件中找到了有问题的函数:
/**
* Displays information of what linked products that will get added when current
* product is added to cart.
*/
public function show_force_sell_products() {
我想在“商店”页面的主要内容下显示文本。不同类别的不同文本。 我知道在商店页面上显示每个类别的类别说明,但这已经在使用中。 现在我已经走到这一步了,但它似乎在儿童主题functions.php中不起作用 if ( is_category( 'category1' ) ) {
function add_my_text() {
print '<p>This is my extra text.</p>';
}
add_action( 'woocommerce_after_main_
我正在尝试将WooCommerce元素设计为没有填充和右边按钮的流动式“导航条”样式,如下面的屏幕截图:
<div class="woocommerce-message" role="alert">
<a href="~~~" tabindex="1" class="button wc-forward">Continue shopping</a>
“Product” has been added to your cart.
</div&g
我已经找到了一个按字母顺序对结账车进行排序的代码片段。这很好用,但如上所述,我尝试按类别对产品进行排序和分组。
有没有人可以调整下面的代码片段,让它按类别对产品进行排序?
add_action( 'woocommerce_cart_loaded_from_session', 'bbloomer_sort_cart_items_alphabetically' );
function bbloomer_sort_cart_items_alphabetically() {
global $woocommerce;
// REA
我正在购物车中进行检查,以应用这样一条规则:如果添加了来自冷却类别的项,则至少需要3项冷却类别项才能签出。-这个很管用。
但是,如果还添加了来自bundle类别的项,则不应强制执行上述冷却规则。
例如,至少需要3个冷藏类别的项目,除非捆绑物品在购物车中,在这种情况下,忽略冷却规则。
我至少有3条冷却规则可以工作,但是如果检测到包类别中的项,我无法得到排除此规则的代码?
基于答案代码,这是我的尝试:
function action_woocommerce_check_cart_items() {
// Only run on the cart or checkout pages
我在类别页面上添加产品的简短描述(摘录),但我不能让摘录中的html标签工作。奇怪的是,它们在单一产品页面中工作。下面给出的是我正在使用的函数,以防万一。我正在使用wordpress的understrap主题框架。
function woocommerce_after_shop_loop_item_title_short_description() {
global $product;
if ( ! $product->post->post_excerpt ) return;
?>
<div itemprop="descripti