-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathBasketItemProduct.php
More file actions
87 lines (75 loc) · 2.05 KB
/
BasketItemProduct.php
File metadata and controls
87 lines (75 loc) · 2.05 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
namespace BolCom;
class BasketItemProduct
{
private $id;
private $title;
private $type;
private $price;
private $publisher;
private $description;
private $thumbnailurl;
private $url;
private $offerid;
private $offerprice;
public function __construct($basketXml = NULL)
{
if (!empty($basketXml)) {
$this->id = (string)$basketXml->id;
$this->title = (string)$basketXml->title;
$this->type = (string)$basketXml->type;
$this->price = (string)$basketXml->price;
$this->publisher = (string)$basketXml->publisher;
$this->description = (string)$basketXml->shortDescription;
$this->thumbnailurl = (string)$basketXml->images->large;
$this->url = (string)$basketXml->urls->main;
$this->offerid = (string)$basketXml->offers->offer->id;
$this->offerprice = (string)$basketXml->offers->offer->price;
}
}
public function getBasketItemId()
{
return $this->id;
}
public function getBasketItemTitle()
{
return $this->title;
}
public function getBasketItemType()
{
return $this->type;
}
public function getBasketItemPrice()
{
return $this->price;
}
public function getBasketItemPublisher()
{
return $this->publisher;
}
public function getBasketItemDescription()
{
return $this->description;
}
public function getBasketItemThumbnailurl()
{
if ($this->thumbnailurl == "") {
// Use a default bol.com image
$sThumbnailurl = "https://s.s-bol.com/nl/static/images/main/noimage_124x100default.gif";
} else
$sThumbnailurl = $this->thumbnailurl;
return $sThumbnailurl;
}
public function getBasketItemUrl()
{
return $this->url;
}
public function getBasketItemOfferId()
{
return $this->offerid;
}
public function getBasketItemOfferPrice()
{
return $this->offerprice;
}
}