Server : Apache System : Linux host44.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64 User : vapecompany ( 2719) PHP Version : 7.4.33 Disable Function : NONE Directory : /home/vapecompany/demo.vapecompany.com.bd/vendor/bumbummen99/shoppingcart/src/ |
Upload File : |
<?php namespace Gloudemans\Shoppingcart; trait CanBeBought { /** * Get the identifier of the Buyable item. * * @return int|string */ public function getBuyableIdentifier($options = null) { return method_exists($this, 'getKey') ? $this->getKey() : $this->id; } /** * Get the name, title or description of the Buyable item. * * @return string */ public function getBuyableDescription($options = null) { if (($name = $this->getAttribute('name'))) { return $name; } if (($title = $this->getAttribute('title'))) { return $title; } if (($description = $this->getAttribute('description'))) { return $description; } } /** * Get the price of the Buyable item. * * @return float */ public function getBuyablePrice($options = null) { if (($price = $this->getAttribute('price'))) { return $price; } } /** * Get the weight of the Buyable item. * * @return float */ public function getBuyableWeight($options = null) { if (($weight = $this->getAttribute('weight'))) { return $weight; } return 0; } }