Skip to content
Open
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
61 changes: 30 additions & 31 deletions src/VividStore/Product/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
*/
class Product
{
/**
/**
* @Id @Column(type="integer", options={"unsigned"=true})
* @GeneratedValue
* @GeneratedValue
*/
protected $pID;

/**
* @Column(type="integer",nullable=true)
*/
protected $cID;

/**
* @Column(type="string")
*/
Expand All @@ -53,87 +53,87 @@ class Product
* @Column(type="text",nullable=true)
*/
protected $pDesc;

/**
* @Column(type="text",nullable=true)
*/
protected $pDetail;

/**
* @Column(type="decimal", precision=10, scale=2)
*/
protected $pPrice;

/**
* @Column(type="decimal", precision=10, scale=2, nullable=true)
*/
protected $pSalePrice;

/**
* @Column(type="boolean")
*/
protected $pFeatured;

/**
* @Column(type="integer")
*/
protected $pQty;

/**
* @Column(type="boolean",nullable=true)
*/
protected $pQtyUnlim;

/**
* @Column(type="boolean")
*/
protected $pNoQty;

/**
* @Column(type="integer")
*/
protected $pTaxClass;

/**
* @Column(type="boolean")
*/
protected $pTaxable;

/**
* @Column(type="integer")
*/
protected $pfID;

/**
* @Column(type="boolean")
*/
protected $pActive;

/**
* @Column(type="datetime")
*/
protected $pDateAdded;

/**
* @Column(type="boolean")
*/
protected $pShippable;

/**
* @Column(type="integer")
*/
protected $pWidth;

/**
* @Column(type="integer")
*/
protected $pHeight;

/**
* @Column(type="integer")
*/
protected $pLength;

/**
* @Column(type="integer")
*/
Expand All @@ -143,12 +143,12 @@ class Product
* @Column(type="boolean")
*/
protected $pCreateUserAccount;

/**
* @Column(type="boolean")
*/
protected $pAutoCheckout;

/**
* @Column(type="integer")
*/
Expand Down Expand Up @@ -465,7 +465,6 @@ public function getProductSalePrice()
}
public function getFormattedSalePrice()
{
return
$saleprice = $this->getProductSalePrice();

if ($saleprice != '') {
Expand Down Expand Up @@ -494,7 +493,7 @@ public function getTaxClass()
{
return StoreTaxClass::getByID($this->pTaxClass);
}

public function isTaxable()
{
if ($this->pTaxable == "1") {
Expand Down Expand Up @@ -664,7 +663,7 @@ public function getProductQty()
return $this->pQty;
}
}

public function isSellable()
{
if ($this->hasVariations() && $variation = $this->getVariation()) {
Expand All @@ -681,7 +680,7 @@ public function isSellable()
}
}
}

public function getProductImages()
{
return StoreProductImage::getImagesForProduct($this);
Expand Down Expand Up @@ -721,7 +720,7 @@ public function save()
$em->persist($this);
$em->flush();
}

public function remove()
{
StoreProductImage::removeImagesForProduct($this);
Expand All @@ -740,7 +739,7 @@ public function remove()
$page->delete();
}
}

public function generatePage($templateID=null)
{
$pkg = Package::getByHandle('vivid_store');
Expand Down Expand Up @@ -787,8 +786,8 @@ public function setProductPageID($cID)
$this->setCollectionID($cID);
$this->save();
}



/* TO-DO
* This isn't completely accurate as an order status may be incomplete and never change,
Expand Down