cms-niceties/src/Extensions/ShoppingCartControllerExtension.php

30 lines
811 B
PHP
Raw Normal View History

2021-06-19 21:30:03 +02:00
<?php
/**
* Created by PhpStorm.
* User: tony
* Date: 6/23/18
* Time: 1:23 PM
*/
namespace A2nt\CMSNiceties\Extensions;
use SilverStripe\ORM\DataExtension;
2022-05-10 13:09:06 +02:00
/**
* Class \A2nt\CMSNiceties\Extensions\ShoppingCartControllerExtension
*
* @property \A2nt\CMSNiceties\Extensions\ShoppingCartControllerExtension $owner
*/
2021-06-19 21:30:03 +02:00
class ShoppingCartControllerExtension extends DataExtension
{
public function updateAddResponse($request, $response, $product, $quantity)
{
\PageController::setSiteWideMessage('+'.$quantity.' item(s) was added into the cart', 'success', $request);
}
public function updateRemoveResponse($request, $response, $product, $quantity)
{
\PageController::setSiteWideMessage(''.$quantity.' item(s) was removed from the cart', 'success', $request);
}
}