7 Commits

8 gewijzigde bestanden met toevoegingen van 202 en 44 verwijderingen

Bestand weergeven

@ -1,22 +1,42 @@
# Changelog
All notable changes to this project will be documented in this file.
## Unreleased
---
## 1.2.0.0
## 2.0.1.0 (2019-10-21)
### Changed
- Mails k<>nnen auch Dreingabeartikel regenieren und darstellen
- weitere Mailinformationen werden f<>r Mailumleitung ge<67>ndert
### Fixed
- verhindert Thankyou Redirect, wenn keine Order geladen wurde
- Debugging von Mails mit Dreingabebestellungen l<>scht diese Discounts in der gesamten Bestellung
---
## 2.0.0.0 (2018-02-23)
### Added
- verf<72>gbar f<>r OXID 6
- Installation via Composer
---
## 1.2.0.0 (2017-11-21)
### Added
- Mail-Anzeige fordert zus<75>tzlich Authentfikation mit einem Shopadmin-Konto
- Seitenencoding definiert
### Changed
- Dokumentation erg<72>nzt
## 1.1.0.0
---
## 1.1.0.0 (2017-05-31)
### Added
- Mailversand <20>bers Shopframework wird blockiert oder
- Mails werden an alternative Mailadresse umgeleitet
## 1.0.0.0
---
## 1.0.0.0 (2015-12-16)
### Added
- unterbindet das L<>schen des Warenkorbs nach Bestellabschluss
- Thankyou ist ohne Bestellabschluss aufrufbar (unter Angabe der Bestellnummer auch f<>r eine bestimmte Bestellung)

BIN
README.md

Binair bestand niet weergegeven.

Bestand weergeven

@ -40,7 +40,12 @@ class d3_dev_thankyou extends d3_dev_thankyou_parent
parent::init();
Registry::getSession()->setVariable('sess_challenge', $sSessChallenge);
if (Registry::get(Request::class)->getRequestEscapedParameter("d3dev")
&& false == (bool) Registry::getConfig()->getActiveShop()->isProductiveMode()
&& Registry::getConfig()->getConfigParam('blD3DevAvoidDelBasket')
) {
Registry::getSession()->setVariable( 'sess_challenge', $sSessChallenge );
}
if (Registry::get(Request::class)->getRequestEscapedParameter("d3dev")
&& false == (bool) Registry::getConfig()->getActiveShop()->isProductiveMode()
@ -96,6 +101,27 @@ class d3_dev_thankyou extends d3_dev_thankyou_parent
}
}
/**
* @return bool|d3_dev_oxorder|\oxOrder
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
public function getOrder()
{
$oOrder = parent::getOrder();
if ((false == $oOrder || !$oOrder->getFieldData('oxordernr'))
&& Registry::get(Request::class)->getRequestEscapedParameter("d3dev")
&& false == (bool) Registry::getConfig()->getActiveShop()->isProductiveMode()
&& Registry::getConfig()->getConfigParam('blD3DevShowThankyou')
) {
$this->_oOrder = $this->d3GetLastOrder();
$oOrder = $this->_oOrder;
}
return $oOrder;
}
/**
* @return bool|d3_dev_oxorder
* @throws DatabaseConnectionException

Bestand weergeven

@ -1,9 +1,5 @@
<?php
namespace D3\Devhelper\Modules\Application\Model;
use OxidEsales\Eshop\Core\Registry;
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
@ -19,6 +15,12 @@ use OxidEsales\Eshop\Core\Registry;
* @link http://www.oxidmodule.com
*/
namespace D3\Devhelper\Modules\Application\Model;
use OxidEsales\Eshop\Application\Model\BasketItem;
use OxidEsales\Eshop\Application\Model\OrderArticle;
use OxidEsales\Eshop\Core\Registry;
class d3_dev_oxbasket extends d3_dev_oxbasket_parent
{
public function deleteBasket()
@ -61,4 +63,37 @@ class d3_dev_oxbasket extends d3_dev_oxbasket_parent
}
}
}
/**
* @param OrderArticle $oOrderArticle
*
* @return |null
* @throws \oxArticleInputException
* @throws \oxNoArticleException
*/
public function d3addOrderArticleToBasket($oOrderArticle)
{
// adding only if amount > 0
if ($oOrderArticle->oxorderarticles__oxamount->value > 0) {
$this->_isForOrderRecalculation = true;
$sItemId = $oOrderArticle->getId();
//inserting new
/** @var d3_dev_oxbasketitem $oBasketItem */
$oBasketItem = oxNew( BasketItem::class);
$oBasketItem->initFromOrderArticle($oOrderArticle);
$oBasketItem->d3ConvertToArticleObject();
$oBasketItem->setWrapping($oOrderArticle->oxorderarticles__oxwrapid->value);
$oBasketItem->setBundle($oOrderArticle->isBundle());
$this->_aBasketContents[$sItemId] = $oBasketItem;
//calling update method
$this->onUpdate();
return $this->_aBasketContents[$sItemId];
}
return null;
}
}

Bestand weergeven

@ -16,6 +16,12 @@
namespace D3\Devhelper\Modules\Application\Model;
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;
class d3_dev_oxbasketitem extends d3_dev_oxbasketitem_parent
{
public function d3ClearArticle()
@ -25,9 +31,9 @@ class d3_dev_oxbasketitem extends d3_dev_oxbasketitem_parent
/**
* @return string
* @throws \OxidEsales\Eshop\Core\Exception\ArticleException
* @throws \OxidEsales\Eshop\Core\Exception\ArticleInputException
* @throws \OxidEsales\Eshop\Core\Exception\NoArticleException
* @throws ArticleException
* @throws ArticleInputException
* @throws NoArticleException
*/
public function getTitle()
{
@ -40,4 +46,19 @@ class d3_dev_oxbasketitem extends d3_dev_oxbasketitem_parent
return $this->_sTitle;
}
/**
* @throws \oxArticleInputException
* @throws \oxNoArticleException
*/
public function d3ConvertToArticleObject()
{
$oEmbeddedArticle = $this->getArticle();
if ($oEmbeddedArticle instanceof OrderArticle) {
$oArticle = oxNew(Article::class);
$oArticle->load($oEmbeddedArticle->getFieldData('oxartid'));
$this->_oArticle = $oArticle;
}
}
}

Bestand weergeven

@ -1,16 +1,5 @@
<?php
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
* by copyright law - it is NOT Freeware.
@ -26,6 +15,16 @@ use OxidEsales\Eshop\Core\Request;
* @link http://www.oxidmodule.com
*/
namespace D3\Devhelper\Modules\Application\Model;
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;
class d3_dev_oxorder extends d3_dev_oxorder_parent
{
/**
@ -36,18 +35,9 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
/** @var d3_dev_oxbasket $oBasket */
$oBasket = $this->_getOrderBasket();
// unsetting bundles
/** @var ListModel $oOrderArticles */
$oOrderArticles = $this->getOrderArticles();
foreach ($oOrderArticles as $sItemId => $oItem) {
/** @var $oItem OrderArticle */
if ($oItem->isBundle()) {
$oOrderArticles->offsetUnset($sItemId);
}
}
// add this order articles to basket and recalculate basket
$this->_addOrderArticlesToBasket($oBasket, $oOrderArticles);
$this->_d3AddOrderArticlesToBasket($oBasket, $this->getOrderArticles());
// recalculating basket
$oBasket->calculateBasket(true);
$oBasket->d3ClearBasketItemArticles();
@ -66,7 +56,7 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
$orderNr = (int) Registry::get(Request::class)->getRequestEscapedParameter('d3ordernr');
$sWhere = 1;
if ($orderNr) {
$sWhere = ' oxordernr = ' . $orderNr;
$sWhere = ' oxordernr = ' . DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->quote($orderNr);
}
$sSelect = "SELECT oxid FROM ".getViewName('oxorder')." WHERE ".$sWhere." ORDER BY oxorderdate DESC LIMIT 1";
@ -114,4 +104,21 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
$this->_aVoucherList[$oVoucher->getId()] = $oVoucher;
}
}
/**
* Adds order articles back to virtual basket. Needed for recalculating order.
*
* @param d3_dev_oxbasket $oBasket basket object
* @param ListModel $aOrderArticles order articles
*/
protected function _d3AddOrderArticlesToBasket($oBasket, $aOrderArticles)
{
// if no order articles, return empty basket
if (count($aOrderArticles) > 0) {
//adding order articles to basket
foreach ($aOrderArticles as $oOrderArticle) {
$oBasket->d3addOrderArticleToBasket($oOrderArticle);
}
}
}
}

Bestand weergeven

@ -1,10 +1,5 @@
<?php
namespace D3\Devhelper\Modules\Core;
use D3\Devhelper\Modules\Application\Model as ModuleModel;
use OxidEsales\Eshop\Core\Registry;
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
@ -20,6 +15,12 @@ use OxidEsales\Eshop\Core\Registry;
* @link http://www.oxidmodule.com
*/
namespace D3\Devhelper\Modules\Core;
use D3\Devhelper\Modules\Application\Model as ModuleModel;
use OxidEsales\Eshop\Core\Exception\StandardException;
use OxidEsales\Eshop\Core\Registry;
class d3_dev_oxemail extends d3_dev_oxemail_parent
{
/**
@ -94,7 +95,7 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
*
* @return mixed|string
*/
public function d3GetInquiryMailContent($oInquiry, $sType)
public function d3GetInquiryMailContent($oInquiry, $sType )
{
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
return '';
@ -154,6 +155,10 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
return $oSmarty->fetch($myConfig->getTemplatePath($sTpl, false));
}
/**
* @return bool
* @throws StandardException
*/
protected function _sendMail()
{
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
@ -161,6 +166,8 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
}
$this->d3clearRecipients();
$this->d3clearReplies();
$this->d3clearReplyTo();
$this->d3clearCC();
$this->d3clearBCC();
@ -190,6 +197,44 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
$this->_aRecipients = $aRecipients;
}
public function d3clearReplies()
{
$aRecipients = array();
if (is_array($this->_aReplies) && count($this->_aReplies)) {
foreach ($this->_aReplies as $aRecInfo) {
if (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))
&& $sNewRecipient != $aRecInfo[0]
) {
$aRecInfo[1] = $aRecInfo[1]." (".$aRecInfo[0].")";
$aRecInfo[0] = $sNewRecipient;
$aRecipients[] = $aRecInfo;
} elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) {
$aRecipients[] = $aRecInfo;
}
}
}
$this->_aReplies = $aRecipients;
}
public function d3clearReplyTo()
{
$aRecipients = array();
if (is_array($this->ReplyTo) && count($this->ReplyTo)) {
foreach ($this->ReplyTo as $aRecInfo) {
if (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))
&& $sNewRecipient != $aRecInfo[0]
) {
$aRecInfo[1] = $aRecInfo[1]." (".$aRecInfo[0].")";
$aRecInfo[0] = $sNewRecipient;
$aRecipients[] = $aRecInfo;
} elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) {
$aRecipients[] = $aRecInfo;
}
}
}
$this->ReplyTo = $aRecipients;
}
public function d3clearCC()
{
$aCc = array();
@ -230,6 +275,11 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
$this->bcc = $aCc;
}
/**
* @param $sMailAddress
*
* @return bool|string
*/
public function getNewRecipient($sMailAddress)
{
if (Registry::getConfig()->getConfigParam('blD3DevBlockMails')) {

Bestand weergeven

@ -53,8 +53,7 @@ $aModule = array(
'</ul><br>Jede dieser Optionen muss aus Sicherheitsgr&uuml;nden unter "Einstell." aktiviert werden. Weiterhin darf der Shop nicht im Produktivmodus betrieben werden.<br><br>'.
'* Ordernummer an URL erg&auml;nzen, wenn bestimmte Bestellungen angezeigt werden sollen',
'en' => ''),
// 'thumbnail' => 'picture.png',
'version' => '2.0.0.0',
'version' => '2.0.1.0',
'author' => 'D&sup3; Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'http://www.oxidmodule.com/',