Download the PHP package vbpupil/product without Composer
On this page you can find all versions of the php package vbpupil/product. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package product
Quality Assurance
ProductLibrary
A Product Object can have many components based on how complicated your requirements are. Below outlines the general configurations:
SimpleProduct - Without Prices
A SimpleProduct does NOT have any prices. Below shows how a SimpleProduct can be initiated:
Get Description
Get Descriptions
Get Product Attributes
- getBrandName() - brand name associated with product
- getBrandId() - brand id associated with product
GeneralProduct
On the face of it a General Product is the same as a Simple Product except it has a concept of Variations which itself offers some interesting additions.
To add Variations simplly start by passing in an empty Collection:
Once you have created the Collection simply use it as you would any other Collection object (the above descriptions functionality in Simple Product uses the same functionality).
To add a Variation:
Get Variant Attributes
- getBarcode() - barcode of a variant
- getEan() - ean of a variant
- getMpn() - mpn of a variant
- getPriceType() - price type of a variant ie single or pivot
- getUnitOfSale() - unit of sale of a varient ie bag, pallet, jumbo bag etc
- getMinDelQty() - how much qty to purchase before del is available
- getMaxDelQty() - how much qty is too much before only colection is available
Pricing
SinglePrice
This handles most use cases when a product variation may have a few prices attributed to it such as prices, special prices, cost prices etc but will only be sold for a single prices. When asking the object for its getPrice() method you will be returned a single prices. Note the object will run a check to see if the Special prices is set/valid and return that if true, if not the sell prices will be returned.
PivotPrice
This object will handle the pivot prices style structure, ie:
Qty | Price |
---|---|
1 - 9 | 5.00 |
10 - 19 | 4.00 |
20 - 30 | 3.00 |
to identify which price type a variant is (ie single or pivot) you can use getVariantPriceTypes()
to identify which is the cheapest variant id you can use getCheapestVariantiD()
to identify which is the cheapest variant price you can use getCheapestVariantPrice()
Stock
Stock can be measured depending upon needs, the following are available.
SimpleStock
Simple stock offers a simple holding of a stock figure and passes back whenever called upon.
AuditableStock
Auditable stock has the ability to verify what the current stock figure has on hand by performing a retrospective check of its inventory history and spitting out its findings.
Auditable
The auditable class is on hand to offer an explanation of why an items stock figure has changed - ie BOOK_IN/BOOK_OUT etc etc.
AuditableType
This class simply defines what can be accepted as a valid reason. For instance when newing up an Auditable:
A AuditableType::SALE() is passed into to represent a SALE item. This class is governed by Enums which outlines what type is available.
AuditableAssociatesDocumentType
This class allows you to specify what supporting document accompanies the stock change, for instance a SALES_ORDER (with accompanying SALES ORDER ID) would support a sale which resulted in the stock being reduced by 1. Below shows this code in action.
An AuditableAssociatedDocumentType::SALES_ORDER() is passed in to represent a SALES_ORDER. This class is governed by Enums which outlines what supporting document types are available.