hindesj/sage-woocommerce

dev-master 2023-01-23 01:42 UTC

This package is not auto-updated.

Last update: 2024-10-01 07:35:14 UTC


README

将 WooCommerce 支持添加到 Sage 10。

安装

安装 composer 包(在主题文件夹中)。

composer require generoi/sage-woocommerce

将包添加到缓存的包清单中。

wp acorn package:discover

发布所需的 single-product.blade.phparchive-product.blade.php 视图。

wp acorn vendor:publish --tag="WooCommerce Templates"

可选地发布一个注释掉的 app/wc-template-hooks.php 文件以自定义 WC 模板钩子。

wp acorn vendor:publish --tag="WooCommerce Template Hook Overrides"

默认情况下,您的主题已声明 WooCommerce 支持。要添加特定功能的支持,请将它们添加到您的 app/setup.php

add_theme_support('wc-product-gallery-zoom');
add_theme_support('wc-product-gallery-lightbox');
add_theme_support('wc-product-gallery-slider');

过滤器

/**
 * Add support for WooCommerce Subscription templates.
 */
add_filter('sage-woocommerce/templates', function ($paths) {
    $paths[] = WP_PLUGIN_DIR . '/woocommerce-subscriptions/templates/';
    return $paths;
});