1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Onurkacmaz\LaravelN11\Models; |
4
|
|
|
|
5
|
|
|
use Onurkacmaz\LaravelN11\Exceptions\N11Exception; |
6
|
|
|
use Onurkacmaz\LaravelN11\Service; |
7
|
|
|
use SoapClient; |
8
|
|
|
|
9
|
|
|
class ProductSelling extends Service |
10
|
|
|
{ |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* @var SoapClient|null |
14
|
|
|
*/ |
15
|
|
|
private $_client; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* @var string |
19
|
|
|
*/ |
20
|
|
|
private $endPoint = "/ProductSellingService.wsdl"; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Category constructor |
24
|
|
|
* endPoint set edildi. |
25
|
|
|
* @throws N11Exception|\SoapFault |
26
|
|
|
*/ |
27
|
|
|
public function __construct() |
28
|
|
|
{ |
29
|
|
|
parent::__construct(); |
30
|
|
|
$this->_client = $this->setEndPoint($this->endPoint); |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @param int $productId |
35
|
|
|
* @return mixed |
36
|
|
|
* @description Satışta olmayan bir ürünün N11 ürün ID si kullanılarak satışa başlanması için kullanılır. |
37
|
|
|
*/ |
38
|
|
|
public function startSellingProductByProductId(int $productId) |
39
|
|
|
{ |
40
|
|
|
$this->_parameters["productId"] = $productId; |
41
|
|
|
return $this->_client->StartSellingProductByProductId($this->_parameters); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @param string $productSellerCode |
46
|
|
|
* @return mixed |
47
|
|
|
* @description Satışta olmayan bir ürünün mağaza ürün kodu kullanılarak satışa başlanması için kullanılır. |
48
|
|
|
*/ |
49
|
|
|
public function startSellingProductBySellerCode(string $productSellerCode) |
50
|
|
|
{ |
51
|
|
|
$this->_parameters["productSellerCode"] = $productSellerCode; |
52
|
|
|
return $this->_client->StartSellingProductBySellerCode($this->_parameters); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @param int $productId |
57
|
|
|
* @return mixed |
58
|
|
|
* @description Satışta olan ürünün n11 ürün ID si kullanılarak satışa kapatılması için kullanılır. |
59
|
|
|
*/ |
60
|
|
|
public function stopSellingProductByProductId(int $productId) |
61
|
|
|
{ |
62
|
|
|
$this->_parameters["productId"] = $productId; |
63
|
|
|
return $this->_client->StopSellingProductByProductId($this->_parameters); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @param string $productSellerCode |
68
|
|
|
* @return mixed |
69
|
|
|
* @description Satışta olan ürünün mağaza ürün kodu kullanılarak satışının durdurulması için kullanılır. |
70
|
|
|
*/ |
71
|
|
|
public function stopSellingProductBySellerCode(string $productSellerCode) |
72
|
|
|
{ |
73
|
|
|
$this->_parameters["productSellerCode"] = $productSellerCode; |
74
|
|
|
return $this->_client->StopSellingProductBySellerCode($this->_parameters); |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
} |
78
|
|
|
|