1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
<?php
namespace Objectiv\Plugins\Checkout\Action;
/** * @link checkoutwc.com * @since 5.4.0 * @package Objectiv\Plugins\Checkout\Action * @author Clifton Griffin <[email protected]> */ class AddToCartAction extends CFWAction {
public function __construct() { parent::__construct( 'cfw_add_to_cart', false ); }
public function action() { $result = false;
if ( isset( $_POST['add-to-cart'] ) && empty( wc_get_notices( 'error' ) ) ) { do_action( 'woocommerce_ajax_added_to_cart', intval( $_POST['add-to-cart'] ) ); $result = true; }
$this->out( array( 'result' => $result, ) ); } }
|