定制 tombroucke/otomaties-woocommerce-product-filters 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tombroucke/otomaties-woocommerce-product-filters

Composer 安装命令:

composer require tombroucke/otomaties-woocommerce-product-filters

包简介

Product filters for WooCommerce

README 文档

README

Installation

Require package

composer require tombroucke/otomaties-woocommerce-product-filters

Generate key

wp acorn key:generate

Add livewire styles and script

add_filter('wp_head', function () {
    echo Blade::render('@livewireStyles');
});

add_filter('wp_footer', function () {
    echo Blade::render('@livewireScripts');
});

Publish config file

wp acorn vendor:publish --tag="product-filters-config"

Update config file

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | ProductFilters Package
    |--------------------------------------------------------------------------
    */

    'filters' => [
        'product_category' => [
            'title' => 'Product Category',
            'component' => 'checkbox',
            'type' => 'taxonomy',
            'taxonomy' => 'product_cat',
        ],
        'custommeta' => [
            'title' => 'Custom meta',
            'component' => 'checkbox',
            'type' => 'meta',
            'meta_key' => 'custom_meta',
        ],
        'features' => [
            'title' => 'Features',
            'component' => 'select',
            'type' => 'taxonomy',
            'taxonomy' => 'pa_features',
        ],
        'size' => [
            'title' => 'Size',
            'component' => 'select',
            'type' => 'taxonomy',
            'taxonomy' => 'pa_size',
        ],
        'price' => [
            'title' => 'Price',
            'component' => 'price',
        ],
    ],
];

Include livewire components

In archive-product.blade.php

<livewire:products />

Optimize clear

wp acorn optimize:clear

Optional: publish views

wp acorn vendor:publish --tag="product-filters-views"

统计信息

  • 总下载量: 32
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-17