Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 86 additions & 86 deletions src/BolCom/BasketItemProduct.php
Original file line number Diff line number Diff line change
@@ -1,87 +1,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 = DEFAULT_PRODUCT_IMAGE;
} else
$sThumbnailurl = $this->thumbnailurl;
return $sThumbnailurl;
}
public function getBasketItemUrl()
{
return $this->url;
}
public function getBasketItemOfferId()
{
return $this->offerid;
}
public function getBasketItemOfferPrice()
{
return $this->offerprice;
}
<?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;
}

}
136 changes: 68 additions & 68 deletions src/BolCom/Product.php
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
<?php
namespace BolCom;
class Product
{
private $id;
private $title;
private $price;
private $description;
private $thumbnailurl;
private $url;
private $offers;
private $offeridbolcom;
public function __construct($product = NULL)
{
if (!empty($product)) {
$this->id = (string)$product->id;
$this->title = (string)$product->title;
$this->price = (string)$product->offerData->offers[0]->price;
$this->description = (string)$product->shortDescription;
$this->thumbnailurl = (string)$product->images[1]->url;
$this->url = (string)$product->urls[0]->value;
$this->offers = (array)$product->offerData->offers;
}
}
public function getId()
{
return $this->id;
}
public function getTitle()
{
return $this->title;
}
public function getFirstAvailablePrice()
{
return $this->price;
}
public function getDescription()
{
return $this->description;
}
public function getThumbnailurl()
{
if ($this->thumbnailurl == "") {
// Use a default bol.com image
$sThumbnailurl = DEFAULT_PRODUCT_IMAGE;
} else
$sThumbnailurl = $this->thumbnailurl;
return $sThumbnailurl;
}
public function getExternalurl()
{
return $this->url;
}
public function getOffers()
{
return $this->offers;
}
<?php

namespace BolCom;

class Product
{
private $id;
private $title;
private $price;
private $description;
private $thumbnailurl;
private $url;
private $offers;
private $offeridbolcom;

public function __construct($product = NULL)
{
if (!empty($product)) {
$this->id = (string)$product->id;
$this->title = (string)$product->title;
$this->price = (string)$product->offerData->offers[0]->price;
$this->description = (string)$product->shortDescription;
$this->thumbnailurl = (string)$product->images[1]->url;
$this->url = (string)$product->urls[0]->value;
$this->offers = (array)$product->offerData->offers;
}
}

public function getId()
{
return $this->id;
}

public function getTitle()
{
return $this->title;
}

public function getFirstAvailablePrice()
{
return $this->price;
}

public function getDescription()
{
return $this->description;
}

public function getThumbnailurl()
{
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 getExternalurl()
{
return $this->url;
}

public function getOffers()
{
return $this->offers;
}

}
Loading