1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @file |
5
|
|
|
* Magento API Client (SOAP v1). |
6
|
|
|
* Allows wrappers for each call, dependencies injections |
7
|
|
|
* and code completion. |
8
|
|
|
* |
9
|
|
|
* @author Sébastien MALOT <[email protected]> |
10
|
|
|
* @license MIT |
11
|
|
|
* @url <https://github.com/smalot/magento-client> |
12
|
|
|
* |
13
|
|
|
* For the full copyright and license information, please view the LICENSE |
14
|
|
|
* file that was distributed with this source code. |
15
|
|
|
*/ |
16
|
|
|
|
17
|
|
|
namespace Smalot\Magento\Cart; |
18
|
|
|
|
19
|
|
|
use Smalot\Magento\ActionInterface; |
20
|
|
|
use Smalot\Magento\MagentoModuleAbstract; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Class CartProduct |
24
|
|
|
* |
25
|
|
|
* @package Smalot\Magento\Cart |
26
|
|
|
*/ |
27
|
|
|
class CartProduct extends MagentoModuleAbstract |
28
|
|
|
{ |
29
|
|
|
/** |
30
|
|
|
* Allows you to add one or more products to the shopping cart (quote). |
31
|
|
|
* |
32
|
|
|
* @param int $quoteId |
33
|
|
|
* @param array $productsData |
34
|
|
|
* @param string $storeId |
35
|
|
|
* |
36
|
|
|
* @return ActionInterface |
37
|
|
|
*/ |
38
|
|
|
public function add($quoteId, $productsData, $storeId = null) |
|
|
|
|
39
|
|
|
{ |
40
|
|
|
return $this->__createAction('cart_product.add', func_get_args()); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Allows you to retrieve the list of products in the shopping cart (quote). |
45
|
|
|
* |
46
|
|
|
* @param int $quoteId |
47
|
|
|
* @param string $store |
48
|
|
|
* |
49
|
|
|
* @return ActionInterface |
50
|
|
|
*/ |
51
|
|
|
public function getList($quoteId, $store = null) |
|
|
|
|
52
|
|
|
{ |
53
|
|
|
return $this->__createAction('cart_product.list', func_get_args()); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Allows you to move products from the current quote to a customer quote. |
58
|
|
|
* |
59
|
|
|
* @param int $quoteId |
60
|
|
|
* @param array $productsData |
61
|
|
|
* @param string $store |
62
|
|
|
* |
63
|
|
|
* @return ActionInterface |
64
|
|
|
*/ |
65
|
|
|
public function moveToCustomerQuote($quoteId, $productsData, $store = null) |
|
|
|
|
66
|
|
|
{ |
67
|
|
|
return $this->__createAction('cart_product.moveToCustomerQuote', func_get_args()); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Allows you to remove one or several products from a shopping cart (quote). |
72
|
|
|
* |
73
|
|
|
* @param int $quoteId |
74
|
|
|
* @param array $productsData |
75
|
|
|
* @param string $store |
76
|
|
|
* |
77
|
|
|
* @return ActionInterface |
78
|
|
|
*/ |
79
|
|
|
public function remove($quoteId, $productsData, $store = null) |
|
|
|
|
80
|
|
|
{ |
81
|
|
|
return $this->__createAction('cart_product.remove', func_get_args()); |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* Allows you to update one or several products in the shopping cart (quote). |
86
|
|
|
* |
87
|
|
|
* @param int $quoteId |
88
|
|
|
* @param array $productsData |
89
|
|
|
* @param string $store |
90
|
|
|
* |
91
|
|
|
* @return ActionInterface |
92
|
|
|
*/ |
93
|
|
|
public function update($quoteId, $productsData, $store = null) |
|
|
|
|
94
|
|
|
{ |
95
|
|
|
return $this->__createAction('cart_product.update', func_get_args()); |
96
|
|
|
} |
97
|
|
|
} |
98
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.