Title: Products Table Compare
Author: hippocampustech
Published: <strong>2021 年 3 月 9 日</strong>
Last modified: 2021 年 3 月 9 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/products-table-compare.svg)

# Products Table Compare

 作者：[hippocampustech](https://profiles.wordpress.org/hippocampustech/)

[下载](https://downloads.wordpress.org/plugin/products-table-compare.0.5.zip)

 * [详情](https://cn.wordpress.org/plugins/products-table-compare/#description)
 * [评价](https://cn.wordpress.org/plugins/products-table-compare/#reviews)
 * [开发进展](https://cn.wordpress.org/plugins/products-table-compare/#developers)

 [支持](https://wordpress.org/support/plugin/products-table-compare/)

## 描述

Products Table Compare is a plugin for websites and eshops that are using the “woocommerce”
plugin.
 By using the Products Table Compare shortcode you can generate a dinamic
table of your products and populate it with product attributs, product shipping 
mesertments and custom fields. If your website or eShop is using the Variation Swatches
for WooCommerce plugin, Products Table Compare allows you to switch between displaying
your product colors as text or as visual color swatches.

## 屏幕截图

[⌊[products_compare cat=27 attrs=color info=weight,length acf=standard,range swatches
=1]⌉⌊[products_compare cat=27 attrs=color info=weight,length acf=standard,range 
swatches=1]⌉[

[products_compare cat=27 attrs=color info=weight,length acf=standard,range swatches
=1]

[⌊[products_compare cat=24 attrs=color info=weight,length,price swatches=1]⌉⌊[products_compare
cat=24 attrs=color info=weight,length,price swatches=1]⌉[

[products_compare cat=24 attrs=color info=weight,length,price swatches=1]

[⌊[products_compare cat=36,35 attrs=color,size info=price  swatches=1]⌉⌊[products_compare
cat=36,35 attrs=color,size info=price  swatches=1]⌉[

[products_compare cat=36,35 attrs=color,size info=price swatches=1]

## 常见问题

### How to incorporate Products Table Compare on youe site or eshop

Place `<?php do_shortcode('products_compare'); ?>` or [products_compare] in your
templates or files

### How do I filter the products table by product categories

The default behavior of the Products Table Compare plugin is to show all products,
in order to filter the products by product category you have to use the “cat” variable
with your selected product category ID inside the short code, for exemple:

    ```
     <?php do_shortcode('products_compare cat=1'); ?> or [products_compare cat=1] - will only populate the table with products from the product ctegory with the ID "1".
    ```

In case you want to populate the tabke with more than onre product category, you
should seperate the categories with a comma, for exemple:

    ```
    <?php do_shortcode('products_compare cat=1,2'); ?> or [products_compare cat=1,2] - will only populate the table with products from the product categories of ID's "1" and "2".
    ```

### My table has only the head row but no information

Thats becuase you didn’t choose the product information for your table.

Basicly you have 3 types of product information: products shipping measerment and
data (weight, height length and price) woocommerce products attributes and advenced
custom fields (acf plugin).

In order to populate the table with product data and measerment you need to use 
the data name in the info variable in the shortcode, for exemple:

    ```
    <?php do_shortcode('products_compare info=price'); ?> or [products_compare info=price] - will populate the tabele with the price row.
    ```

In order to populate the table with more than one product data or measerments rows,
you should seperate the info variable data with a comma, for exemple:

    ```
    <?php do_shortcode('products_compare info=price,length'); ?> or [products_compare info=price,length] - will populate the tabele with the price and length rows.
    ```

In order to populate the table with product attributes you need to use the attribule
name in the attrs variable in the shortcode, for exemple:

    ```
    <?php do_shortcode('products_compare attrs=color'); ?> or [products_compare attrs=color] - will populate the tabele with the color row.
    ```

In order to populate the table with more then one product attribues rows, you should
seperate the attribues names with a comma in the attrs variable, for exemple:

    ```
    <?php do_shortcode('products_compare attrs=color,size'); ?> or [products_compare attrs=color,size] - will populate the tabele with the color and size rows.
    ```

In order to populate the table with advenced custom fields you first need to set
up the “Advenced Custom Fields” plugin. Then you need to use the acf slug that you
set up in the acf variable in the shortcode, for exemple:

    ```
    <?php do_shortcode('products_compare acf=moter'); ?> or [products_compare acf=motor] - will populate the tabele with the motor row.
    ```

be advised that the row name that will be shown in the left most cell in the row
is the field slug that you set up

In order to populate the table with more then one product attribues rows, you should
seperate the attribues names with a comma in the attrs variable, for exemple:

    ```
    <?php do_shortcode('products_compare acf=motor,electric-system'); ?> or [products_compare acf=motor,electric-system'] - will populate the tabele with the motor and electric-system rows.
    ```

### How do I set up the swatches option

First, you will need to set up the “Variation Swatches for WooCommerce” plugin. 
Then you need to follow the variation swatches toturial and set up color hexes to
your color product attributes **make sure you name the attribue “color” and not “
colors”**. After you finished these steps you should incorporate the swatches option
with the “swatches” variable and the property 1 in the shortcode, for exemple:

    ```
    <?php do_shortcode('products_compare attrs=color swatches=1'); ?> or [products_compare attrs=color swatches=1]
    ```

## 评价

此插件暂无评价。

## 贡献者及开发者

「Products Table Compare」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ hippocampustech ](https://profiles.wordpress.org/hippocampustech/)

[帮助将「Products Table Compare」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/products-table-compare)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/products-table-compare/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/products-table-compare/)，或通过
[RSS](https://plugins.trac.wordpress.org/log/products-table-compare/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/products-table-compare/)。

## 更新日志

#### 0.5

 * Initial Revision
 * Public Beta

## 额外信息

 *  版本 **0.5**
 *  最后更新：**5 年前**
 *  活跃安装数量 **不到10**
 *  WordPress 版本 ** 4.4 或更高版本 **
 *  已测试的最高版本为 **5.6.17**
 *  PHP 版本 ** 5.4 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/products-table-compare/)
 * 标签
 * [compare](https://cn.wordpress.org/plugins/tags/compare/)[filter](https://cn.wordpress.org/plugins/tags/filter/)
   [product info](https://cn.wordpress.org/plugins/tags/product-info/)[products](https://cn.wordpress.org/plugins/tags/products/)
   [table](https://cn.wordpress.org/plugins/tags/table/)
 *  [高级视图](https://cn.wordpress.org/plugins/products-table-compare/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/products-table-compare/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/products-table-compare/reviews/)

## 贡献者

 *   [ hippocampustech ](https://profiles.wordpress.org/hippocampustech/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/products-table-compare/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://www.hippocampus.me/)