* * @copyright Copyright (c) 2022 OXID eSales AG (https://www.oxid-esales.com) * @copyright Copyright (c) 2022 O3-Shop (https://www.o3-shop.com) * @license https://www.gnu.org/licenses/gpl-3.0 GNU General Public License 3 (GPLv3) */ namespace OxidEsales\PayPalModule\Model; /** * PayPal oxArticle class * * @mixin \OxidEsales\Eshop\Application\Model\Article */ class Article extends Article_parent { /** * Check if Product is virtual: is non material and is downloadable * * @return bool */ public function isVirtualPayPalArticle() { $virtual = true; // non material products if (!$this->oxarticles__oxnonmaterial->value) { $virtual = false; } elseif (isset($this->oxarticles__oxisdownloadable) && !$this->oxarticles__oxisdownloadable->value ) { $virtual = false; } return $virtual; } /** * Gets stock amount for article * * @return float */ public function getStockAmount() { return $this->oxarticles__oxstock->value; } }