Compare commits

..

No commits in common. "master" and "rel_1.x" have entirely different histories.

30 changed files with 1138 additions and 1326 deletions

BIN
.gitattributes vendored

Binary file not shown.

53
.gitignore vendored
View File

@ -1,53 +0,0 @@
# Created by .ignore support plugin (hsz.mobi)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
# Gradle:
.idea/**/gradle.xml
.idea/**/libraries
# CMake
cmake-build-debug/
cmake-build-release/
# Mongo Explorer plugin:
.idea/**/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

View File

@ -1,58 +0,0 @@
# Changelog
All notable changes to this project will be documented in this file.
---
## 3.0.0.1 (2021-04-28)
### Changed
- Modul verwendbar in OXID 6.3
### Fixed
- falsche prepared statement Kombination korrigiert
---
## 3.0.0.0 (2020-11-11)
### Changed
- Modul verwendbar in OXID 6.2, deprecated Code bestmöglich entfernt
- Anzeige von Anfragemails entfernt, da dazugehöriges Modul nicht weiter entwickelt wird
---
## 2.0.1.0 (2019-10-21)
### Changed
- Mails können auch Dreingabeartikel regenerieren und darstellen
- weitere Mailinformationen werden für Mailumleitung geä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ügbar für OXID 6
- Installation via Composer
---
## 1.2.0.0 (2017-11-21)
### Added
- Mail-Anzeige fordert zusätzlich Authentfikation mit einem Shopadmin-Konto
- Seitenencoding definiert
### Changed
- Dokumentation ergänzt
---
## 1.1.0.0 (2017-05-31)
### Added
- Mailversand übers Shopframework wird blockiert oder
- Mails werden an alternative Mailadresse umgeleitet
---
## 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)
- Bestellbestätigungsmails und (sofern D3-Modul installiert) Anfragebestätigungsmails sind im Browser darstellbar (unter Angabe der Bestellnummer auch für eine bestimmte Bestellung)

View File

@ -1,52 +1,35 @@
# TPL Development Helper
## Versionsübersicht:
* 3.x - OXID 6.2 bis 6.3
* 2.x - OXID 6.0 bis 6.1
* 1.x - bis OXID 4.10 / 5.3
## Installation
composer require d3/devhelper:"^3.0"
## Features
### Entwicklungswerkzeug zur Kontrolle schwer zugänglicher Shopinhalte
Diese Tool soll bei täglichen Entwicklungsaufgaben im OXID eShop helfen, die (systembedingt) vom Shopsystem erschwert werden.
* Mailversand (übers Shopframework) übers Shopframework wird blockiert __oder__
* Mails (übers Shopframework) werden an alternative Mailadresse umgeleitet
(Das Tool setzt direkt an der oxemail::_sendMail()-Methode an und kann damit __jeden__ Mailversand kontrollieren, der übers Framework läuft. Man muss nicht X verschiedene Module überwachen und hat auch Kontrolle über Mailerweiterungen, die keinen Stage-Einsatz vorsehen.)
* unterbindet das Löschen des Warenkorbs nach Bestellabschluss
* Thankyou-Seite ist auch ohne Bestellabschluss aufrufbar (unter Angabe der Bestellnummer auch für eine bestimmte Bestellung)
* Bestellbestätigungsmails und sind im Browser darstellbar (unter Angabe der Bestellnummer auch für eine bestimmte Bestellung)
## Sicherheitshinweis
Da hiermit gezielt Mails der Shopbestellungen angezeigt werden können, ist das Modul mit entsprechender Vorsicht zu verwenden. Die Hürden für die Anzeige der Mails sind daher absichtlich sehr hoch gesetzt. Vor der Verwendung sind Einstellungen zu ändern. Denken Sie unbedingt daran, diese Einstellungen im Anschluss wieder zurückzusetzen. Sonst sind Kunden- und Bestelldaten frei abrufbar. Wir übernehmen für daraus resultierenden Schäden keine Haftung.
## Verwendung
Um unser Tool verwenden zu können, folgen Sie bitte diesen Schritten:
1. Produktivmodus entfernen
![Adminbereich -> Stammdaten -> Grundeinstellungen -> Haken bei Produktivmodus entfernen](docs/step1.jpg "Produktivmodus entfernen")
2. Modul aktivieren
![Adminbereich -> Erweiterungen -> Module -> TPL Development Tool -> Aktivieren](docs/step2.jpg "Modul aktivieren")
3. In den Einstellungen die gewünschten Funktionen freischalten
![Adminbereich -> Erweiterungen -> Module -> TPL Development Tool -> Einstell.](docs/step3.jpg "gewünschte Funktionen freischalten")
4. Über die Links im Tab "Stamm" können Sie die betreffenden Seiten aufrufen. Vor der Darstellung wird ein Benutzername und Passwort abgefragt. Hierfür verwenden Sie die Anmeldedaten des Adminbereichs Ihres Shops.
5. An den E-Mail- und Thankyou-Links gibt es einen leeren Parameter, den Sie bei Bedarf mit einer Bestellnummer füllen können. Dann wird statt der letzten Bestellung ganz gezielt eine andere Bestellung zur Darstellung verwendet.
6. Beachten Sie unbedingt, dass Sie nach der Verwendung unbedingt das Modul wieder deaktivieren und den Produktivmodus wieder anschalten.
Berücksichtigen Sie bei der Darstellung der E-Mails bitte, dass die Mailprogramme diese möglicherweise anders darstellen, als der Browser dies tut. Daher kann die Darstellung im Browser nur ein Anhaltspunkt sein.
# TPL Development Helper
### Entwicklungswerkzeug zur Kontrolle schwer zugänglicher Shopinhalte
Diese Tool soll bei täglichen Entwicklungsaufgaben im OXID eShop helfen, die (systembedingt) vom Shopsystem erschwert werden.
* Mailversand (übers Shopframework) übers Shopframework wird blockiert __oder__
* Mails (übers Shopframework) werden an alternative Mailadresse umgeleitet
(Das Tool setzt direkt an der oxemail::_sendMail()-Methode an und kann damit __jeden__ Mailversand kontrollieren, der übers Framework läuft. Man muss nicht X verschiedene Module überwachen und hat auch Kontrolle über Mailerweiterungen, die keinen Stage-Einsatz vorsehen.)
* unterbindet das Löschen des Warenkorbs nach Bestellabschluss
* Thankyou-Seite ist auch ohne Bestellabschluss aufrufbar (unter Angabe der Bestellnummer auch für eine bestimmte Bestellung)
* Bestellbestätigungsmails und sind im Browser darstellbar (unter Angabe der Bestellnummer auch für eine bestimmte Bestellung)
__Da hiermit gezielt Mails der Shopbestellungen angezeigt werden können, ist das Modul mit äußerster Vorsicht zu verwenden. Die Hürden für die Anzeige der Mails sind daher absichtlich sehr hoch gesetzt. Vor der Verwendung sind Einstellungen zu ändern. Denken Sie unbedingt daran, diese Einstellungen im Anschluss wieder zurückzusetzen. Sonst sind Kunden- und Bestelldaten frei abrufbar. Wir übernehmen für daraus resultierenden Schäden keine Haftung.__
Um unser Tool verwenden zu können, folgen Sie bitte diesen Schritten:
1. Produktivmodus entfernen
![Adminbereich -> Stammdaten -> Grundeinstellungen -> Haken bei Produktivmodus entfernen](step1.jpg "Produktivmodus entfernen")
2. Modul aktivieren
![Adminbereich -> Erweiterungen -> Module -> TPL Development Tool -> Aktivieren](step2.jpg "Modul aktivieren")
3. In den Einstellungen die gewünschten Funktionen freischalten
![Adminbereich -> Erweiterungen -> Module -> TPL Development Tool -> Einstell.](step3.jpg "gewünschte Funktionen freischalten")
4. Über die Links im Tab „Stamm“ können Sie die betreffenden Seiten aufrufen. Vor der Darstellung wird ein Benutzername und Passwort abgefragt. Hierfür verwenden Sie die Anmeldedaten des Abminbereichs Ihres Shops.
5. An den E-Mail- und Thankyou-Links gibt es einen leeren Parameter, den Sie bei Bedarf mit einer Bestellnummer füllen können. Dann wird statt der letzten Bestellung ganz gezielt eine andere Bestellung zur Darstellung verwendet.
6. Beachten Sie unbedingt, dass Sie nach der Verwendung unbedingt das Modul wieder deaktivieren und den Produktivmodus wieder anschalten.
Berücksichtigen Sie bei der Darstellung der E-Mails bitte, dass die Mailprogramme diese möglicherweise anders darstellen, als der Browser dies tut. Daher kann die Darstellung im Browser nur ein Anhaltspunkt sein.

View File

@ -1,43 +0,0 @@
{
"name": "d3/devhelper",
"description": "Manipulate shop standard processes for easier development",
"type": "oxideshop-module",
"keywords": [
"oxid",
"modules",
"eShop",
"d3",
"devhelper",
"developer",
"development",
"tools",
"template",
"e-mail",
"thankyou"
],
"authors": [
{
"name": "D3 Data Development (Inh. Thomas Dartsch)",
"email": "info@shopmodule.com",
"homepage": "https://www.d3data.de"
}
],
"homepage": "https://www.oxidmodule.com/",
"license": [
"GPL-3.0-or-later"
],
"extra": {
"oxideshop": {
"source-directory": "/src",
"target-directory": "d3/devhelper"
}
},
"require": {
"oxid-esales/oxideshop-ce": "6.5 - 6.9"
},
"autoload": {
"psr-4": {
"D3\\Devhelper\\": "../../../source/modules/d3/devhelper"
}
}
}

View File

@ -0,0 +1,52 @@
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_dev_thankyou_parent extends thankyou {}
/**
* Class d3_dev_oxorder_parent
*/
class d3_dev_oxorder_parent extends oxorder {}
/**
* Class d3_dev_d3inquiry_parent
*/
class d3_dev_d3inquiry_parent extends d3inquiry {}
/**
* Class d3_dev_oxorderarticle
*/
class d3_dev_oxorderarticle_parent extends oxOrderArticle {}
/**
* Class d3_dev_oxemail_parent
*/
class d3_dev_oxemail_parent extends oxemail {}
/**
* Class d3_dev_order_parent
*/
class d3_dev_order_parent extends order {}
/**
* Class d3_dev_oxbasket_parent
*/
class d3_dev_oxbasket_parent extends oxbasket {}
/**
* Class d3_dev_oxbasketitem_parent
*/
class d3_dev_oxbasketitem_parent extends oxBasketItem {}

View File

@ -1,106 +1,112 @@
<?php
namespace D3\Devhelper\Application\Controller;
use D3\Devhelper\Modules\Application\Controller as ModuleController;
use D3\Devhelper\Modules\Core as ModuleCore;
use Exception;
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;
/**
* 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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <info@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3dev extends FrontendController
{
public function init()
{
$this->_authenticate();
parent::init();
}
protected function _authenticate ()
{
try {
$sUser = Registry::getRequest()->getRequestEscapedParameter('usr');
$sPassword = Registry::getRequest()->getRequestEscapedParameter('pwd');
if ( !$sUser || !$sPassword ) {
$sUser = $_SERVER[ 'PHP_AUTH_USER' ];
$sPassword = $_SERVER[ 'PHP_AUTH_PW' ];
}
if ( !$sUser || !$sPassword ) {
$sHttpAuthorization = $_REQUEST[ 'HTTP_AUTHORIZATION' ];
if ( $sHttpAuthorization ) {
$sUser = null;
$sPassword = null;
$aHttpAuthorization = explode( ' ', $sHttpAuthorization );
if ( is_array( $aHttpAuthorization ) && count( $aHttpAuthorization ) >= 2 && strtolower( $aHttpAuthorization[ 0 ] ) == 'basic' ) {
$sBasicAuthorization = base64_decode( $aHttpAuthorization[ 1 ] );
$aBasicAuthorization = explode( ':', $sBasicAuthorization );
if ( is_array( $aBasicAuthorization ) && count( $aBasicAuthorization ) >= 2 ) {
$sUser = $aBasicAuthorization[ 0 ];
$sPassword = $aBasicAuthorization[ 1 ];
}
}
}
}
$oUser = oxNew( User::class );
if ( !$sUser || !$sPassword || !$oUser->login( $sUser, $sPassword ) ) {
throw oxNew( UserException::class, 'EXCEPTION_USER_NOVALIDLOGIN' );
}
}
catch ( Exception $oEx ) {
$oShop = Registry::getConfig()->getActiveShop();
header( 'WWW-Authenticate: Basic realm="' . $oShop->getFieldData('oxname') . '"' );
header( 'HTTP/1.0 401 Unauthorized' );
exit( 1 );
}
}
/**
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
public function showOrderMailContent()
{
header('Content-type: text/html; charset='.Registry::getLang()->translateString('charset'));
if (Registry::getConfig()->getActiveShop()->isProductiveMode()
|| false == Registry::getConfig()->getConfigParam(ModuleCore\d3_dev_conf::OPTION_SHOWMAILSINBROWSER)
) {
Registry::getUtils()->redirect(Registry::getConfig()->getShopUrl().'index.php?cl=start');
}
$sTpl = Registry::getRequest()->getRequestEscapedParameter('type');
/** @var ModuleController\d3_dev_thankyou $oThankyou */
$oThankyou = oxNew(ThankYouController::class);
$oOrder = $oThankyou->d3GetLastOrder();
/** @var ModuleCore\d3_dev_oxemail $oEmail */
$oEmail = oxNew(Email::class);
echo $oEmail->d3GetOrderMailContent($oOrder, $sTpl);
die();
}
}
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3dev extends oxUBase
{
public function init()
{
$this->_authenticate();
parent::init();
}
protected function _authenticate ()
{
$oConfig = oxRegistry::getConfig();
try {
$sUser = $oConfig->getRequestParameter( 'usr' );
$sPassword = $oConfig->getRequestParameter( 'pwd' );
if ( !$sUser || !$sPassword ) {
$sUser = $_SERVER[ 'PHP_AUTH_USER' ];
$sPassword = $_SERVER[ 'PHP_AUTH_PW' ];
}
if ( !$sUser || !$sPassword ) {
$sHttpAuthorization = $_REQUEST[ 'HTTP_AUTHORIZATION' ];
if ( $sHttpAuthorization ) {
$sUser = null;
$sPassword = null;
$aHttpAuthorization = explode( ' ', $sHttpAuthorization );
if ( is_array( $aHttpAuthorization ) && count( $aHttpAuthorization ) >= 2 && strtolower( $aHttpAuthorization[ 0 ] ) == 'basic' ) {
$sBasicAuthorization = base64_decode( $aHttpAuthorization[ 1 ] );
$aBasicAuthorization = explode( ':', $sBasicAuthorization );
if ( is_array( $aBasicAuthorization ) && count( $aBasicAuthorization ) >= 2 ) {
$sUser = $aBasicAuthorization[ 0 ];
$sPassword = $aBasicAuthorization[ 1 ];
}
}
}
}
/** @var oxUser $oUser */
$oUser = oxNew( 'oxuser' );
if ( !$sUser || !$sPassword || !$oUser->login( $sUser, $sPassword ) ) {
$oEx = oxNew( 'oxuserexception' );
$oEx->setMessage( 'EXCEPTION_USER_NOVALIDLOGIN' );
throw $oEx;
}
}
catch ( Exception $oEx ) {
$oShop = $oConfig->getActiveShop();
header( 'WWW-Authenticate: Basic realm="' . $oShop->oxshops__oxname->value . '"' );
header( 'HTTP/1.0 401 Unauthorized' );
exit( 1 );
}
}
public function showOrderMailContent()
{
header('Content-type: text/html; charset='.oxRegistry::getLang()->translateString('charset'));
if (oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value
|| false == oxRegistry::getConfig()->getConfigParam('blD3DevShowOrderMailsInBrowser')
) {
oxRegistry::getUtils()->redirect(oxRegistry::getConfig()->getShopUrl().'index.php?cl=start');
}
$sTpl = oxRegistry::getConfig()->getRequestParameter('type');
/** @var d3_dev_thankyou $oThankyou */
$oThankyou = oxNew('thankyou');
$oOrder = $oThankyou->d3GetLastOrder();
/** @var d3_dev_oxemail $oEmail */
$oEmail = oxNew('oxemail');
echo $oEmail->d3GetOrderMailContent($oOrder, $sTpl);
die();
}
public function showInquiryMailContent()
{
if (oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value
|| false == oxRegistry::getConfig()->getConfigParam('blD3DevShowOrderMailsInBrowser')
) {
oxRegistry::getUtils()->redirect(oxRegistry::getConfig()->getShopUrl().'index.php?cl=start');
}
$sTpl = oxRegistry::getConfig()->getRequestParameter('type');
/** @var d3_dev_thankyou $oThankyou */
$oThankyou = oxNew('thankyou');
$oOrder = $oThankyou->d3GetLastInquiry();
/** @var d3_dev_oxemail $oEmail */
$oEmail = oxNew('oxemail');
echo $oEmail->d3GetInquiryMailContent($oOrder, $sTpl);
die();
}
}

View File

@ -0,0 +1,107 @@
<?php
/**
* Metadata version
*/
$sMetadataVersion = '1.1';
$sStyle = class_exists('d3dev') ? "background-color: darkred; color: white; padding: 0 10px;" : "";
/**
* Module information
*/
$aModule = array(
'id' => 'd3dev',
'title' =>
(class_exists('d3utils') ? d3utils::getInstance()->getD3Logo() : 'D&sup3;') .
' <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") {
_oElem.style.display = "none";
} else {
_oElem.style.display = "block";
}
}
--></script>
<p style="background-color: darkred; padding: 5px;"><a href="#" style="text-decoration: underline; color: white;" onclick="showNote(); return false;"><b>Sicherheitshinweis</b></a></p>
<p style="display: none; background-color: darkred; color: white; padding: 5px;" id="secnote">Diese Shoperweiterung stellt Entwicklungshilfen zur Verf&uuml;gung, die im Livebetrieb sicherheitskritisch sein k&ouml;nnen. Es k&ouml;nnen Kunden- und Bestelldaten ausgelesen und auch Shopfunktionen manipuliert werden. Aktivieren Sie diese Erweiterung daher nur in einem Umfeld, in dem Sie Missbrauch ausschlie&szligen k&ouml;nnen. F&uuml;r entstandene Sch&auml;den lehnen wir jede Haftung ab.</p>
<ul><li>unterbindet L&ouml;schen des Warenkorbs nach Bestellabschluss</li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::getConfig()->getCurrentShopUrl(false).'index.php?cl=thankyou&d3dev=1&d3ordernr=" target="_new">Thankyou-Seite ist ohne Bestellung aufrufbar*</a></li>'.
'<li>Mail-Templates k&ouml;nnen im Browser ausgegeben werden'.
'<ul>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showOrderMailContent&type=owner_html&d3ordernr=" target="_new">Order Owner HTML*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showOrderMailContent&type=owner_plain&d3ordernr=" target="_new">Order Owner Plain*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showOrderMailContent&type=user_html&d3ordernr=" target="_new">Order User HTML*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showOrderMailContent&type=user_plain&d3ordernr=" target="_new">Order User Plain*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showInquiryMailContent&type=owner_html&d3inquirynr=" target="_new">Inquiry Owner HTML*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showInquiryMailContent&type=owner_plain&d3inquirynr=" target="_new">Inquiry Owner Plain*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showInquiryMailContent&type=user_html&d3inquirynr=" target="_new">Inquiry User HTML*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showInquiryMailContent&type=user_plain&d3inquirynr=" target="_new">Inquiry User Plain*</a></li></ul>'.
'</li>'.
'<li>blockiert &uuml;bers Framework versendete Mails oder leitet diese um</li>'.
'</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' => '1.2.0.0',
'author' => 'D&sup3; Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'http://www.oxidmodule.com/',
'extend' => array(
'thankyou' => 'd3/d3dev/modules/controllers/d3_dev_thankyou',
'oxorder' => 'd3/d3dev/modules/models/d3_dev_oxorder',
'oxorderarticle' => 'd3/d3dev/modules/models/d3_dev_oxorderarticle',
'oxemail' => 'd3/d3dev/modules/models/d3_dev_oxemail',
'oxbasket' => 'd3/d3dev/modules/models/d3_dev_oxbasket',
'oxbasketitem' => 'd3/d3dev/modules/models/d3_dev_oxbasketitem',
),
'files' => array(
'd3dev' => 'd3/d3dev/controllers/d3dev.php',
),
'templates' => array(
),
'events' => array(
),
'blocks' => array(
),
'settings' => array(
array(
'group' => 'd3dev_order',
'name' => 'blD3DevAvoidDelBasket',
'type' => 'bool',
'value' => 'false'
),
array(
'group' => 'd3dev_order',
'name' => 'blD3DevShowThankyou',
'type' => 'bool',
'value' => 'false'
),
array(
'group' => 'd3dev_mail',
'name' => 'blD3DevShowOrderMailsInBrowser',
'type' => 'bool',
'value' => 'false'
),
array(
'group' => 'd3dev_mailblock',
'name' => 'blD3DevBlockMails',
'type' => 'bool',
'value' => 'false'
),
array(
'group' => 'd3dev_mailblock',
'name' => 'sD3DevRedirectMail',
'type' => 'str',
'value' => 'd3test1@shopmodule.com'
),
),
);
if (class_exists('d3inquiry')) {
$aModule['extend']['d3inquiry'] = 'd3/d3dev/modules/models/d3_dev_d3inquiry';
$aModule['extend']['d3inquiryarticle'] = 'd3/d3dev/modules/models/d3_dev_d3inquiryarticle';
}

View File

@ -0,0 +1,117 @@
<?php
// .../?cl=thankyou[&d3orderid=23]
/**
* 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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_dev_thankyou extends d3_dev_thankyou_parent
{
public function init()
{
$sSessChallenge = oxRegistry::getSession()->getVariable('sess_challenge');
parent::init();
oxRegistry::getSession()->setVariable('sess_challenge', $sSessChallenge);
if (oxRegistry::getConfig()->getRequestParameter('d3dev')
&& false == (bool) oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value
&& oxRegistry::getConfig()->getConfigParam('blD3DevShowThankyou')
) {
$this->_d3authenticate();
$oOrder = $this->d3GetLastOrder();
$oBasket = $oOrder->d3DevGetOrderBasket();
$this->_oBasket = $oBasket;
}
}
protected function _d3authenticate ()
{
$oConfig = oxRegistry::getConfig();
try {
$sUser = $oConfig->getRequestParameter( 'usr' );
$sPassword = $oConfig->getRequestParameter( 'pwd' );
if ( !$sUser || !$sPassword ) {
$sUser = $_SERVER[ 'PHP_AUTH_USER' ];
$sPassword = $_SERVER[ 'PHP_AUTH_PW' ];
}
if ( !$sUser || !$sPassword ) {
$sHttpAuthorization = $_REQUEST[ 'HTTP_AUTHORIZATION' ];
if ( $sHttpAuthorization ) {
$sUser = null;
$sPassword = null;
$aHttpAuthorization = explode( ' ', $sHttpAuthorization );
if ( is_array( $aHttpAuthorization ) && count( $aHttpAuthorization ) >= 2 && strtolower( $aHttpAuthorization[ 0 ] ) == 'basic' ) {
$sBasicAuthorization = base64_decode( $aHttpAuthorization[ 1 ] );
$aBasicAuthorization = explode( ':', $sBasicAuthorization );
if ( is_array( $aBasicAuthorization ) && count( $aBasicAuthorization ) >= 2 ) {
$sUser = $aBasicAuthorization[ 0 ];
$sPassword = $aBasicAuthorization[ 1 ];
}
}
}
}
/** @var oxUser $oUser */
$oUser = oxNew( 'oxuser' );
if ( !$sUser || !$sPassword || !$oUser->login( $sUser, $sPassword ) ) {
$oEx = oxNew( 'oxuserexception' );
$oEx->setMessage( 'EXCEPTION_USER_NOVALIDLOGIN' );
throw $oEx;
}
}
catch ( Exception $oEx ) {
$oShop = $oConfig->getActiveShop();
header( 'WWW-Authenticate: Basic realm="' . $oShop->oxshops__oxname->value . '"' );
header( 'HTTP/1.0 401 Unauthorized' );
exit( 1 );
}
}
/**
* @return d3_dev_oxorder
*/
public function d3GetLastOrder()
{
if (oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value) {
return false;
}
/** @var d3_dev_oxorder $oOrder */
$oOrder = oxNew('oxorder');
$oOrder->d3getLastOrder();
return $oOrder;
}
/**
* @return d3_dev_d3inquiry
*/
public function d3GetLastInquiry()
{
if (oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value) {
return false;
}
/** @var d3_dev_d3inquiry $oInquiry */
$oInquiry = oxNew('d3inquiry');
$oInquiry->d3getLastInquiry();
return $oInquiry;
}
}

View File

@ -0,0 +1,154 @@
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent
{
protected $_oOrderBasket = null;
/**
* @return d3_dev_oxbasket
*/
public function d3DevGetOrderBasket()
{
/** @var oxbasket $oBasket */
$oBasket = $this->_getInquiryBasket();
// unsetting bundles
$oOrderArticles = $this->getInquiryArticles();
foreach ($oOrderArticles as $sItemId => $oItem) {
if ($oItem->isBundle()) {
$oOrderArticles->offsetUnset($sItemId);
}
}
// add this order articles to basket and recalculate basket
$oBasket = $this->_addInquiryArticlesToBasket($this->getInquiryUser(), $oOrderArticles);
// recalculating basket
$oBasket->calculateBasket(true);
$oBasket->d3ClearBasketItemArticles();
return $oBasket;
}
/**
* @return string
*/
public function d3getLastInquiryId()
{
if (oxRegistry::getConfig()->getRequestParameter('d3inquirynr')) {
$sWhere = ' oxinquirynr = ' . (int) oxRegistry::getConfig()->getRequestParameter('d3inquirynr');
} else {
$sWhere = 1;
}
$sSelect = "SELECT oxid FROM ".getViewName('d3inquiry')." WHERE ".$sWhere." ORDER BY oxinquirydate DESC LIMIT 1";
return oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getOne($sSelect);
}
public function d3getLastInquiry()
{
$this->load($this->d3getLastInquiryId());
//$this->_d3AddVouchers();
}
/**
* @return oxBasket
*/
public function getBasket()
{
$oBasket = parent::getBasket();
if (false == $oBasket && oxRegistry::getConfig()->getActiveView()->getClassName() == 'd3dev') {
$oBasket = $this->d3DevGetOrderBasket();
}
return $oBasket;
}
protected function _d3AddVouchers()
{
$sSelect = "SELECT oxid FROM oxvouchers WHERE oxorderid = ".oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->quote($this->getId()).";";
$aResult = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getArray($sSelect);
foreach ($aResult as $aFields) {
$oVoucher = oxNew('oxvoucher');
$oVoucher->load($aFields['oxid']);
$this->_aVoucherList[$oVoucher->getId()] = $oVoucher;
}
}
/**
* Returns basket object filled up with discount, delivery, wrapping and all other info
*
* @param bool $blStockCheck perform stock check or not (default true)
*
* @return oxBasket
*/
protected function _getInquiryBasket($blStockCheck = true)
{
$this->_oOrderBasket = oxNew("oxBasket");
$this->_oOrderBasket->enableSaveToDataBase(false);
//setting recalculation mode
$this->_oOrderBasket->setCalculationModeNetto($this->isNettoMode());
// setting stock check mode
$this->_oOrderBasket->setStockCheckMode($blStockCheck);
// setting virtual basket user
$this->_oOrderBasket->setBasketUser($this->getInquiryUser());
// transferring order id
$this->_oOrderBasket->setInquiryId($this->getId());
// setting basket currency order uses
$aCurrencies = $this->getConfig()->getCurrencyArray();
foreach ($aCurrencies as $oCur) {
if ($oCur->name == $this->oxorder__oxcurrency->value) {
$oBasketCur = $oCur;
break;
}
}
// setting currency
$this->_oOrderBasket->setBasketCurrency($oBasketCur);
// set basket card id and message
$this->_oOrderBasket->setCardId($this->oxorder__oxcardid->value);
$this->_oOrderBasket->setCardMessage($this->oxorder__oxcardtext->value);
if ($this->_blReloadDiscount) {
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
// disabling availability check
$this->_oOrderBasket->setSkipVouchersChecking(true);
// add previously used vouchers
$sQ = 'select oxid from oxvouchers where oxorderid = ' . $oDb->quote($this->getId());
$aVouchers = $oDb->getAll($sQ);
foreach ($aVouchers as $aVoucher) {
$this->_oOrderBasket->addVoucher($aVoucher['oxid']);
}
} else {
$this->_oOrderBasket->setDiscountCalcMode(false);
$this->_oOrderBasket->setVoucherDiscount($this->oxorder__oxvoucherdiscount->value);
$this->_oOrderBasket->setTotalDiscount($this->oxorder__oxdiscount->value);
}
return $this->_oOrderBasket;
}
}

View File

@ -0,0 +1,38 @@
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_dev_d3inquiryarticle extends d3_dev_d3inquiryarticle_parent
{
/**
* @return array
*/
public function getCustomerAlsoBoughtThisProducts()
{
$oArticle = $this->getArticle();
return $oArticle->getCustomerAlsoBoughtThisProducts();
}
/**
* Returns true if ordered product is bundle
*
* @return bool
*/
public function isBundle()
{
return ( bool ) $this->d3inquiryarticles__oxisbundle->value;
}
}

View File

@ -0,0 +1,59 @@
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_dev_oxbasket extends d3_dev_oxbasket_parent
{
public function deleteBasket()
{
if (oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value
|| false == oxRegistry::getConfig()->getConfigParam('blD3DevAvoidDelBasket')
) {
parent::deleteBasket();
}
// else do nothing;
}
public function d3ClearBasketItemArticles()
{
/** @var d3_dev_oxbasketitem $oBasketItem */
foreach ($this->_aBasketContents as $oBasketItem) {
$oBasketItem->d3ClearArticle();
}
}
/**
* Calculates total basket discount value.
*/
protected function _calcBasketTotalDiscount()
{
if ($this->_oTotalDiscount === null || (!$this->isAdmin())) {
$this->_oTotalDiscount = $this->_getPriceObject();
if (is_array($this->_aDiscounts)) {
foreach ($this->_aDiscounts as $oDiscount) {
// skipping bundle discounts
if ($oDiscount->sType == 'itm') {
continue;
}
// add discount value to total basket discount
$this->_oTotalDiscount->add($oDiscount->dDiscount);
}
}
}
}
}

View File

@ -0,0 +1,35 @@
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_dev_oxbasketitem extends d3_dev_oxbasketitem_parent
{
public function d3ClearArticle()
{
$this->_oArticle = null;
}
public function getTitle()
{
$oArticle = $this->getArticle();
$this->_sTitle = $oArticle->oxarticles__oxtitle->value;
if ($oArticle->oxarticles__oxvarselect->value) {
$this->_sTitle = $this->_sTitle . ', ' . $this->getVarSelect();
}
return $this->_sTitle;
}
}

View File

@ -0,0 +1,234 @@
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_dev_oxemail extends d3_dev_oxemail_parent
{
/**
* @param d3_dev_oxorder $oOrder
*
* @return mixed|string
*/
public function d3GetOrderMailContent($oOrder, $sType)
{
if (oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value) {
return '';
}
switch (strtolower($sType)) {
case 'owner_html':
$sTpl = $this->_sOrderOwnerTemplate;
break;
case 'owner_plain':
$sTpl = $this->_sOrderOwnerPlainTemplate;
break;
case 'user_plain':
$sTpl = $this->_sOrderUserPlainTemplate;
break;
case 'user_html':
default:
$sTpl = $this->_sOrderUserTemplate;
}
$myConfig = $this->getConfig();
$oShop = $this->_getShop();
// cleanup
$this->_clearMailer();
// add user defined stuff if there is any
$oOrder = $this->_addUserInfoOrderEMail($oOrder);
$oUser = $oOrder->getOrderUser();
$this->setUser($oUser);
// send confirmation to shop owner
// send not pretending from order user, as different email domain rise spam filters
$this->setFrom($oShop->oxshops__oxowneremail->value);
$oLang = oxRegistry::getLang();
$iOrderLang = $oLang->getObjectTplLanguage();
// if running shop language is different from admin lang. set in config
// we have to load shop in config language
if ($oShop->getLanguage() != $iOrderLang) {
$oShop = $this->_getShop($iOrderLang);
}
$this->setSmtp($oShop);
// create messages
$oSmarty = $this->_getSmarty();
$this->setViewData("order", $oOrder);
// Process view data array through oxoutput processor
$this->_processViewArray();
return $oSmarty->fetch($myConfig->getTemplatePath($sTpl, false));
}
/**
* @param d3_dev_d3inquiry $oInquiry
*
* @return mixed|string
*/
public function d3GetInquiryMailContent($oInquiry, $sType)
{
if (oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value) {
return '';
}
switch (strtolower($sType)) {
case 'owner_html':
$sTpl = $this->_sInquiryOwnerTemplate;
break;
case 'owner_plain':
$sTpl = $this->_sInquiryOwnerPlainTemplate;
break;
case 'user_plain':
$sTpl = $this->_sInquiryUserPlainTemplate;
break;
case 'user_html':
default:
$sTpl = $this->_sInquiryUserTemplate;
}
$myConfig = $this->getConfig();
$oShop = $this->_getShop();
// cleanup
$this->_clearMailer();
// add user defined stuff if there is any
$oInquiry = $this->_addUserInfoOrderEMail($oInquiry);
$oUser = $oInquiry->getInquiryUser();
$this->setUser($oUser);
// send confirmation to shop owner
// send not pretending from order user, as different email domain rise spam filters
$this->setFrom($oShop->oxshops__oxowneremail->value);
$oLang = oxRegistry::getLang();
$iOrderLang = $oLang->getObjectTplLanguage();
// if running shop language is different from admin lang. set in config
// we have to load shop in config language
if ($oShop->getLanguage() != $iOrderLang) {
$oShop = $this->_getShop($iOrderLang);
}
$this->setSmtp($oShop);
// create messages
$oSmarty = $this->_getSmarty();
$this->setViewData("inquiry", $oInquiry);
// Process view data array through oxoutput processor
$this->_processViewArray();
return $oSmarty->fetch($myConfig->getTemplatePath($sTpl, false));
}
protected function _sendMail()
{
if (oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value) {
return parent::_sendMail();
}
$this->d3clearRecipients();
$this->d3clearCC();
$this->d3clearBCC();
if (count($this->getRecipient())) {
return parent::_sendMail();
}
return true;
}
public function d3clearRecipients()
{
$aRecipients = array();
if (is_array($this->_aRecipients) && count($this->_aRecipients)) {
foreach ($this->_aRecipients 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->_aRecipients = $aRecipients;
}
public function d3clearCC()
{
$aCc = array();
if (is_array($this->cc) && count($this->cc)) {
foreach ($this->cc as $aRecInfo) {
if (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))
&& $sNewRecipient != $aRecInfo[0]
) {
$aRecInfo[1] = $aRecInfo[1]." (".$aRecInfo[0].")";
$aRecInfo[0] = $sNewRecipient;
$aCc[] = $aRecInfo;
} elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) {
$aCc[] = $aRecInfo;
}
}
}
$this->cc = $aCc;
}
public function d3clearBCC()
{
$aCc = array();
if (is_array($this->bcc) && count($this->bcc)) {
foreach ($this->bcc as $aRecInfo) {
if (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))
&& $sNewRecipient != $aRecInfo[0]
) {
$aRecInfo[1] = $aRecInfo[1]." (".$aRecInfo[0].")";
$aRecInfo[0] = $sNewRecipient;
$aCc[] = $aRecInfo;
} elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) {
$aCc[] = $aRecInfo;
}
}
}
$this->bcc = $aCc;
}
public function getNewRecipient($sMailAddress)
{
if (oxRegistry::getConfig()->getConfigParam('blD3DevBlockMails')) {
return false;
} elseif (oxRegistry::getConfig()->getConfigParam('sD3DevRedirectMail')) {
return trim(oxRegistry::getConfig()->getConfigParam('sD3DevRedirectMail'));
}
return $sMailAddress;
}
}

View File

@ -0,0 +1,94 @@
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_dev_oxorder extends d3_dev_oxorder_parent
{
/**
* @return d3_dev_oxbasket
*/
public function d3DevGetOrderBasket()
{
/** @var d3_dev_oxbasket $oBasket */
$oBasket = $this->_getOrderBasket();
// unsetting bundles
$oOrderArticles = $this->getOrderArticles();
foreach ($oOrderArticles as $sItemId => $oItem) {
if ($oItem->isBundle()) {
$oOrderArticles->offsetUnset($sItemId);
}
}
// add this order articles to basket and recalculate basket
$this->_addOrderArticlesToBasket($oBasket, $oOrderArticles);
// recalculating basket
$oBasket->calculateBasket(true);
$oBasket->d3ClearBasketItemArticles();
$this->_oPayment = $this->_setPayment($oBasket->getPaymentId());
return $oBasket;
}
/**
* @return string
*/
public function d3getLastOrderId()
{
if (oxRegistry::getConfig()->getRequestParameter('d3ordernr')) {
$sWhere = ' oxordernr = ' . (int) oxRegistry::getConfig()->getRequestParameter('d3ordernr');
} else {
$sWhere = 1;
}
$sSelect = "SELECT oxid FROM ".getViewName('oxorder')." WHERE ".$sWhere." ORDER BY oxorderdate DESC LIMIT 1";
return oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getOne($sSelect);
}
public function d3getLastOrder()
{
$this->load($this->d3getLastOrderId());
$this->_d3AddVouchers();
}
/**
* @return oxBasket
*/
public function getBasket()
{
$oBasket = parent::getBasket();
if (false == $oBasket && oxRegistry::getConfig()->getActiveView()->getClassName() == 'd3dev') {
$oBasket = $this->d3DevGetOrderBasket();
}
return $oBasket;
}
protected function _d3AddVouchers()
{
$sSelect = "SELECT oxid FROM oxvouchers WHERE oxorderid = ".oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->quote($this->getId()).";";
$aResult = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getArray($sSelect);
foreach ($aResult as $aFields) {
$oVoucher = oxNew('oxvoucher');
$oVoucher->load($aFields['oxid']);
$this->_aVoucherList[$oVoucher->getId()] = $oVoucher;
}
}
}

View File

@ -1,35 +1,28 @@
<?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 © Data Development, Thomas Dartsch
* @author 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|ArticleList
*/
public function getCustomerAlsoBoughtThisProducts()
{
$oArticle = $this->getArticle();
/** @var ArticleList $artList */
$artList = $oArticle->getCustomerAlsoBoughtThisProducts();
return $artList;
}
}
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_dev_oxorderarticle extends d3_dev_oxorderarticle_parent
{
/**
* @return array
*/
public function getCustomerAlsoBoughtThisProducts()
{
$oArticle = $this->getArticle();
return $oArticle->getCustomerAlsoBoughtThisProducts();
}
}

View File

@ -1,57 +1,57 @@
<?php
/**
* TPL Development Tool
* 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 © Data Development, Thomas Dartsch
* @package OrderManager
* @author Data Development - Daniel Seifert <support@shopmodule.com>
* @link http://www.oxidmodule.com
*/
$sLangName = "Deutsch";
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = array(
//Navigation
'charset' => 'UTF-8',
'SHOP_MODULE_GROUP_d3dev_order' => 'Bestellungsablauf manipulieren',
'SHOP_MODULE_blD3DevAvoidDelBasket' => 'Warenkorb wird nach Bestellabschluss nicht geleert',
'HELP_SHOP_MODULE_blD3DevAvoidDelBasket' => 'Damit kann auf der Bestellbestätigungsseite '.
'(Thankyou) durch den "zurück"-Button in den Warenkorb Schritt 4 gewechselt werden und die Bestellung erneut '.
'abgeschickt werden. Eine erneute Bestückung des Warenkorbs ist nicht nötig. Beim erneuten Absenden wird '.
'jeweils eine weitere Bestellung angelegt werden. Eventuell verwendete Gutscheine müssen so eingestellt '.
'werden, dass diese mehrfach verwendet werden können.',
'SHOP_MODULE_blD3DevShowThankyou' => 'Thankyou-Seite kann auch ohne Bestellung '.
'aufgerufen werden',
'HELP_SHOP_MODULE_blD3DevShowThankyou' => 'Ohne abgesendete Bestellung läßt sich die '.
'Thankyou-Seite im Standardshop nicht aufrufen. Diese Option stellt dies für Entwicklungszwecke zur '.
'Verfügung. <br>Den Link zum Seitenaufruf haben wir hier im Stamm-Tab hinterlegt. Die Seite öffnet sich in '.
'einem neuen Browserfenster. <br>Für die Anzeige wird die letzte vorliegende Bestellung geladen. Über den '.
'Parameter "d3ordernr=X" kann eine bestimmten Bestellung vorgegeben werden.',
'SHOP_MODULE_GROUP_d3dev_mail' => 'Mailanzeige',
'SHOP_MODULE_blD3DevShowOrderMailsInBrowser' => 'Bestellbestätigungsmails können im Browser '.
'angezeigt werden',
'HELP_SHOP_MODULE_blD3DevShowOrderMailsInBrowser' => 'Die Links zu den '.
'jeweiligen Mails sind im Stamm-Tab aufgelistet.<br>Für die Anzeige wird ohne Angabe der Bestellnummer die '.
'letzte vorliegende Bestellung geladen. Über den Parameter "d3ordernr=X" kann eine bestimmten Bestellung '.
'vorgegeben werden.',
'SHOP_MODULE_GROUP_d3dev_mailblock' => 'Mailversand',
'SHOP_MODULE_blD3DevBlockMails' => 'Mails an beliebige Mailadressen werden nicht '.
'versandt',
'HELP_SHOP_MODULE_blD3DevBlockMails' => 'Der Mailversand wird komplett geblockt.',
'SHOP_MODULE_sD3DevRedirectMail' => 'versendete Mails an diese Adresse umleiten',
'HELP_SHOP_MODULE_sD3DevRedirectMail' => 'Wenn leer, erfolgt keine Umleitung. Ohne '.
'zusätzliche Blockieroption werden die Mails dann an den original Empfänger gesendet.',
);
<?php
/**
* TPL Development Tool
* 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 © Data Development, Thomas Dartsch
* @package OrderManager
* @author Data Development - Daniel Seifert <support@shopmodule.com>
* @link http://www.oxidmodule.com
*/
$sLangName = "Deutsch";
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = array(
//Navigation
'charset' => 'ISO-8859-15',
'SHOP_MODULE_GROUP_d3dev_order' => 'Bestellungsablauf manipulieren',
'SHOP_MODULE_blD3DevAvoidDelBasket' => 'Warenkorb wird nach Bestellabschluss nicht geleert',
'HELP_SHOP_MODULE_blD3DevAvoidDelBasket' => 'Damit kann auf der Bestellbestätigungsseite '.
'(Thankyou) durch den "zurück"-Button in den Warenkorb Schritt 4 gewechselt werden und die Bestellung erneut '.
'abgeschickt werden. Eine erneute Bestückung des Warenkorbs ist nicht nötig. Beim erneuten Absenden wird '.
'jeweils eine weitere Bestellung angelegt werden. Eventuell verwendete Gutscheine müssen so eingestellt '.
'werden, dass diese mehrfach verwendet werden können.',
'SHOP_MODULE_blD3DevShowThankyou' => 'Thankyou-Seite kann auch ohne Bestellung '.
'aufgerufen werden',
'HELP_SHOP_MODULE_blD3DevShowThankyou' => 'Ohne abgesendete Bestellung läßt sich die '.
'Thankyou-Seite im Standardshop nicht aufrufen. Diese Option stellt dies für Entwicklungszwecke zur '.
'Verfügung. <br>Den Link zum Seitenaufruf haben wir hier im Stamm-Tab hinterlegt. Die Seite öffnet sich in '.
'einem neuen Browserfenster. <br>Für die Anzeige wird die letzte vorliegende Bestellung geladen. Über den '.
'Parameter "d3ordernr=X" kann eine bestimmten Bestellung vorgegeben werden.',
'SHOP_MODULE_GROUP_d3dev_mail' => 'Mailanzeige',
'SHOP_MODULE_blD3DevShowOrderMailsInBrowser' => 'Bestellbestätigungsmails können im Browser '.
'angezeigt werden',
'HELP_SHOP_MODULE_blD3DevShowOrderMailsInBrowser' => 'Die Links zu den '.
'jeweiligen Mails sind im Stamm-Tab aufgelistet.<br>Für die Anzeige wird ohne Angabe der Bestellnummer die '.
'letzte vorliegende Bestellung geladen. Über den Parameter "d3ordernr=X" kann eine bestimmten Bestellung '.
'vorgegeben werden.',
'SHOP_MODULE_GROUP_d3dev_mailblock' => 'Mailversand',
'SHOP_MODULE_blD3DevBlockMails' => 'Mails an beliebige Mailadressen werden nicht '.
'versandt',
'HELP_SHOP_MODULE_blD3DevBlockMails' => 'Der Mailversand wird komplett geblockt.',
'SHOP_MODULE_sD3DevRedirectMail' => 'versendete Mails an diese Adresse umleiten',
'HELP_SHOP_MODULE_sD3DevRedirectMail' => 'Wenn leer, erfolgt keine Umleitung. Ohne '.
'zusätzliche Blockieroption werden die Mails dann an den original Empfänger gesendet.',
);

View File

16
setup+doku/changelog.txt Normal file
View File

@ -0,0 +1,16 @@
Hinweise zur Benutzung und Konfiguration sind in der Metadata-Modulbeschreibung enthalten.
Diese können nach Installation im Backend des OXID-Shops unter "Erweiterungen -> Module" eingesehen werden.
=> 1.2.0.0
- Dokuemntation ergänzt
- Mail-Anzeige fordert zusätzlich Authentfikation mit einem Shopadmin-Konto
- Seitenencoding definiert
=> 1.1.0.0
- Mailversand übers Shopframework wird blockiert oder
- Mails werden an alternative Mailadresse umgeleitet
=> 1.0.0.0
- unterbindet das Löschen des Warenkorbs nach Bestellabschluss
- Thankyou ist ohne Bestellabschluss aufrufbar (unter Angabe der Bestellnummer auch für eine bestimmte Bestellung)
- Bestellbestätigungsmails und (sofern D3-Modul installiert) Anfragebestätigungsmails sind im Browser darstellbar (unter Angabe der Bestellnummer auch für eine bestimmte Bestellung)

View File

@ -1,48 +0,0 @@
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <info@shopmodule.com>
* @link http://www.oxidmodule.com
*/
namespace D3\Devhelper\Modules\Application\Controller
{
use OxidEsales\Eshop\Application\Controller\ThankYouController;
class d3_dev_thankyou_parent extends ThankYouController {}
}
namespace D3\Devhelper\Modules\Application\Model
{
use OxidEsales\Eshop\Application\Controller\OrderController;
use OxidEsales\Eshop\Application\Model\Basket;
use OxidEsales\Eshop\Application\Model\BasketItem;
use OxidEsales\Eshop\Application\Model\Order;
use OxidEsales\Eshop\Application\Model\OrderArticle;
class d3_dev_oxorder_parent extends Order {}
class d3_dev_oxorderarticle_parent extends OrderArticle {}
class d3_dev_oxbasket_parent extends Basket {}
class d3_dev_oxbasketitem_parent extends BasketItem {}
class d3_dev_order_parent extends OrderController {}
}
namespace D3\Devhelper\Modules\Core
{
use OxidEsales\Eshop\Core\Email;
class d3_dev_oxemail_parent extends Email {}
}

View File

@ -1,174 +0,0 @@
<?php
namespace D3\Devhelper\Modules\Application\Controller;
// .../?cl=thankyou[&d3orderid=23]
use D3\Devhelper\Modules\Application\Model\d3_dev_oxorder;
use D3\Devhelper\Modules\Core\d3_dev_conf;
use Exception;
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 oxOrder;
/**
* 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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <info@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_dev_thankyou extends d3_dev_thankyou_parent
{
/**
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
public function init()
{
$sSessChallenge = Registry::getSession()->getVariable('sess_challenge');
parent::init();
if (Registry::getRequest()->getRequestEscapedParameter("d3dev")
&& false == (bool) Registry::getConfig()->getActiveShop()->isProductiveMode()
&& Registry::getConfig()->getConfigParam(d3_dev_conf::OPTION_PREVENTDELBASKET)
) {
Registry::getSession()->setVariable( 'sess_challenge', $sSessChallenge );
}
if ($this->d3DevCanShowThankyou()) {
$this->_d3authenticate();
$oOrder = $this->d3GetLastOrder();
$this->_oBasket = $oOrder->d3DevGetOrderBasket();
}
}
/**
* @return bool
*/
public function d3DevCanShowThankyou()
{
return Registry::getRequest()->getRequestEscapedParameter("d3dev")
&& false == (bool) Registry::getConfig()->getActiveShop()->isProductiveMode()
&& Registry::getConfig()->getConfigParam(d3_dev_conf::OPTION_SHOWTHANKYOU);
}
/**
* @return string
*/
public function render()
{
$currentClass = '';
if ($this->d3DevCanShowThankyou()) {
$currentClass = $this->getViewConfig()->getViewConfigParam('cl');
}
$ret = parent::render();
if ($this->d3DevCanShowThankyou()) {
$this->getViewConfig()->setViewConfigParam('cl', $currentClass);
}
return $ret;
}
protected function _d3authenticate ()
{
try {
$sUser = Registry::getRequest()->getRequestEscapedParameter( 'usr');
$sPassword = Registry::getRequest()->getRequestEscapedParameter('pwd');
if ( !$sUser || !$sPassword ) {
$sUser = $_SERVER[ 'PHP_AUTH_USER' ];
$sPassword = $_SERVER[ 'PHP_AUTH_PW' ];
}
if ( !$sUser || !$sPassword ) {
$sHttpAuthorization = $_REQUEST[ 'HTTP_AUTHORIZATION' ];
if ( $sHttpAuthorization ) {
$sUser = null;
$sPassword = null;
$aHttpAuthorization = explode( ' ', $sHttpAuthorization );
if ( is_array( $aHttpAuthorization ) && count( $aHttpAuthorization ) >= 2 && strtolower( $aHttpAuthorization[ 0 ] ) == 'basic' ) {
$sBasicAuthorization = base64_decode( $aHttpAuthorization[ 1 ] );
$aBasicAuthorization = explode( ':', $sBasicAuthorization );
if ( is_array( $aBasicAuthorization ) && count( $aBasicAuthorization ) >= 2 ) {
$sUser = $aBasicAuthorization[ 0 ];
$sPassword = $aBasicAuthorization[ 1 ];
}
}
}
}
/** @var User $oUser */
$oUser = oxNew(User::class);
if ( !$sUser || !$sPassword || !$oUser->login( $sUser, $sPassword ) ) {
/** @var UserException $oEx */
$oEx = oxNew(UserException::class, 'EXCEPTION_USER_NOVALIDLOGIN');
throw $oEx;
}
}
catch ( Exception $oEx ) {
$oShop = Registry::getConfig()->getActiveShop();
header( 'WWW-Authenticate: Basic realm="{' . $oShop->getFieldData('oxname') . '"' );
header( 'HTTP/1.0 401 Unauthorized' );
exit( 1 );
}
}
/**
* @return bool|d3_dev_oxorder|oxOrder
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
public function getOrder()
{
$oOrder = parent::getOrder();
if ((false == $oOrder || !$oOrder->getFieldData('oxordernr'))
&& $this->d3DevCanShowThankyou()
) {
try {
$this->_oOrder = $this->d3GetLastOrder();
$oOrder = $this->_oOrder;
if (!$oOrder || !$oOrder->getFieldData('oxordernr')) {
throw oxNew(\RuntimeException::class, 'unknown order');
}
} catch (Exception $e) {
die($e->getMessage());
}
}
return $oOrder;
}
/**
* @return bool|d3_dev_oxorder
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
public function d3GetLastOrder()
{
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
return false;
}
/** @var d3_dev_oxorder $oOrder */
$oOrder = oxNew(Order::class);
$oOrder->d3getLastOrder();
return $oOrder;
}
}

View File

@ -1,102 +0,0 @@
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <info@shopmodule.com>
* @link http://www.oxidmodule.com
*/
namespace D3\Devhelper\Modules\Application\Model;
use D3\Devhelper\Modules\Core\d3_dev_conf;
use oxArticleInputException;
use OxidEsales\Eshop\Application\Model\BasketItem;
use OxidEsales\Eshop\Application\Model\OrderArticle;
use OxidEsales\Eshop\Core\Registry;
use oxNoArticleException;
class d3_dev_oxbasket extends d3_dev_oxbasket_parent
{
public function deleteBasket()
{
if (Registry::getConfig()->getActiveShop()->isProductiveMode()
|| false == Registry::getConfig()->getConfigParam(d3_dev_conf::OPTION_PREVENTDELBASKET)
) {
parent::deleteBasket();
}
// else do nothing;
}
public function d3ClearBasketItemArticles()
{
/** @var d3_dev_oxbasketitem $oBasketItem */
foreach ($this->_aBasketContents as $oBasketItem) {
$oBasketItem->d3ClearArticle();
}
}
/**
* Calculates total basket discount value.
*/
protected function _calcBasketTotalDiscount()
{
if ($this->_oTotalDiscount === null || (!$this->isAdmin())) {
$this->_oTotalDiscount = $this->_getPriceObject();
if (is_array($this->_aDiscounts)) {
foreach ($this->_aDiscounts as $oDiscount) {
// skipping bundle discounts
if ($oDiscount->sType == 'itm') {
continue;
}
// add discount value to total basket discount
$this->_oTotalDiscount->add($oDiscount->dDiscount);
}
}
}
}
/**
* @param OrderArticle $oOrderArticle
*
* @return d3_dev_oxbasketitem|null
* @throws oxArticleInputException
* @throws oxNoArticleException
*/
public function d3addOrderArticleToBasket($oOrderArticle)
{
// adding only if amount > 0
if ($oOrderArticle->getFieldData('oxamount') > 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->getFieldData('oxwrapid'));
$oBasketItem->setBundle($oOrderArticle->isBundle());
$this->_aBasketContents[$sItemId] = $oBasketItem;
//calling update method
$this->onUpdate();
return $this->_aBasketContents[$sItemId];
}
return null;
}
}

View File

@ -1,66 +0,0 @@
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <info@shopmodule.com>
* @link http://www.oxidmodule.com
*/
namespace D3\Devhelper\Modules\Application\Model;
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;
class d3_dev_oxbasketitem extends d3_dev_oxbasketitem_parent
{
public function d3ClearArticle()
{
$this->_oArticle = null;
}
/**
* @return string
* @throws ArticleException
* @throws ArticleInputException
* @throws NoArticleException
*/
public function getTitle()
{
$oArticle = $this->getArticle();
$this->_sTitle = $oArticle->getFieldData('oxtitle');
if ($oArticle->getFieldData('oxvarselect')) {
$this->_sTitle = $this->_sTitle . ', ' . $this->getVarSelect();
}
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;
}
}
}

View File

@ -1,137 +0,0 @@
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <info@shopmodule.com>
* @link http://www.oxidmodule.com
*/
namespace D3\Devhelper\Modules\Application\Model;
use oxarticleinputexception;
use OxidEsales\Eshop\Application\Model\Basket;
use OxidEsales\Eshop\Application\Model\Order;
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 oxnoarticleexception;
class d3_dev_oxorder extends d3_dev_oxorder_parent
{
/**
* @return d3_dev_oxbasket
*/
public function d3DevGetOrderBasket()
{
/** @var d3_dev_oxbasket $oBasket */
$oBasket = $this->_getOrderBasket();
// add this order articles to basket and recalculate basket
$this->_d3AddOrderArticlesToBasket($oBasket, $this->getOrderArticles());
// recalculating basket
$oBasket->calculateBasket(true);
$oBasket->d3ClearBasketItemArticles();
$this->_oPayment = $this->_setPayment($oBasket->getPaymentId());
return $oBasket;
}
/**
* @return string
* @throws DatabaseConnectionException
*/
public function d3getLastOrderId()
{
$orderNr = (int) Registry::getRequest()->getRequestEscapedParameter('d3ordernr');
$sWhere = 1;
$parameters = [];
if ($orderNr) {
$sWhere = ' oxordernr = ? ';
$parameters[] = $orderNr;
}
$sSelect = "SELECT oxid FROM ".oxNew(Order::class)->getViewName()." WHERE ".
"oxuserid != '' AND ".
"oxshopid = ".Registry::getConfig()->getShopId()." AND ".
$sWhere." ORDER BY oxorderdate DESC LIMIT 1";
return DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getOne($sSelect, $parameters);
}
/**
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
public function d3getLastOrder()
{
$this->load($this->d3getLastOrderId());
$this->_d3AddVouchers();
}
/**
* @return d3_dev_oxbasket|Basket
*/
public function getBasket()
{
$oBasket = parent::getBasket();
if (false == $oBasket && Registry::getConfig()->getActiveView()->getClassKey() == 'd3dev') {
$oBasket = $this->d3DevGetOrderBasket();
}
return $oBasket;
}
/**
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
protected function _d3AddVouchers()
{
$sSelect = "SELECT oxid FROM ".oxNew(Voucher::class)->getViewName()." WHERE oxorderid = ?";
$aResult = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getAll(
$sSelect,
[$this->getId()]
);
foreach ($aResult as $aFields) {
$oVoucher = oxNew(Voucher::class);
$oVoucher->load($aFields['oxid']);
$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
* @throws oxArticleInputException
* @throws oxNoArticleException
*/
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);
}
}
}
}

View File

@ -1,29 +0,0 @@
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <info@shopmodule.com>
* @link http://www.oxidmodule.com
*/
namespace D3\Devhelper\Modules\Core;
class d3_dev_conf
{
const OPTION_PREVENTDELBASKET = 'blD3DevAvoidDelBasket';
const OPTION_SHOWTHANKYOU = 'blD3DevShowThankyou';
const OPTION_SHOWMAILSINBROWSER = 'blD3DevShowOrderMailsInBrowser';
const OPTION_BLOCKMAIL = 'blD3DevBlockMails';
const OPTION_REDIRECTMAIL = 'sD3DevRedirectMail';
}

View File

@ -1,245 +0,0 @@
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <info@shopmodule.com>
* @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;
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererBridgeInterface;
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererInterface;
class d3_dev_oxemail extends d3_dev_oxemail_parent
{
/**
* @param ModuleModel\d3_dev_oxorder $oOrder
* @param $sType
* @return mixed|string
*/
public function d3GetOrderMailContent($oOrder, $sType)
{
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
return '';
}
switch (strtolower($sType)) {
case 'owner_html':
$sTpl = $this->_sOrderOwnerTemplate;
break;
case 'owner_plain':
$sTpl = $this->_sOrderOwnerPlainTemplate;
break;
case 'user_plain':
$sTpl = $this->_sOrderUserPlainTemplate;
break;
case 'user_html':
default:
$sTpl = $this->_sOrderUserTemplate;
}
$myConfig = Registry::getConfig();
$oShop = $this->_getShop();
// cleanup
$this->_clearMailer();
// add user defined stuff if there is any
$oOrder = $this->_addUserInfoOrderEMail($oOrder);
$oUser = $oOrder->getOrderUser();
$this->setUser($oUser);
// send confirmation to shop owner
// send not pretending from order user, as different email domain rise spam filters
$this->setFrom($oShop->getFieldData('oxowneremail'));
$oLang = Registry::getLang();
$iOrderLang = $oLang->getObjectTplLanguage();
// if running shop language is different from admin lang. set in config
// we have to load shop in config language
if ($oShop->getLanguage() != $iOrderLang) {
$oShop = $this->_getShop($iOrderLang);
}
$this->setSmtp($oShop);
// create messages
$this->setViewData("order", $oOrder);
// Process view data array through oxoutput processor
$this->_processViewArray();
$renderer = $this->getRenderer();
return $renderer->renderTemplate($myConfig->getTemplatePath($sTpl, false), $this->getViewData());
}
/**
* required because private in Email class
* Templating instance getter
*
* @return TemplateRendererInterface
*/
protected function getRenderer()
{
$bridge = ContainerFactory::getInstance()->getContainer()
->get(TemplateRendererBridgeInterface::class);
$bridge->setEngine($this->_getSmarty());
return $bridge->getTemplateRenderer();
}
/**
* @param $aRecInfo
* @param array $aCc
* @return array
*/
public function d3ChangeRecipient($aRecInfo, array $aCc): array
{
if (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))
&& $sNewRecipient != $aRecInfo[0]
) {
$aRecInfo[1] = $aRecInfo[1] . " (" . $aRecInfo[0] . ")";
$aRecInfo[0] = $sNewRecipient;
$aCc[] = $aRecInfo;
} elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) {
$aCc[] = $aRecInfo;
}
return $aCc;
}
/**
* @return bool
* @throws StandardException
*/
protected function _sendMail()
{
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
return parent::_sendMail();
}
$this->d3clearRecipients();
$this->d3clearReplies();
$this->d3clearReplyTo();
$this->d3clearCC();
$this->d3clearBCC();
if (count($this->getRecipient())) {
return parent::_sendMail();
}
return true;
}
/**
* @return bool
* @throws StandardException
*/
protected function sendMail()
{
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
return parent::sendMail();
}
$this->d3clearRecipients();
$this->d3clearReplies();
$this->d3clearReplyTo();
$this->d3clearCC();
$this->d3clearBCC();
if (count($this->getRecipient())) {
return parent::sendMail();
}
return true;
}
public function d3clearRecipients()
{
$aRecipients = array();
if (is_array($this->_aRecipients) && count($this->_aRecipients)) {
foreach ($this->_aRecipients as $aRecInfo) {
$aRecipients = $this->d3ChangeRecipient($aRecInfo, $aRecipients);
}
}
$this->_aRecipients = $aRecipients;
}
public function d3clearReplies()
{
$aRecipients = array();
if (is_array($this->_aReplies) && count($this->_aReplies)) {
foreach ($this->_aReplies as $aRecInfo) {
$aRecipients = $this->d3ChangeRecipient($aRecInfo, $aRecipients);
}
}
$this->_aReplies = $aRecipients;
}
public function d3clearReplyTo()
{
$aRecipients = array();
if (is_array($this->ReplyTo) && count($this->ReplyTo)) {
foreach ($this->ReplyTo as $aRecInfo) {
$aRecipients = $this->d3ChangeRecipient($aRecInfo, $aRecipients);
}
}
$this->ReplyTo = $aRecipients;
}
public function d3clearCC()
{
$aCc = array();
if (is_array($this->cc) && count($this->cc)) {
foreach ($this->cc as $aRecInfo) {
$aCc = $this->d3ChangeRecipient($aRecInfo, $aCc);
}
}
$this->cc = $aCc;
}
public function d3clearBCC()
{
$aCc = array();
if (is_array($this->bcc) && count($this->bcc)) {
foreach ($this->bcc as $aRecInfo) {
$aCc = $this->d3ChangeRecipient($aRecInfo, $aCc);
}
}
$this->bcc = $aCc;
}
/**
* @param $sMailAddress
*
* @return bool|string
*/
public function getNewRecipient($sMailAddress)
{
if (Registry::getConfig()->getConfigParam(d3_dev_conf::OPTION_BLOCKMAIL)) {
return false;
} elseif (Registry::getConfig()->getConfigParam(d3_dev_conf::OPTION_REDIRECTMAIL)) {
return trim(Registry::getConfig()->getConfigParam(d3_dev_conf::OPTION_REDIRECTMAIL));
}
return $sMailAddress;
}
}

View File

@ -1,121 +0,0 @@
<?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 © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <info@shopmodule.com>
* @link http://www.oxidmodule.com
*/
use D3\Devhelper\Application\Controller\d3dev;
use D3\Devhelper\Modules\Core as ModuleCore;
use D3\Devhelper\Modules\Application\Controller as ModuleController;
use D3\Devhelper\Modules\Application\Model as ModuleModel;
use OxidEsales\Eshop\Application\Controller as OxidController;
use OxidEsales\Eshop\Application\Model as OxidModel;
use OxidEsales\Eshop\Core as OxidCore;
use OxidEsales\Eshop\Core\Registry;
/**
* Metadata version
*/
$sMetadataVersion = '2.1';
$sLogo = '<img src="https://logos.oxidmodule.com/d3logo.svg" alt="(D3)" style="height:1em;width:1em"> ';
$shopUrl = function_exists('oxNew') ? Registry::getConfig()->getCurrentShopUrl(false) : '../';
/**
* Module information
*/
$aModule = array(
'id' => 'd3dev',
'title' => [
'de' => $sLogo . 'TPL Entwicklerwerkzeug',
'en' => $sLogo . 'TPL Development Tool'
],
'description' => [
'de' => '<script type="text/javascript"><!--
function showNote() {
let _oElem = document.getElementById("secnote");
if (_oElem.style.display === "block") {
_oElem.style.display = "none";
} else {
_oElem.style.display = "block";
}
}
--></script>
<p style="background-color: darkred; padding: 5px;"><a href="#" style="text-decoration: underline; color: white;" onclick="showNote(); return false;"><b>Sicherheitshinweis</b></a></p>
<p style="display: none; background-color: darkred; color: white; padding: 5px;" id="secnote">Diese Shoperweiterung stellt Entwicklungshilfen zur Verf&uuml;gung, die im Livebetrieb sicherheitskritisch sein k&ouml;nnen. Es k&ouml;nnen Kunden- und Bestelldaten ausgelesen und auch Shopfunktionen manipuliert werden. Aktivieren Sie diese Erweiterung daher nur in einem Umfeld, in dem Sie Missbrauch ausschlie&szligen k&ouml;nnen. F&uuml;r entstandene Sch&auml;den lehnen wir jede Haftung ab.</p>
<ul><li>unterbindet L&ouml;schen des Warenkorbs nach Bestellabschluss</li>'.
'<li><a style="text-decoration: underline;" href="'.$shopUrl.'index.php?cl=thankyou&d3dev=1&d3ordernr=" target="_new">Thankyou-Seite ist ohne Bestellung aufrufbar*</a></li>'.
'<li>Mail-Templates k&ouml;nnen im Browser ausgegeben werden'.
'<ul>'.
'<li><a style="text-decoration: underline;" href="'.$shopUrl.'index.php?cl=d3dev&fnc=showOrderMailContent&type=owner_html&d3ordernr=" target="_new">Order Owner HTML*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.$shopUrl.'index.php?cl=d3dev&fnc=showOrderMailContent&type=owner_plain&d3ordernr=" target="_new">Order Owner Plain*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.$shopUrl.'index.php?cl=d3dev&fnc=showOrderMailContent&type=user_html&d3ordernr=" target="_new">Order User HTML*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.$shopUrl.'index.php?cl=d3dev&fnc=showOrderMailContent&type=user_plain&d3ordernr=" target="_new">Order User Plain*</a></li>'.
'</li>'.
'<li>blockiert &uuml;bers Framework versendete Mails oder leitet diese um</li>'.
'</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' => ''],
'version' => '3.0.0.1',
'author' => 'D&sup3; Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'http://www.oxidmodule.com/',
'extend' => [
OxidController\ThankYouController::class => ModuleController\d3_dev_thankyou::class,
OxidModel\Order::class => ModuleModel\d3_dev_oxorder::class,
OxidModel\OrderArticle::class => ModuleModel\d3_dev_oxorderarticle::class,
OxidCore\Email::class => ModuleCore\d3_dev_oxemail::class,
OxidModel\Basket::class => ModuleModel\d3_dev_oxbasket::class,
OxidModel\BasketItem::class => ModuleModel\d3_dev_oxbasketitem::class,
],
'controllers' => [
'd3dev' => d3dev::class,
],
'templates' => [],
'events' => [],
'blocks' => [],
'settings' => [
[
'group' => 'd3dev_order',
'name' => ModuleCore\d3_dev_conf::OPTION_PREVENTDELBASKET,
'type' => 'bool',
'value' => 'false'
],
[
'group' => 'd3dev_order',
'name' => ModuleCore\d3_dev_conf::OPTION_SHOWTHANKYOU,
'type' => 'bool',
'value' => 'false'
],
[
'group' => 'd3dev_mail',
'name' => ModuleCore\d3_dev_conf::OPTION_SHOWMAILSINBROWSER,
'type' => 'bool',
'value' => 'false'
],
[
'group' => 'd3dev_mailblock',
'name' => ModuleCore\d3_dev_conf::OPTION_BLOCKMAIL,
'type' => 'bool',
'value' => 'false'
],
[
'group' => 'd3dev_mailblock',
'name' => ModuleCore\d3_dev_conf::OPTION_REDIRECTMAIL,
'type' => 'str',
'value' => 'd3test1@shopmodule.com'
],
],
);

View File

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 151 KiB

View File

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 145 KiB

View File

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 134 KiB