2018-01-25 11:30:17 +01:00
|
|
|
<?php
|
2024-09-04 08:58:40 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
|
2018-01-25 11:30:17 +01:00
|
|
|
*
|
2024-09-04 08:58:40 +02:00
|
|
|
* For the full copyright and license information, please view
|
|
|
|
* the LICENSE file that was distributed with this source code.
|
2018-01-25 11:30:17 +01:00
|
|
|
*
|
2024-09-04 08:58:40 +02:00
|
|
|
* https://www.d3data.de
|
2018-01-25 11:30:17 +01:00
|
|
|
*
|
2024-09-04 08:58:40 +02:00
|
|
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
|
|
|
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
|
|
|
|
* @link https://www.oxidmodule.com
|
2018-01-25 11:30:17 +01:00
|
|
|
*/
|
|
|
|
|
2024-09-04 08:58:40 +02:00
|
|
|
namespace D3\Devhelper\Modules\Application\Model;
|
2018-02-23 11:06:24 +01:00
|
|
|
|
2024-09-04 08:58:40 +02:00
|
|
|
use oxArticleInputException;
|
|
|
|
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;
|
|
|
|
use oxNoArticleException;
|
2019-10-16 14:56:55 +02:00
|
|
|
|
2024-09-04 08:58:40 +02:00
|
|
|
class d3_dev_oxbasketitem extends d3_dev_oxbasketitem_parent
|
|
|
|
{
|
|
|
|
public function d3ClearArticle()
|
|
|
|
{
|
|
|
|
$this->_oArticle = null;
|
|
|
|
}
|
2018-01-25 11:30:17 +01:00
|
|
|
|
2024-09-04 08:58:40 +02:00
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
* @throws ArticleException
|
|
|
|
* @throws ArticleInputException
|
|
|
|
* @throws NoArticleException
|
|
|
|
*/
|
|
|
|
public function getTitle()
|
|
|
|
{
|
|
|
|
$oArticle = $this->getArticle();
|
|
|
|
$this->_sTitle = $oArticle->getFieldData('oxtitle');
|
2018-01-25 11:30:17 +01:00
|
|
|
|
2024-09-04 08:58:40 +02:00
|
|
|
if ($oArticle->getFieldData('oxvarselect')) {
|
|
|
|
$this->_sTitle = $this->_sTitle . ', ' . $this->getVarSelect();
|
|
|
|
}
|
2018-01-25 11:30:17 +01:00
|
|
|
|
2024-09-04 08:58:40 +02:00
|
|
|
return $this->_sTitle;
|
|
|
|
}
|
2019-10-16 14:56:55 +02:00
|
|
|
|
2024-09-04 08:58:40 +02:00
|
|
|
/**
|
|
|
|
* @throws oxArticleInputException
|
|
|
|
* @throws oxNoArticleException
|
|
|
|
*/
|
|
|
|
public function d3ConvertToArticleObject()
|
|
|
|
{
|
|
|
|
$oEmbeddedArticle = $this->getArticle();
|
2019-10-16 14:56:55 +02:00
|
|
|
|
2024-09-04 08:58:40 +02:00
|
|
|
if ($oEmbeddedArticle instanceof OrderArticle) {
|
|
|
|
$oArticle = oxNew(Article::class);
|
|
|
|
$oArticle->load($oEmbeddedArticle->getFieldData('oxartid'));
|
|
|
|
$this->_oArticle = $oArticle;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|