SilverCommerce\DownloadableProducts\DownloadableProduct
Product class that will allow adding of product to the CMS.
Synopsis
class DownloadableProduct
extends Product
{
- // members
- private static string $table_name = "DownloadableProduct";
- private static string $singular_name = 'Downloadable Product';
- private static string $plural_name = 'Downloadable Products';
- private static string $description = "A product that can be downloaded";
- private static array $db = ;
- private static array $has_one = ;
- private static array $casting = ;
- private static array $owns = ;
- private static array $defaults = ;
- // methods
- public boolean getDeliverable()
- public string getDownloadLink()
- public DownloadFolder getDownloadFolder()
- public void getCMSFields()
- public void onBeforeWrite()
- public boolean canDownload()
Hierarchy
Extends
- Product
Members
private
- $casting
- $db
- $defaults
- $description
- $has_one
- $owns
- $plural_name
- $singular_name
- $table_name
—
string
Set the default DB table name
Methods
public
- canDownload() — Special permission to see if this product can be downloaded by the current member
- getCMSFields()
- getDeliverable() — Downloadable products are not deliverable. This will be detected by the shopping cart to disable delivery options.
- getDownloadFolder() — Get the folder to add downloads to
- getDownloadLink() — Get the link to download the file associated with this product
- onBeforeWrite() — Ensure weight is removed on save and that attached files are moved to the correct folder