adjustments for OXID version 6
This commit is contained in:
bovenliggende
8debed2717
commit
c96203da2c
@ -2,7 +2,15 @@
|
||||
|
||||
namespace D3\Devhelper\Application\Controller;
|
||||
|
||||
use D3\Devhelper\Modules\Application\Controller as ModuleController;
|
||||
use D3\Devhelper\Modules\Core as ModuleCore;
|
||||
use OxidEsales\Eshop\Application\Controller\FrontendController;
|
||||
use OxidEsales\Eshop\Application\Controller\ThankYouController;
|
||||
use OxidEsales\Eshop\Application\Model\User;
|
||||
use OxidEsales\Eshop\Core\Email;
|
||||
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
|
||||
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
|
||||
use OxidEsales\Eshop\Core\Exception\UserException;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\Eshop\Core\Request;
|
||||
|
||||
@ -17,7 +25,7 @@ use OxidEsales\Eshop\Core\Request;
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ Data Development - Daniel Seifert <ds@shopmodule.com>
|
||||
* @author D³ Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link http://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
@ -32,10 +40,9 @@ class d3dev extends FrontendController
|
||||
|
||||
protected function _authenticate ()
|
||||
{
|
||||
$request = oxNew(Request::class);
|
||||
try {
|
||||
$sUser = $request->getRequestParameter( 'usr' );
|
||||
$sPassword = $request->getRequestParameter( 'pwd' );
|
||||
$sUser = Registry::get(Request::class)->getRequestEscapedParameter('usr');
|
||||
$sPassword = Registry::get(Request::class)->getRequestEscapedParameter('pwd');
|
||||
|
||||
if ( !$sUser || !$sPassword ) {
|
||||
$sUser = $_SERVER[ 'PHP_AUTH_USER' ];
|
||||
@ -58,67 +65,67 @@ class d3dev extends FrontendController
|
||||
}
|
||||
}
|
||||
}
|
||||
$oUser = oxNew( \OxidEsales\Eshop\Application\Model\User::class );
|
||||
$oUser = oxNew( User::class );
|
||||
if ( !$sUser || !$sPassword || !$oUser->login( $sUser, $sPassword ) ) {
|
||||
/** @var \OxidEsales\Eshop\Core\Exception\UserException $oEx */
|
||||
$oEx = oxNew( \OxidEsales\Eshop\Core\Exception\UserException::class, 'EXCEPTION_USER_NOVALIDLOGIN' );
|
||||
/** @var UserException $oEx */
|
||||
$oEx = oxNew( UserException::class, 'EXCEPTION_USER_NOVALIDLOGIN' );
|
||||
|
||||
throw $oEx;
|
||||
}
|
||||
}
|
||||
catch ( Exception $oEx ) {
|
||||
catch ( \Exception $oEx ) {
|
||||
$oShop = Registry::getConfig()->getActiveShop();
|
||||
header( 'WWW-Authenticate: Basic realm="' . $oShop->oxshops__oxname->value . '"' );
|
||||
header( 'WWW-Authenticate: Basic realm="' . $oShop->getFieldData('oxname') . '"' );
|
||||
header( 'HTTP/1.0 401 Unauthorized' );
|
||||
exit( 1 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
|
||||
* @throws DatabaseConnectionException
|
||||
* @throws DatabaseErrorException
|
||||
*/
|
||||
public function showOrderMailContent()
|
||||
{
|
||||
header('Content-type: text/html; charset='.Registry::getLang()->translateString('charset'));
|
||||
|
||||
if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value
|
||||
if (Registry::getConfig()->getActiveShop()->isProductiveMode()
|
||||
|| false == Registry::getConfig()->getConfigParam('blD3DevShowOrderMailsInBrowser')
|
||||
) {
|
||||
Registry::getUtils()->redirect(Registry::getConfig()->getShopUrl().'index.php?cl=start');
|
||||
}
|
||||
|
||||
$sTpl = oxNew(Request::class)->getRequestParameter('type');
|
||||
$sTpl = Registry::get(Request::class)->getRequestEscapedParameter('type');
|
||||
|
||||
/** @var d3_dev_thankyou $oThankyou */
|
||||
$oThankyou = oxNew(\OxidEsales\Eshop\Application\Controller\ThankYouController::class);
|
||||
/** @var ModuleController\d3_dev_thankyou $oThankyou */
|
||||
$oThankyou = oxNew(ThankYouController::class);
|
||||
$oOrder = $oThankyou->d3GetLastOrder();
|
||||
|
||||
/** @var d3_dev_oxemail $oEmail */
|
||||
$oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class);
|
||||
/** @var ModuleCore\d3_dev_oxemail $oEmail */
|
||||
$oEmail = oxNew(Email::class);
|
||||
echo $oEmail->d3GetOrderMailContent($oOrder, $sTpl);
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
|
||||
* @throws DatabaseConnectionException
|
||||
*/
|
||||
public function showInquiryMailContent()
|
||||
{
|
||||
if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value
|
||||
if (Registry::getConfig()->getActiveShop()->isProductiveMode()
|
||||
|| false == Registry::getConfig()->getConfigParam('blD3DevShowOrderMailsInBrowser')
|
||||
) {
|
||||
Registry::getUtils()->redirect(Registry::getConfig()->getShopUrl().'index.php?cl=start');
|
||||
}
|
||||
|
||||
$sTpl = oxNew(Request::class)->getRequestParameter('type');
|
||||
$sTpl = Registry::get(Request::class)->getRequestEscapedParameter('type');
|
||||
|
||||
/** @var d3_dev_thankyou $oThankyou */
|
||||
$oThankyou = oxNew(\OxidEsales\Eshop\Application\Controller\ThankYouController::class);
|
||||
/** @var ModuleController\d3_dev_thankyou $oThankyou */
|
||||
$oThankyou = oxNew(ThankYouController::class);
|
||||
$oOrder = $oThankyou->d3GetLastInquiry();
|
||||
|
||||
/** @var d3_dev_oxemail $oEmail */
|
||||
$oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class);
|
||||
/** @var ModuleCore\d3_dev_oxemail $oEmail */
|
||||
$oEmail = oxNew(Email::class);
|
||||
echo $oEmail->d3GetInquiryMailContent($oOrder, $sTpl);
|
||||
die();
|
||||
}
|
||||
|
@ -10,43 +10,33 @@
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ Data Development - Daniel Seifert <ds@shopmodule.com>
|
||||
* @author D³ Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link http://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
class d3_dev_thankyou_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController {}
|
||||
namespace D3\Devhelper\Modules\Application\Controller
|
||||
{
|
||||
class d3_dev_thankyou_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController {}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class d3_dev_oxorder_parent
|
||||
*/
|
||||
class d3_dev_oxorder_parent extends \OxidEsales\Eshop\Application\Model\Order {}
|
||||
namespace D3\Devhelper\Modules\Application\Model
|
||||
{
|
||||
class d3_dev_oxorder_parent extends \OxidEsales\Eshop\Application\Model\Order {}
|
||||
|
||||
/**
|
||||
* Class d3_dev_d3inquiry_parent
|
||||
*/
|
||||
class d3_dev_d3inquiry_parent extends d3inquiry {}
|
||||
class d3_dev_d3inquiry_parent extends d3inquiry {}
|
||||
|
||||
/**
|
||||
* Class d3_dev_oxorderarticle
|
||||
*/
|
||||
class d3_dev_oxorderarticle_parent extends \OxidEsales\Eshop\Application\Model\OrderArticle {}
|
||||
class d3_dev_d3inquiryarticle_parent extends d3inquiryarticle {}
|
||||
|
||||
/**
|
||||
* Class d3_dev_oxemail_parent
|
||||
*/
|
||||
class d3_dev_oxemail_parent extends \OxidEsales\Eshop\Core\Email {}
|
||||
class d3_dev_oxorderarticle_parent extends \OxidEsales\Eshop\Application\Model\OrderArticle {}
|
||||
|
||||
/**
|
||||
* Class d3_dev_order_parent
|
||||
*/
|
||||
class d3_dev_order_parent extends \OxidEsales\Eshop\Application\Controller\OrderController {}
|
||||
class d3_dev_oxbasket_parent extends \OxidEsales\Eshop\Application\Model\Basket {}
|
||||
|
||||
/**
|
||||
* Class d3_dev_oxbasket_parent
|
||||
*/
|
||||
class d3_dev_oxbasket_parent extends \OxidEsales\Eshop\Application\Model\Basket {}
|
||||
class d3_dev_oxbasketitem_parent extends \OxidEsales\Eshop\Application\Model\BasketItem {}
|
||||
|
||||
/**
|
||||
* Class d3_dev_oxbasketitem_parent
|
||||
*/
|
||||
class d3_dev_oxbasketitem_parent extends \OxidEsales\Eshop\Application\Model\BasketItem {}
|
||||
class d3_dev_order_parent extends \OxidEsales\Eshop\Application\Controller\OrderController {}
|
||||
}
|
||||
|
||||
namespace D3\Devhelper\Modules\Core
|
||||
{
|
||||
class d3_dev_oxemail_parent extends \OxidEsales\Eshop\Core\Email {}
|
||||
}
|
@ -3,7 +3,15 @@
|
||||
namespace D3\Devhelper\Modules\Application\Controller;
|
||||
|
||||
// .../?cl=thankyou[&d3orderid=23]
|
||||
use D3\Devhelper\Modules\Application\Model\d3_dev_d3inquiry;
|
||||
use D3\Devhelper\Modules\Application\Model\d3_dev_oxorder;
|
||||
use OxidEsales\Eshop\Application\Model\Order;
|
||||
use OxidEsales\Eshop\Application\Model\User;
|
||||
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
|
||||
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
|
||||
use OxidEsales\Eshop\Core\Exception\UserException;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\Eshop\Core\Request;
|
||||
|
||||
/**
|
||||
* This Software is the property of Data Development and is protected
|
||||
@ -16,17 +24,15 @@ use OxidEsales\Eshop\Core\Registry;
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ Data Development - Daniel Seifert <ds@shopmodule.com>
|
||||
* @author D³ Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link http://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
class d3_dev_thankyou extends d3_dev_thankyou_parent
|
||||
{
|
||||
/**
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
|
||||
* @throws object
|
||||
* @throws oxUserException
|
||||
* @throws DatabaseConnectionException
|
||||
* @throws DatabaseErrorException
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
@ -36,8 +42,8 @@ class d3_dev_thankyou extends d3_dev_thankyou_parent
|
||||
|
||||
Registry::getSession()->setVariable('sess_challenge', $sSessChallenge);
|
||||
|
||||
if (oxNew(\OxidEsales\Eshop\Core\Request::class)->getRequestParameter('d3dev')
|
||||
&& false == (bool) Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value
|
||||
if (Registry::get(Request::class)->getRequestEscapedParameter("d3dev")
|
||||
&& false == (bool) Registry::getConfig()->getActiveShop()->isProductiveMode()
|
||||
&& Registry::getConfig()->getConfigParam('blD3DevShowThankyou')
|
||||
) {
|
||||
$this->_d3authenticate();
|
||||
@ -47,17 +53,11 @@ class d3_dev_thankyou extends d3_dev_thankyou_parent
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws object
|
||||
* @throws oxUserException
|
||||
*/
|
||||
protected function _d3authenticate ()
|
||||
{
|
||||
$request = oxNew(\OxidEsales\Eshop\Core\Request::class);
|
||||
|
||||
try {
|
||||
$sUser = $request->getRequestParameter( 'usr' );
|
||||
$sPassword = $request->getRequestParameter( 'pwd' );
|
||||
$sUser = Registry::get(Request::class)->getRequestEscapedParameter( 'usr');
|
||||
$sPassword = Registry::get(Request::class)->getRequestEscapedParameter('pwd');
|
||||
|
||||
if ( !$sUser || !$sPassword ) {
|
||||
$sUser = $_SERVER[ 'PHP_AUTH_USER' ];
|
||||
@ -80,17 +80,17 @@ class d3_dev_thankyou extends d3_dev_thankyou_parent
|
||||
}
|
||||
}
|
||||
}
|
||||
/** @var \OxidEsales\Eshop\Application\Model\User $oUser */
|
||||
$oUser = oxNew( \OxidEsales\Eshop\Application\Model\User::class );
|
||||
/** @var User $oUser */
|
||||
$oUser = oxNew(User::class);
|
||||
if ( !$sUser || !$sPassword || !$oUser->login( $sUser, $sPassword ) ) {
|
||||
/** @var \OxidEsales\Eshop\Core\Exception\UserException $oEx */
|
||||
$oEx = oxNew( \OxidEsales\Eshop\Core\Exception\UserException::class, 'EXCEPTION_USER_NOVALIDLOGIN');
|
||||
/** @var UserException $oEx */
|
||||
$oEx = oxNew(UserException::class, 'EXCEPTION_USER_NOVALIDLOGIN');
|
||||
throw $oEx;
|
||||
}
|
||||
}
|
||||
catch ( Exception $oEx ) {
|
||||
catch ( \Exception $oEx ) {
|
||||
$oShop = Registry::getConfig()->getActiveShop();
|
||||
header( 'WWW-Authenticate: Basic realm="' . $oShop->oxshops__oxname->value . '"' );
|
||||
header( 'WWW-Authenticate: Basic realm="{' . $oShop->getFieldData('oxname') . '"' );
|
||||
header( 'HTTP/1.0 401 Unauthorized' );
|
||||
exit( 1 );
|
||||
}
|
||||
@ -98,17 +98,17 @@ class d3_dev_thankyou extends d3_dev_thankyou_parent
|
||||
|
||||
/**
|
||||
* @return bool|d3_dev_oxorder
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
|
||||
* @throws DatabaseConnectionException
|
||||
* @throws DatabaseErrorException
|
||||
*/
|
||||
public function d3GetLastOrder()
|
||||
{
|
||||
if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) {
|
||||
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @var d3_dev_oxorder $oOrder */
|
||||
$oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
|
||||
$oOrder = oxNew(Order::class);
|
||||
$oOrder->d3getLastOrder();
|
||||
|
||||
return $oOrder;
|
||||
@ -116,11 +116,11 @@ class d3_dev_thankyou extends d3_dev_thankyou_parent
|
||||
|
||||
/**
|
||||
* @return bool|d3_dev_d3inquiry
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
|
||||
* @throws DatabaseConnectionException
|
||||
*/
|
||||
public function d3GetLastInquiry()
|
||||
{
|
||||
if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) {
|
||||
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,12 @@
|
||||
|
||||
namespace D3\Devhelper\Modules\Application\Model;
|
||||
|
||||
use OxidEsales\Eshop\Application\Model\Basket;
|
||||
use OxidEsales\Eshop\Core\DatabaseProvider;
|
||||
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
|
||||
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\Eshop\Core\Request;
|
||||
|
||||
/**
|
||||
* This Software is the property of Data Development and is protected
|
||||
@ -16,7 +20,7 @@ use OxidEsales\Eshop\Core\Registry;
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ Data Development - Daniel Seifert <ds@shopmodule.com>
|
||||
* @author D³ Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link http://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
@ -26,12 +30,12 @@ class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent
|
||||
|
||||
/**
|
||||
* @return d3_dev_oxbasket
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
|
||||
* @throws DatabaseConnectionException
|
||||
* @throws DatabaseErrorException
|
||||
*/
|
||||
public function d3DevGetOrderBasket()
|
||||
{
|
||||
/** @var oxbasket $oBasket */
|
||||
/** @var Basket $oBasket */
|
||||
$this->_getInquiryBasket();
|
||||
|
||||
// unsetting bundles
|
||||
@ -53,11 +57,11 @@ class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
|
||||
* @throws DatabaseConnectionException
|
||||
*/
|
||||
public function d3getLastInquiryId()
|
||||
{
|
||||
$inquiryNr = (int) oxNew(\OxidEsales\Eshop\Core\Request::class)->getRequestParameter('d3inquirynr');
|
||||
$inquiryNr = (int) Registry::get(Request::class)->getRequestEscapedParameter('d3inquirynr');
|
||||
$sWhere = 1;
|
||||
if ($inquiryNr) {
|
||||
$sWhere = ' oxinquirynr = ' . $inquiryNr;
|
||||
@ -69,7 +73,7 @@ class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
|
||||
* @throws DatabaseConnectionException
|
||||
*/
|
||||
public function d3getLastInquiry()
|
||||
{
|
||||
@ -78,9 +82,9 @@ class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent
|
||||
}
|
||||
|
||||
/**
|
||||
* @return oxBasket
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
|
||||
* @return Basket
|
||||
* @throws DatabaseConnectionException
|
||||
* @throws DatabaseErrorException
|
||||
*/
|
||||
public function getBasket()
|
||||
{
|
||||
@ -94,8 +98,8 @@ class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
|
||||
* @throws DatabaseConnectionException
|
||||
* @throws DatabaseErrorException
|
||||
*/
|
||||
protected function _d3AddVouchers()
|
||||
{
|
||||
@ -115,14 +119,14 @@ class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent
|
||||
*
|
||||
* @param bool $blStockCheck perform stock check or not (default true)
|
||||
*
|
||||
* @return \OxidEsales\Eshop\Application\Model\Basket
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
|
||||
* @return Basket
|
||||
* @throws DatabaseConnectionException
|
||||
* @throws DatabaseErrorException
|
||||
*/
|
||||
protected function _getInquiryBasket($blStockCheck = true)
|
||||
{
|
||||
/** @var \OxidEsales\Eshop\Application\Model\Basket _oOrderBasket */
|
||||
$this->_oOrderBasket = oxNew(\OxidEsales\Eshop\Application\Model\Basket::class);
|
||||
/** @var Basket _oOrderBasket */
|
||||
$this->_oOrderBasket = oxNew(Basket::class);
|
||||
$this->_oOrderBasket->enableSaveToDataBase(false);
|
||||
|
||||
//setting recalculation mode
|
||||
@ -140,7 +144,7 @@ class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent
|
||||
// setting basket currency order uses
|
||||
$aCurrencies = Registry::getConfig()->getCurrencyArray();
|
||||
foreach ($aCurrencies as $oCur) {
|
||||
if ($oCur->name == $this->oxorder__oxcurrency->value) {
|
||||
if ($oCur->name == $this->getFieldData('oxcurrency')) {
|
||||
$oBasketCur = $oCur;
|
||||
break;
|
||||
}
|
||||
@ -150,8 +154,8 @@ class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent
|
||||
$this->_oOrderBasket->setBasketCurrency($oBasketCur);
|
||||
|
||||
// set basket card id and message
|
||||
$this->_oOrderBasket->setCardId($this->oxorder__oxcardid->value);
|
||||
$this->_oOrderBasket->setCardMessage($this->oxorder__oxcardtext->value);
|
||||
$this->_oOrderBasket->setCardId($this->getFieldData('oxcardid'));
|
||||
$this->_oOrderBasket->setCardMessage($this->getFieldData('oxcardtext'));
|
||||
|
||||
if ($this->_blReloadDiscount) {
|
||||
$oDb = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC);
|
||||
@ -166,8 +170,8 @@ class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent
|
||||
}
|
||||
} else {
|
||||
$this->_oOrderBasket->setDiscountCalcMode(false);
|
||||
$this->_oOrderBasket->setVoucherDiscount($this->oxorder__oxvoucherdiscount->value);
|
||||
$this->_oOrderBasket->setTotalDiscount($this->oxorder__oxdiscount->value);
|
||||
$this->_oOrderBasket->setVoucherDiscount($this->getFieldData('oxvoucherdiscount'));
|
||||
$this->_oOrderBasket->setTotalDiscount($this->getFieldData('oxdiscount'));
|
||||
}
|
||||
|
||||
return $this->_oOrderBasket;
|
||||
|
@ -10,16 +10,18 @@
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ Data Development - Daniel Seifert <ds@shopmodule.com>
|
||||
* @author D³ Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link http://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
namespace D3\Devhelper\Modules\Application\Model;
|
||||
|
||||
use OxidEsales\Eshop\Application\Model\ArticleList;
|
||||
|
||||
class d3_dev_d3inquiryarticle extends d3_dev_d3inquiryarticle_parent
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
* @return null|ArticleList
|
||||
*/
|
||||
public function getCustomerAlsoBoughtThisProducts()
|
||||
{
|
||||
@ -35,6 +37,6 @@ class d3_dev_d3inquiryarticle extends d3_dev_d3inquiryarticle_parent
|
||||
*/
|
||||
public function isBundle()
|
||||
{
|
||||
return ( bool ) $this->d3inquiryarticles__oxisbundle->value;
|
||||
return ( bool ) $this->getFieldData('oxisbundle');
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ use OxidEsales\Eshop\Core\Registry;
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ Data Development - Daniel Seifert <ds@shopmodule.com>
|
||||
* @author D³ Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link http://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
@ -23,7 +23,7 @@ class d3_dev_oxbasket extends d3_dev_oxbasket_parent
|
||||
{
|
||||
public function deleteBasket()
|
||||
{
|
||||
if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value
|
||||
if (Registry::getConfig()->getActiveShop()->isProductiveMode()
|
||||
|| false == Registry::getConfig()->getConfigParam('blD3DevAvoidDelBasket')
|
||||
) {
|
||||
parent::deleteBasket();
|
||||
|
@ -10,7 +10,7 @@
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ Data Development - Daniel Seifert <ds@shopmodule.com>
|
||||
* @author D³ Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link http://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
@ -25,16 +25,16 @@ class d3_dev_oxbasketitem extends d3_dev_oxbasketitem_parent
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws \OxidEsales\EshopCommunity\Application\Model\oxArticleException
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\StandardException
|
||||
* @throws oxNoArticleException
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\ArticleException
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\ArticleInputException
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\NoArticleException
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
$oArticle = $this->getArticle();
|
||||
$this->_sTitle = $oArticle->oxarticles__oxtitle->value;
|
||||
$this->_sTitle = $oArticle->getFieldData('oxtitle');
|
||||
|
||||
if ($oArticle->oxarticles__oxvarselect->value) {
|
||||
if ($oArticle->getFieldData('oxvarselect')) {
|
||||
$this->_sTitle = $this->_sTitle . ', ' . $this->getVarSelect();
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,14 @@
|
||||
|
||||
namespace D3\Devhelper\Modules\Application\Model;
|
||||
|
||||
use OxidEsales\Eshop\Application\Model\OrderArticle;
|
||||
use OxidEsales\Eshop\Application\Model\Voucher;
|
||||
use OxidEsales\Eshop\Core\DatabaseProvider;
|
||||
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
|
||||
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
|
||||
use OxidEsales\Eshop\Core\Model\ListModel;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\Eshop\Core\Request;
|
||||
|
||||
/**
|
||||
* This Software is the property of Data Development and is protected
|
||||
@ -16,7 +22,7 @@ use OxidEsales\Eshop\Core\Registry;
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ Data Development - Daniel Seifert <ds@shopmodule.com>
|
||||
* @author D³ Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link http://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
@ -31,10 +37,10 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
|
||||
$oBasket = $this->_getOrderBasket();
|
||||
|
||||
// unsetting bundles
|
||||
/** @var \OxidEsales\Eshop\Core\Model\ListModel $oOrderArticles */
|
||||
/** @var ListModel $oOrderArticles */
|
||||
$oOrderArticles = $this->getOrderArticles();
|
||||
foreach ($oOrderArticles as $sItemId => $oItem) {
|
||||
/** @var $oItem \OxidEsales\Eshop\Application\Model\OrderArticle */
|
||||
/** @var $oItem OrderArticle */
|
||||
if ($oItem->isBundle()) {
|
||||
$oOrderArticles->offsetUnset($sItemId);
|
||||
}
|
||||
@ -53,11 +59,11 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
|
||||
* @throws DatabaseConnectionException
|
||||
*/
|
||||
public function d3getLastOrderId()
|
||||
{
|
||||
$orderNr = (int) oxNew(\OxidEsales\Eshop\Core\Request::class)->getRequestParameter('d3ordernr');
|
||||
$orderNr = (int) Registry::get(Request::class)->getRequestEscapedParameter('d3ordernr');
|
||||
$sWhere = 1;
|
||||
if ($orderNr) {
|
||||
$sWhere = ' oxordernr = ' . $orderNr;
|
||||
@ -69,8 +75,8 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
|
||||
* @throws DatabaseConnectionException
|
||||
* @throws DatabaseErrorException
|
||||
*/
|
||||
public function d3getLastOrder()
|
||||
{
|
||||
@ -93,8 +99,8 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
|
||||
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
|
||||
* @throws DatabaseConnectionException
|
||||
* @throws DatabaseErrorException
|
||||
*/
|
||||
protected function _d3AddVouchers()
|
||||
{
|
||||
@ -103,7 +109,7 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
|
||||
$aResult = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getAll($sSelect);
|
||||
|
||||
foreach ($aResult as $aFields) {
|
||||
$oVoucher = oxNew(\OxidEsales\Eshop\Application\Model\Voucher::class);
|
||||
$oVoucher = oxNew(Voucher::class);
|
||||
$oVoucher->load($aFields['oxid']);
|
||||
$this->_aVoucherList[$oVoucher->getId()] = $oVoucher;
|
||||
}
|
||||
|
@ -10,16 +10,18 @@
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ Data Development - Daniel Seifert <ds@shopmodule.com>
|
||||
* @author D³ Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link http://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
namespace D3\Devhelper\Modules\Application\Model;
|
||||
|
||||
use OxidEsales\Eshop\Application\Model\ArticleList;
|
||||
|
||||
class d3_dev_oxorderarticle extends d3_dev_oxorderarticle_parent
|
||||
{
|
||||
/**
|
||||
* @return null|\OxidEsales\EshopCommunity\Application\Model\ArticleList
|
||||
* @return null|ArticleList
|
||||
*/
|
||||
public function getCustomerAlsoBoughtThisProducts()
|
||||
{
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace D3\Devhelper\Modules\Core;
|
||||
|
||||
use D3\Devhelper\Modules\Application\Model as ModuleModel;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
|
||||
/**
|
||||
@ -15,22 +16,20 @@ use OxidEsales\Eshop\Core\Registry;
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ Data Development - Daniel Seifert <ds@shopmodule.com>
|
||||
* @author D³ Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link http://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
class d3_dev_oxemail extends d3_dev_oxemail_parent
|
||||
{
|
||||
/**
|
||||
* @param d3_dev_oxorder $oOrder
|
||||
*
|
||||
* @param ModuleModel\d3_dev_oxorder $oOrder
|
||||
* @param $sType
|
||||
*
|
||||
* @return mixed|string
|
||||
*/
|
||||
public function d3GetOrderMailContent($oOrder, $sType)
|
||||
{
|
||||
if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) {
|
||||
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -64,7 +63,7 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
|
||||
|
||||
// send confirmation to shop owner
|
||||
// send not pretending from order user, as different email domain rise spam filters
|
||||
$this->setFrom($oShop->oxshops__oxowneremail->value);
|
||||
$this->setFrom($oShop->getFieldData('oxowneremail'));
|
||||
|
||||
$oLang = Registry::getLang();
|
||||
$iOrderLang = $oLang->getObjectTplLanguage();
|
||||
@ -78,7 +77,7 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
|
||||
$this->setSmtp($oShop);
|
||||
|
||||
// create messages
|
||||
/** @var Smarty $oSmarty */
|
||||
/** @var \Smarty $oSmarty */
|
||||
$oSmarty = $this->_getSmarty();
|
||||
$this->setViewData("order", $oOrder);
|
||||
|
||||
@ -89,7 +88,7 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
|
||||
}
|
||||
|
||||
/**
|
||||
* @param d3_dev_d3inquiry $oInquiry
|
||||
* @param ModuleModel\d3_dev_d3inquiry $oInquiry
|
||||
*
|
||||
* @param $sType
|
||||
*
|
||||
@ -97,7 +96,7 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
|
||||
*/
|
||||
public function d3GetInquiryMailContent($oInquiry, $sType)
|
||||
{
|
||||
if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) {
|
||||
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -131,7 +130,7 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
|
||||
|
||||
// send confirmation to shop owner
|
||||
// send not pretending from order user, as different email domain rise spam filters
|
||||
$this->setFrom($oShop->oxshops__oxowneremail->value);
|
||||
$this->setFrom($oShop->getFieldData('oxowneremail'));
|
||||
|
||||
$oLang = Registry::getLang();
|
||||
$iOrderLang = $oLang->getObjectTplLanguage();
|
||||
@ -145,7 +144,7 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
|
||||
$this->setSmtp($oShop);
|
||||
|
||||
// create messages
|
||||
/** @var Smarty $oSmarty */
|
||||
/** @var \Smarty $oSmarty */
|
||||
$oSmarty = $this->_getSmarty();
|
||||
$this->setViewData("inquiry", $oInquiry);
|
||||
|
||||
@ -157,7 +156,7 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
|
||||
|
||||
protected function _sendMail()
|
||||
{
|
||||
if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) {
|
||||
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
|
||||
return parent::_sendMail();
|
||||
}
|
||||
|
||||
@ -188,7 +187,6 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->_aRecipients = $aRecipients;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ use OxidEsales\Eshop\Core\Registry;
|
||||
*/
|
||||
$sMetadataVersion = '2.0';
|
||||
|
||||
$sStyle = class_exists('d3dev') ? "background-color: darkred; color: white; padding: 0 10px;" : "";
|
||||
$sStyle = class_exists(D3\Devhelper\Application\Controller\d3dev::class) ? "background-color: darkred; color: white; padding: 0 10px;" : "";
|
||||
|
||||
/**
|
||||
* Module information
|
||||
@ -22,12 +22,12 @@ $aModule = array(
|
||||
'id' => 'd3dev',
|
||||
'title' =>
|
||||
(class_exists(D3\ModCfg\Application\Model\d3utils::class) ? D3\ModCfg\Application\Model\d3utils::getInstance()->getD3Logo() : 'D³') .
|
||||
' <span style="'.$sStyle.'">TPL Development Tool</span>',
|
||||
' <span style="'.$sStyle.';">TPL Development Tool</span>',
|
||||
'description' => array(
|
||||
'de' => '<script type="text/javascript"><!--
|
||||
function showNote() {
|
||||
var _oElem = document.getElementById("secnote");
|
||||
if (_oElem.style.display == "block") {
|
||||
if (_oElem.style.display === "block") {
|
||||
_oElem.style.display = "none";
|
||||
} else {
|
||||
_oElem.style.display = "block";
|
||||
|
Laden…
x
Verwijs in nieuw issue
Block a user