承接 coercive/cart 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

coercive/cart

Composer 安装命令:

composer require coercive/cart

包简介

Coercive Cart / Basket Handler

README 文档

README

Cart / Basket shopping handler

Get

composer require coercive/cart

Usage

<?php
use Coercive\Shop\Cart\Cart;
use Coercive\Shop\Cart\Item;
use Coercive\Shop\Cart\Store\Session;

include __DIR__ . "/dist/Store/Session.php";

include __DIR__ . "/dist/Ext/Entity.php";
include __DIR__ . "/dist/Ext/Collection.php";
include __DIR__ . "/dist/Ext/Address.php";

include __DIR__ . "/dist/Cart.php";
include __DIR__ . "/dist/User.php";
include __DIR__ . "/dist/Item.php";
include __DIR__ . "/dist/Shipping.php";
include __DIR__ . "/dist/Billing.php";
include __DIR__ . "/dist/Promo.php";

$cart = new Cart;

$item = (new Item)
    ->setTitle('Example 1')
    ->setPrice(10)
    ->setQuantity(1)
    ->setRef(666);
$cart->Items()->addItem($item, '#test123');

$item->Promo()
    ->setToken('#123456789ABCD')
    ->setPriceCut(3);

$item = (new Item)
    ->setTitle('Tutu')
    ->setPrice('\MyClass\For\Calculate\PriceItem::price')
    ->setQuantity(3)
    ->setRef(777);
$cart->Items()->addItem($item);

$cart->User()
    ->setRef(42)
    ->setLanguage('EN')
    ->setFirstName('Example FName')
    ->setLastName('Example LName')
    ->setEmail('example@coercive.fr');

$cart->Shipping()
    ->setTitle('Example Shipping Title')
    ->setFirstName('Example FName')
    ->setLastName('Example LName')
    ->setAddress('Example Address')
    ->setZip('#12345')
    ->setTown('Example Town')
    ->setCountry('Example Country')
    ->setIsoCountry('EN');

$cart->Billing()
    ->setTitle('Example Billing Title')
    ->setFirstName('Example FName')
    ->setLastName('Example LName')
    ->setAddress('Example Address')
    ->setZip('#12345')
    ->setTown('Example Town')
    ->setCountry('Example Country')
    ->setIsoCountry('FR');


// -------------------------- ?>


<h1># EXAMPLE START #</h1>
<br /><br />
<p>User : <?= $cart->User()->getEmail() ?></p>
<p>Shipping : <?= $cart->Shipping()->getTitle() ?></p>
<p>Billing : <?= $cart->Billing()->getTitle() ?></p>
<br /><?php
foreach ($cart->Items()->keys() as $mId):
    $item = $cart->Items()->getItem($mId); ?>
    <p>----------------------------------------</p>
    <p>Title : <?= $item->getTitle() ?></p>
    <p>Price : <?= $item->getPrice() ?></p>
    <p>Quantity : <?= $item->getQuantity() ?></p>
    <p>Ref : <?= $item->getRef() ?></p><?php

    if($item->Promo()->isModified()): ?>
        <p>Token : <?= $item->Promo()->getToken() ?></p>
        <p>Price cut : <?= $item->Promo()->getPriceCut() ?></p>
        <p>New item price : <?= $item->Promo()->calc($item->getPrice()) ?></p><?php
    endif;

endforeach ?>
<br /><br />
<h1># EXAMPLE END #</h1><?php

# Storage in session
$session = new Session;
$session->store($cart);

# Retrieve from session
$cart = $session->retrieve();

coercive/cart 适用场景与选型建议

coercive/cart 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.36k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 09 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 coercive/cart 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 coercive/cart 我们能提供哪些服务?
定制开发 / 二次开发

基于 coercive/cart 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.36k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-09-03