atm / ordertrackerbundle
订单追踪管理包
1.35
2021-05-20 08:41 UTC
Requires
- php: >=5.6
Requires (Dev)
- symfony/asset: ~2.7|~3.0.0
- symfony/console: ~2.8|~3.0.0
- symfony/expression-language: ~2.4|~3.0.0
- symfony/finder: ~2.3|~3.0.0
- symfony/form: ^2.8.23
- symfony/http-kernel: ~2.8|~3.0.0
- symfony/polyfill-intl-icu: ~1.0
- symfony/routing: ~2.2|~3.0.0
- symfony/security: ~2.6|~3.0.0
- symfony/security-acl: ~2.6|~3.0.0
- symfony/stopwatch: ~2.2|~3.0.0
- symfony/templating: ~2.1|~3.0.0
- symfony/translation: ~2.7|~3.0.0
- symfony/var-dumper: ~2.7.16|~2.8.9|~3.0.9
- symfony/yaml: ^2.0.5|~3.0.0
- xlabs/hwcdnbundle: ^1.0
- xlabs/mmadminbundle: ^2.0
Suggests
- symfony/asset: For using the AssetExtension
- symfony/expression-language: For using the ExpressionExtension
- symfony/finder: For using the finder
- symfony/form: For using the FormExtension
- symfony/http-kernel: For using the HttpKernelExtension
- symfony/routing: For using the RoutingExtension
- symfony/security: For using the SecurityExtension
- symfony/stopwatch: For using the StopwatchExtension
- symfony/templating: For using the TwigEngine
- symfony/translation: For using the TranslationExtension
- symfony/var-dumper: For using the DumpExtension
- symfony/yaml: For using the YamlExtension
README
一个用于管理用户所下订单的订单追踪包
安装
通过composer安装
php -d memory_limit=-1 composer.phar require atm/ordertrackerbundle
在你的AppKernel中
public function registerbundles()
{
return [
...
...
new ATM\OrderTrackerBundle\ATMOrderTrackerBundle(),
];
}
配置示例
以下显示默认值
# app/config/config.yml
atm_order_tracker:
user: Namespace of your user class
media: Namespace of the media for the points manager
user_field_name: Name of the user field in your media class
media_folder: path to folder where images are going to be stored
route_after_purchase: route name after purchase form
minimum_points_for_purchase: Minimum points needed for purchasing items in the shop
user_media_roles: Roles of the users that have media
在视图中包含,以加载一个弹出窗口,用户可以选择所有产品
{{ render(controller('ATMOrderTrackerBundle:Product:seeProductsForPurchase' , {
'page' : 1,
'max_results': 10
})) }}
默认显示产品的方式是在弹出窗口中,但您可以覆盖视图OrderTrackerBundle/views/Purchase/do_purchase.html.twig来更改它。
事件
在完成购买后,会触发1个事件
class PostPurchase extends Event{
const NAME = 'atm_order_tracker_post_purchase.event';
private $purchase;
private $user;
public function __construct($user,$purchase)
{
$this->user = $user;
$this->purchase = $purchase;
}
public function getPurchase()
{
return $this->purchase;
}
public function getUser()
{
return $this->user;
}
}