More than Just Lines on a Map: Best Practices for U.S Bike Routes
20160507 - Presentation Slides about Shopping Cart for TYPO3
1. Cart – Shopping Cart for TYPO3
Presentation of the Cart extension
TYPO3camp Vienna - #t3cvie
7th May 2016
2. 7th May 2016Shopping Cart for TYPO32
Cart – Shopping Cart for TYPO3
● What is Cart for?
● What is different to other shopping extensions?
● What has been changed?
● Product Models
● Order Models
● Hands On
● Unit Tests
● Things that are to do.
3. 23th Feb. 2016Shopping Cart for TYPO33
What has been changed?
wt_cart
● pibase-Extenion with some Models for
cart representation
● HTML-Marker-Templates
● dependence on powermail-Extension
● several additional extensions for products,
order and payment provider
Cart
● extbase-Extension with structured models
● Fluid-Templates with default-Template and
examples for Foundation and Bootstrap
● no dependencies to other extensions
● provide models for products, orders and
payment
● provide a coupon model for cart
● provide some Backend-Modules for
handling products and orders
● ready for TYPO3 7.x
⇒
4. 23th Feb. 2016Shopping Cart for TYPO34
What has been changed?
wt_cart
● 3 extensions (wt_cart, wt_cart_product
and wt_cart_order) must be configured.
● 1 huge pi1-function handles complete
workflow for handling and rendering cart.
● Nearly 1,000 lines of TypoScript code to
configure wt_cart and the rendering.
wt_cart_product and wt_cart_order not
included.
Cart
● 1 main extension Cart provides all the
necessary 28 models.
● 3 controller Classes handles the workflow
for all parts of products, cart and order.
● Only 250 lines of TypoScript for configuring
cart with internal product model.
● 5 FE-Plugins to show “Cart”, “Mini-Cart”,
“Product”, “FlexProduct” and “Order”
● 3 (*/-) BE-Moduls
⇒
5. 23th Feb. 2016Shopping Cart for TYPO35
Product Models
● sku, title, teaser and description
● add tt_content and images
● product prices and limitations
● min and max products per order
● special prices
● measurement and baseprice configuration
● stock handling
● variants and frontend-variants
● categories
6. 23th Feb. 2016Shopping Cart for TYPO36
Order Models
● user
● order number, order date, invoice number and
invoice date
● addresses for billing and shipping
● all prices, taxes and tax classes
● all products
● payment and shipping
7. 23th Feb. 2016Shopping Cart for TYPO37
Hands On
Frontend:
http://local.cart7.extco.de
Backend:
http://local.cart7.extco.de/typo3
8. 23th Feb. 2016Shopping Cart for TYPO38
Unit-Tests
Cart provides 381 Unit-Tests for testing the domain models
(product, cart and order). Not all relevant calculations are currently
being tested. Many more tests will be added in the next weeks.
Controller Tests are still missing completely and will be added too.
9. 23th Feb. 2016Shopping Cart for TYPO39
Unit Tests (CartTest.php excerpt)
●
...
●
public function getCouponsInitialyReturnsEmptyArray();
●
public function addCouponAddsNewCoupon();
●
public function addSameCouponReturnsReturnCodeOne();
●
public function addSameCouponDoesNotChangeCouponNumberInCart();
●
public function addSameCouponReturnsErrorCodeMinusOne();
●
public function
addSecondNotCombinableCoupon
DoesNotChangeCouponNumberInCart();
●
public function
addSecondNotCombinableCouponReturns
ReturnErrorCodeMinusTwo();
●
public function
addSecondCombinableCouponToNotCombinableCoupons
DoesNotChangeCouponNumberInCart();
●
public function
addSecondCombinableCouponToNotCombinableCoupons
ReturnsReturnErrorCodeMinusTwo();
●
public function addSecondCombinableCouponAddsCoupon();
●
public function getCouponGrossInitialyReturnsZero();
●
…
/**
* @test
*/
public function addSameCouponDoesNotChangeCouponNumberInCart()
{
$coupon = $this->getMock(
'ExtcodeCartDomainModelProductCoupon',
array('getCode', 'getTitle', 'getDiscount', 'getTaxClassId'),
array(),
'',
false
);
$coupon->expects($this->any())->method('getCode')->will($this->returnValue('couponCode'));
$coupon->expects($this->any())->method('getTitle')->will($this->returnValue('couponTitle'));
$coupon->expects($this->any())->method('getDiscount')->will($this->returnValue(10.0));
$coupon->expects($this->any())->
method('getTaxClassId')->
will($this->returnValue($this->normalTaxClass->getId()));
$this->grossCart->addCoupon($coupon);
$this->grossCart->addCoupon($coupon);
$this->assertCount(
1,
$this->grossCart->getCoupons()
);
$this->netCart->addCoupon($coupon);
$this->netCart->addCoupon($coupon);
$this->assertCount(
1,
$this->netCart->getCoupons()
);
}
10. 23th Feb. 2016Shopping Cart for TYPO310
Things that are to do.
Open Beta
● stable data model
● no errors in price calculation
Release Candidate
● adding products through AJAX-requests
● add multiple products with one request to cart
● check cart before complete order
● stock handling and testing behavior
● documentation, documentation, documentation
(for administrators, integrators and users)
Features
● updating cart through AJAX-requests
● edit FE-variants in cart
● notification for stock handling
● CartPaypal (Closed Beta), CartAmazon, …
● CartPdf for generating order and invoice PDF
documents
● further development of the backend modules
11. 23th Feb. 2016Shopping Cart for TYPO311
Cart in the web
GitHub:
https://github.com/extcode/cart
Slack:
https://typo3.slack.com/messages/ext-cart/
Twitter:
https://twitter.com/ext_cart
https://twitter.com/extcoder
12. 23th Feb. 2016Shopping Cart for TYPO312
Thank you.
A big thanks goes to the Tritum GmbH
http://www.tritum.de
and the Closed Beta tester.