| 开发者 | contexa |
|---|---|
| 更新时间 | 2026年4月3日 22:13 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[contexa_search layout="list" columns="4" show_description="yes" show_price="yes" results_per_page="12" template="1"]
Available options:
placeholder - Search input placeholder text (default: "Search for products...")button_text - Search button text (default: "Search")layout - Display layout: list or grid (default: list)columns - Number of grid columns when layout="grid" (default: 4)show_price - Display product prices: yes/no (default: yes)show_description - Display product descriptions: yes/no (default: yes)results_per_page - Maximum results to display (default: 12)template - Visual template style 1-5 (default: 1)
Template Styles:
[contexa_similar product_id="123" title="You May Also Like" columns="4" limit="8"]
Trending Products:
[contexa_trending title="Trending Now" columns="4" limit="8"]
Personalized Recommendations (based on visitor behavior):
[contexa_personalized title="Recommended For You" columns="4" limit="8"]
Frequently Bought Together:
[contexa_frequently_together product_id="123" title="Frequently Bought Together" columns="4" limit="4"]
Cart-Based Recommendations:
[contexa_cart_based title="Complete Your Purchase" columns="4" limit="4"]
All recommendation shortcodes include:
title - Section heading (optional)
columns - Number of columns for grid display (default: 4)limit - Maximum number of products to display (default: 8)show_price - Display product prices: yes/no (default: yes)show_add_to_cart - Display add to cart with quantity selector: yes/no (default: yes)/wp-content/plugins/contexa-ai-search/ directory, or install through WordPress plugins screenYes, you need an API key from Contexa.co. A free trial is available.
Yes, the plugin works with any WordPress theme that supports WooCommerce.
Use the shortcode [contexa_search] on any page or post.
Yes, you can enable automatic sync in the settings to keep products updated.
Yes! The plugin includes 5 built-in templates and supports custom CSS: Use built-in templates via shortcode:
[contexa_search layout="list"] # Horizontal list layout
[contexa_search layout="grid" columns="3"] # Grid layout with 3 columns
Add custom CSS to your theme:
```css
/ Customize list layout /
.contexa-products-list .contexa-product-card {
padding: 20px;
border-bottom: 1px solid #eee;
}
/ Customize grid layout /
.contexa-products-grid {
grid-template-columns: repeat(3, 1fr);
gap: 30px;
}
/ Style product cards /
.contexa-product-card {
border-radius: 10px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
/ Customize quantity buttons /
.contexa-quantity-selector {
border: 2px solid #000;
}
/ Hide elements /
.contexa-product-excerpt { display: none; }
```
All search results use standard CSS classes - just add your styles to Appearance → Customize → Additional CSS.
The plugin uses direct API integration with client-side rendering for maximum performance:
Yes! The plugin includes inline autocomplete suggestions that appear as you type, powered by the Contexa AI engine.
The plugin includes 5 AI-powered recommendation engines:
[contexa_similar][contexa_trending][contexa_personalized][contexa_frequently_together][contexa_cart_based]Product Pages:
[contexa_similar] - Show alternative products[contexa_frequently_together] - Cross-sell complementary items
Homepage:
[contexa_trending] - Popular products section
[contexa_personalized] - Personalized recommendations
Cart/Checkout:
[contexa_cart_based] - Last-minute upsells
Category/Shop Pages:
[contexa_trending] - Trending in this category
Blog/Content Pages:
[contexa_trending] - Related products in sidebar
You can add shortcodes via:
Method 1: Using WooCommerce hooks (recommended)
Add this to your theme's functions.php:
```php
// Add "You May Also Like" below product description
add_action('woocommerce_after_single_product_summary', 'add_similar_products', 15);
function add_similar_products() {
echo do_shortcode('[contexa_similar title="You May Also Like" columns="4" limit="4"]');
}
// Add "Frequently Bought Together" below Add to Cart button
add_action('woocommerce_after_add_to_cart_form', 'add_frequently_bought', 20);
function add_frequently_bought() {
echo do_shortcode('[contexa_frequently_together title="Frequently Bought Together" columns="4" limit="3"]');
}
```
Method 2: Using page builders
Simply add a Shortcode widget and paste: [contexa_similar]
Method 3: Product tabs
Add recommendations in a custom WooCommerce product tab for a cleaner layout.
Add this to your theme's functions.php:
php
add_action('woocommerce_after_cart_table', 'add_cart_recommendations');
function add_cart_recommendations() {
echo do_shortcode('[contexa_cart_based title="Complete Your Purchase" columns="4" limit="4"]');
}
Yes! Version 1.6.0 adds full WPML integration: During Setup Wizard:
Yes, the plugin loads the Contexa search SDK from api.contexa.co as part of the Contexa.co service. This is required for the AI search functionality to work. The SDK is loaded automatically on all frontend pages when you have an API key configured.
This plugin sends product data, search queries, and visitor interactions to Contexa.co to provide AI-powered search functionality. You can control tracking features in the plugin settings. See the Privacy & Data Collection section below for full details.