2018-01-25 11:30:17 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* This Software is the property of Data Development and is protected
|
|
|
|
* by copyright law - it is NOT Freeware.
|
|
|
|
*
|
|
|
|
* Any unauthorized use of this software without a valid license
|
|
|
|
* is a violation of the license agreement and will be prosecuted by
|
|
|
|
* civil and criminal law.
|
|
|
|
*
|
|
|
|
* http://www.shopmodule.com
|
|
|
|
*
|
|
|
|
* @copyright © D³ Data Development, Thomas Dartsch
|
2018-02-23 12:30:57 +01:00
|
|
|
* @author D³ Data Development - Daniel Seifert <info@shopmodule.com>
|
2018-01-25 11:30:17 +01:00
|
|
|
* @link http://www.oxidmodule.com
|
|
|
|
*/
|
|
|
|
|
2018-02-23 11:06:24 +01:00
|
|
|
namespace D3\Devhelper\Modules\Application\Model;
|
|
|
|
|
2020-11-11 22:29:10 +01:00
|
|
|
use oxArticleInputException;
|
2019-10-16 14:56:55 +02:00
|
|
|
use OxidEsales\Eshop\Application\Model\Article;
|
|
|
|
use OxidEsales\Eshop\Application\Model\OrderArticle;
|
|
|
|
use OxidEsales\Eshop\Core\Exception\ArticleException;
|
|
|
|
use OxidEsales\Eshop\Core\Exception\ArticleInputException;
|
|
|
|
use OxidEsales\Eshop\Core\Exception\NoArticleException;
|
2020-11-11 22:29:10 +01:00
|
|
|
use oxNoArticleException;
|
2019-10-16 14:56:55 +02:00
|
|
|
|
2018-01-25 11:30:17 +01:00
|
|
|
class d3_dev_oxbasketitem extends d3_dev_oxbasketitem_parent
|
|
|
|
{
|
|
|
|
public function d3ClearArticle()
|
|
|
|
{
|
|
|
|
$this->_oArticle = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
2019-10-16 14:56:55 +02:00
|
|
|
* @throws ArticleException
|
|
|
|
* @throws ArticleInputException
|
|
|
|
* @throws NoArticleException
|
2018-01-25 11:30:17 +01:00
|
|
|
*/
|
|
|
|
public function getTitle()
|
|
|
|
{
|
|
|
|
$oArticle = $this->getArticle();
|
2018-02-23 12:30:57 +01:00
|
|
|
$this->_sTitle = $oArticle->getFieldData('oxtitle');
|
2018-01-25 11:30:17 +01:00
|
|
|
|
2018-02-23 12:30:57 +01:00
|
|
|
if ($oArticle->getFieldData('oxvarselect')) {
|
2018-01-25 11:30:17 +01:00
|
|
|
$this->_sTitle = $this->_sTitle . ', ' . $this->getVarSelect();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->_sTitle;
|
|
|
|
}
|
2019-10-16 14:56:55 +02:00
|
|
|
|
|
|
|
/**
|
2020-11-11 22:29:10 +01:00
|
|
|
* @throws oxArticleInputException
|
|
|
|
* @throws oxNoArticleException
|
2019-10-16 14:56:55 +02:00
|
|
|
*/
|
|
|
|
public function d3ConvertToArticleObject()
|
|
|
|
{
|
|
|
|
$oEmbeddedArticle = $this->getArticle();
|
|
|
|
|
|
|
|
if ($oEmbeddedArticle instanceof OrderArticle) {
|
|
|
|
$oArticle = oxNew(Article::class);
|
|
|
|
$oArticle->load($oEmbeddedArticle->getFieldData('oxartid'));
|
|
|
|
$this->_oArticle = $oArticle;
|
|
|
|
}
|
|
|
|
}
|
2018-01-25 11:30:17 +01:00
|
|
|
}
|