Linux 软件免费装
Banner图

CartTrigger – BAG

开发者 polettoespana
更新时间 2026年3月19日 18:51
PHP版本: 7.4 及以上
WordPress版本: 6.9
版权: GPLv2 or later
版权网址: 版权信息

标签

gallery woocommerce brands brand management awards

下载

2.0.9

详情介绍:

CartTrigger – BAG (Brand · Awards · Gallery) extends the WooCommerce native brand taxonomy with three powerful modules: Custom Fields Attach unlimited key–value pairs to any brand. Output them anywhere via shortcode or PHP helper function. CSS classes are fully customisable, including Tailwind arbitrary-value classes (e.g. text-[11px]). Awards Manage a list of awards and recognitions for each brand — with optional logo, award name, event name, and year. Display them as a styled list using the [ctbag_awards] shortcode. Gallery Upload a curated image gallery per brand. Display it as a responsive grid with the [ctbag_gallery] shortcode. Optional native WooCommerce lightbox (PhotoSwipe) via lightbox="1". Shortcodes [ctbag_custom_fields] Outputs brand custom fields as a <dl> list. [ctbag_custom_fields brand="slug" wrapper_class="..." dt_class="..." dd_class="..."] [ctbag_awards] Outputs brand awards as a styled card list. [ctbag_awards brand="slug" title="Awards" wrapper_class="..." card_class="..."] [ctbag_gallery] Outputs brand gallery as a responsive image grid. [ctbag_gallery brand="slug" title="Gallery" wrapper_class="..." lightbox="1"] PHP Helper Functions All shortcodes are also available as direct PHP functions that bypass WordPress' shortcode parser — useful when Tailwind arbitrary-value classes (e.g. text-[11px]) would otherwise be mangled: echo ctbag_custom_fields(['wrapper_class' => 'grid grid-cols-2 gap-4']); echo ctbag_awards(['title' => ('Awards', 'your-textdomain')]); echo ctbag_gallery(['title' => ('Gallery', 'your-textdomain'), 'lightbox' => '1']); Professional Admin UI All brand meta fields are presented in a clean, card-based admin interface grouped by module (HTML Description, Custom Fields, Awards, Gallery), with collapsible shortcode reference built in. Custom fields and awards support drag & drop reordering. Gallery images can be removed individually (× button on hover) and reordered by dragging.

安装:

  1. Upload the carttrigger-bag folder to the /wp-content/plugins/ directory.
  2. Activate the plugin through the Plugins menu in WordPress.
  3. Go to Products → Brands and edit any brand to start adding content.

屏幕截图:

  • Custom Fields, Awards, and Gallery modules with drag & drop support.

升级注意事项:

2.0.5 Breaking change: shortcodes and PHP helper functions renamed from ctb_* to ctbag_*. Update any shortcodes in your content accordingly. 2.0.4 New admin UX: drag & drop reordering for gallery, custom fields, and awards; single-image removal in gallery. 2.0.3 Bug fix: awards and custom fields with accented characters or typographic quotes now save correctly. No data migration needed. 2.0.0 Major rewrite. No data migration needed — all existing brand meta is preserved.

常见问题:

Does this plugin require WooCommerce?

Yes. WooCommerce must be active before activating CartTrigger – BAG. The plugin declares a Requires Plugins: woocommerce dependency.

Does it require a specific WooCommerce version?

WooCommerce 8.0 or higher is recommended. The plugin has been tested up to WooCommerce 10.6.1.

Can I use Tailwind CSS classes in the shortcode attributes?

Yes, but classes containing square brackets (e.g. text-[11px]) will be interpreted as shortcode closing tags by WordPress. Use the PHP helper functions instead — they bypass the shortcode parser entirely.

Where is the gallery lightbox loaded?

The lightbox uses WooCommerce's bundled PhotoSwipe library. It is only active when lightbox="1" is set. On pages where WooCommerce scripts are disabled, a graceful fallback (open image in new tab) is used automatically.

Gallery images look blurry or load slowly — what image size should I use?

The size_thumb parameter controls which registered WordPress image size is used for gallery thumbnails. The default is medium_large (typically 768 px wide), which is appropriate for large single-column layouts. If your gallery is displayed in a multi-column grid (3–4 columns), use size_thumb="medium" (300 px) to reduce file weight by 4–6× with no visible quality loss: [ctbag_gallery size_thumb="medium" lightbox="1"] Or via PHP helper: echo ctbag_gallery(['size_thumb' => 'medium', 'lightbox' => '1']);

Brand pages load slowly — any caching recommendations?

Brand taxonomy pages contain no user-specific content (no cart, no session), so they are ideal candidates for full-page caching. Make sure your caching plugin (LiteSpeed Cache, WP Rocket, W3 Total Cache…) does not exclude brand taxonomy pages from its cache. Since version 2.0.8, PhotoSwipe (4 CSS/JS files) is only enqueued on brand pages that actually have a gallery, so brands without a gallery already load significantly fewer assets. If you use LiteSpeed Cache and notice that brand pages are slow after a product update, check whether "Smart Purge on Product Update" is purging brand taxonomy pages. Enabling the LiteSpeed Crawler ensures the cache is regenerated automatically in the background so visitors never hit an uncached page.

更新日志:

2.0.9 2.0.8 2.0.7 2.0.6 2.0.5 2.0.4 2.0.3 2.0.0