Linux 软件免费装
Banner图

PKart Product Attributes Display

开发者 pluginskart
更新时间 2026年11月2日 21:12
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

woocommerce blocks product attributes site editor product collection

下载

1.0.0

详情介绍:

PKart Product Attributes Display adds a lightweight block that shows the value of any WooCommerce product attribute, right where you want it in your block theme. By default, WooCommerce only lists attributes in the "Additional information" tab. With this plugin you can place individual attributes, such as Color: Walnut, Natural Oak, Black or Width: 60, 90, 120 cm, directly under the product title or price, inside product grids, or anywhere else in the Site Editor. Create or reuse attributes under Products → Attributes, or add custom attributes to individual products. Each global attribute automatically appears in the block inserter as its own block, named after the attribute. Insert it, optionally add a prefix and suffix, and you’re done. Features How it works
  1. Create or reuse attributes under Products → Attributes, or add custom attributes to individual products.
  2. Assign attribute values to your products.
  3. Open Appearance → Editor and edit the Single Product template, or any template containing a Product Collection block.
  4. Search the block inserter for your attribute's name (for example, "Width") and insert it.
  5. Add an optional prefix and suffix in the block settings sidebar.
Requirements

安装:

Automatic installation
  1. Make sure WooCommerce is installed and activated.
  2. In your WordPress dashboard, go to Plugins → Add New Plugin.
  3. Search for "PKart Product Attributes Display".
  4. Click Install Now, then Activate.
Manual installation
  1. Download the plugin ZIP file.
  2. Go to Plugins → Add New Plugin → Upload Plugin and upload the ZIP file, or extract it and upload the pkart-product-attributes-display folder to /wp-content/plugins/.
  3. Activate the plugin from Plugins → Installed Plugins.
After activation
  1. Go to Appearance → Editor → Templates and open the Single Product template, or a template that contains a Product Collection block.
  2. Search the block inserter for an attribute name, such as "Color", and insert it inside the product area.
  3. In the block settings sidebar, adjust the Attribute slug, Prefix, and Suffix if needed.
  4. Save the template.

屏幕截图:

  • Product attribute values on the front end, displayed as comma-separated lists with prefix and suffix text.
  • Global and custom attributes assigned to a product in the WooCommerce Attributes tab, ready to be displayed by the blocks.

升级注意事项:

1.0.0 Initial release.

常见问题:

Does this plugin require WooCommerce?

Yes. WooCommerce must be installed and active.

Does it work with classic themes?

The plugin provides a block, so it needs a theme that supports block templates, such as Twenty Twenty-Four or Twenty Twenty-Five. It can also be used in any block that provides product context.

Where can I use the block?

Anywhere a product is available as block context: the Single Product template, inside the Product Collection block's product template, and similar product blocks. Outside of a product context, the block outputs nothing.

My attribute does not appear in the block inserter. Why?

Automatic blocks are created only for global attributes managed under Products → Attributes. Create an attribute there, and it will automatically appear in the block inserter, searchable by its name. You can also add custom attributes directly to individual products.

How do I display a custom (product-level) attribute?

Insert any attribute block, then change its Attribute slug in the block settings to the name of your custom attribute, in lowercase with spaces replaced by hyphens. For example, a custom attribute named "Fabric Type" uses the slug fabric-type, and "Thickness" uses thickness.

What should I enter as the attribute slug for a global attribute?

Use the attribute's taxonomy name with the pa_ prefix, for example pa_color or pa_width. Blocks inserted from the inserter fill this in for you.

Why is the block empty on some products?

The block only outputs content when the current product has a value for the selected attribute. This keeps your layout clean when an attribute does not apply to a product.

Can I style the output?

Yes. The block renders a paragraph with the class wp-block-pkart-shop-attributes, plus the attribute slug as an extra class (for example pa_color). Inside it you'll find:

  • .wp-block-pkart-product-attributes-display__prefix
  • .wp-block-pkart-product-attributes-display__value
  • .wp-block-pkart-product-attributes-display__suffix
You can also add your own CSS class from the block's Advanced settings panel.

Does the plugin slow down my site?

No. The block is rendered on the server, loads no front-end JavaScript, and does not add database tables or options.

Is the plugin compatible with WooCommerce HPOS?

Yes. The plugin declares compatibility with High-Performance Order Storage and the Cart and Checkout blocks. It does not read or write order data.

Is the plugin translation-ready?

Yes. All strings use the pkart-product-attributes-display text domain.

更新日志:

1.0.0