lupasearch/prestashop-lupasearch-plugin
最新稳定版本:0.5.3
Composer 安装命令:
composer require lupasearch/prestashop-lupasearch-plugin
包简介
Help your website visitors turn into buyers. LupaSearch delivers accurate search results that boost your business sales.
README 文档
README
Upgrade your PrestaShop store with our plugin that transforms your search feature. It connects to a fast, smart LupaSearch solution, making it easy for customers to find what they need quickly.
Requirements
- PHP: >=7.1
- PrestaShop: compatible with PrestaShop 1.7.x - 8.x
Installation
Installation steps
- Download the latest plugin version.
- Log in to your PrestaShop back office.
- Navigate to Modules → Module Manager → Upload a module.
- Upload the downloaded
lupasearch.zipfile. - Follow the on-screen instructions to complete the installation.
Configuration
- Go to Modules → Module Manager → LupaSearch integration → Configure.
- Enter the configuration values from your LupaSearch dashboard into the UI Plugin Configuration Key and Product Index ID fields, then click Save.
- Activate the widget by setting Enable Widget to Yes.
Below is an example of how the configuration screen looks after setting up the LupaSearch plugin:
Add custom attributes to LupaSearch product feed
LupaSearch provides two hooks to allow other modules to extend product and variant data:
actionLupaSearchAddProductAttributesactionLupaSearchAddVariantAttributes
These hooks let your module inject custom attributes into the LupaSearch feed, enhancing search and filtering capabilities.
How to extend product or variant data
1. Create or edit a PrestaShop module
Documentation: https://devdocs.prestashop-project.org/1.7/modules/creation/tutorial/
2. Register LupaSearch hooks in your module’s install() method
Documentation: https://devdocs.prestashop-project.org/1.7/modules/concepts/hooks/#registration
public function install() { return parent::install() && $this->registerHook('actionLupaSearchAddProductAttributes') && $this->registerHook('actionLupaSearchAddVariantAttributes'); }
3. Add custom attributes to the LupaSearch feed
Documentation: https://devdocs.prestashop-project.org/1.7/modules/concepts/hooks/#execution
Example: Add custom attributes to products
public function hookActionLupaSearchAddProductAttributes($params) { $productIds = $params['product_ids'] ?? []; $shopId = $params['shop_id'] ?? null; $langId = $params['language_id'] ?? null; $data = []; foreach ($productIds as $id) { $data[$id] = [ 'custom_label' => 'Extra info for product ' . $id, 'rating' => rand(1, 5), ]; } return $data; }
Example: Add custom attributes to variants
public function hookActionLupaSearchAddVariantAttributes($params) { $productIds = $params['product_ids'] ?? []; $combinationIds = $params['combination_ids'] ?? []; $shopId = $params['shop_id'] ?? null; $langId = $params['language_id'] ?? null; $data = [ 'products' => [], 'combinations' => [], ]; // Add custom attributes for simple product variants foreach ($productIds as $id) { $data['products'][$id] = [ 'variant_type' => 'simple', 'sku_group' => 'product_' . $id, ]; } // Add custom attributes for combination-based variants foreach ($combinationIds as $id) { $data['combinations'][$id] = [ 'variant_type' => 'combination', 'color_label' => 'Color for combo #' . $id, 'limited_edition' => (bool) rand(0, 1), ]; } return $data; }
For detailed guidance on setting up, reach out to our support team (support@lupasearch.com) who are ready to assist you with the process.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-24