setono/sylius-strands-plugin
Composer 安装命令:
composer require setono/sylius-strands-plugin
包简介
Plugin that integrates Strands
关键字:
README 文档
README
Integrates the Strands recommendation engine into Sylius.
Installation
Step 1: Download the plugin
Open a command console, enter your project directory and execute the following command to download the latest stable version of this plugin:
# Omit setono/sylius-tag-bag-plugin if you want to # override layout.html.twig as described at https://github.com/Setono/TagBagBundle#usage $ composer require setono/sylius-strands-plugin setono/sylius-tag-bag-plugin
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the plugin
Then, enable the plugin by adding it to the list of registered plugins/bundles
in the config/bundles.php file of your project:
<?php # config/bundles.php return [ Setono\TagBagBundle\SetonoTagBagBundle::class => ['all' => true], // Use this bundle or override layout.html.twig as described at https://github.com/Setono/TagBagBundle#usage Setono\SyliusTagBagPlugin\SetonoSyliusTagBagPlugin::class => ['all' => true], Setono\SyliusStrandsPlugin\SetonoSyliusStrandsPlugin::class => ['all' => true], ];
Step 3: Create configuration
# config/packages/setono_sylius_strands.yaml setono_sylius_strands: api_id: "%env(STRANDS_API_ID)%"
# .env
# Get it at https://retail.strands.com/account/info/
STRANDS_API_ID=YOUR_API_ID
Usage
Create a generic widget
In your twig template you can insert a widget like this:
{{ strands_widget('template') }}
The template is the id you get from here: strands.com/tpl/website.
It will output this: <div class="strandsRecs" tpl="template"></div>
Create a widget for the cart
{{ strands_widget('template')|strands_add_cart_items }}
It will output this: <div class="strandsRecs" tpl="template" item="list of items in the current cart"></div>
Create a widget for the product page
{{ strands_widget('template')|strands_add_item(product.code) }}
It will output this: <div class="strandsRecs" tpl="template" item="product code"></div>
统计信息
- 总下载量: 725
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-02-21