add inquiry templates to debug
This commit is contained in:
parent
39d5de8448
commit
4ccbdf0623
@ -1,47 +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 © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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_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
|
||||
*/
|
||||
<?php
|
||||
/**
|
||||
* This Software is the property of Data Development and is protected
|
||||
* by copyright law - it is NOT Freeware.
|
||||
*
|
||||
* Any unauthorized use of this software without a valid license
|
||||
* is a violation of the license agreement and will be prosecuted by
|
||||
* civil and criminal law.
|
||||
*
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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 {}
|
@ -1,38 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* This Software is the property of Data Development and is protected
|
||||
* by copyright law - it is NOT Freeware.
|
||||
*
|
||||
* Any unauthorized use of this software without a valid license
|
||||
* is a violation of the license agreement and will be prosecuted by
|
||||
* civil and criminal law.
|
||||
*
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ Data Development - Daniel Seifert <ds@shopmodule.com>
|
||||
* @link http://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
class d3dev extends oxUBase
|
||||
{
|
||||
public function showOrderMailContent()
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* This Software is the property of Data Development and is protected
|
||||
* by copyright law - it is NOT Freeware.
|
||||
*
|
||||
* Any unauthorized use of this software without a valid license
|
||||
* is a violation of the license agreement and will be prosecuted by
|
||||
* civil and criminal law.
|
||||
*
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ Data Development - Daniel Seifert <ds@shopmodule.com>
|
||||
* @link http://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
class d3dev extends oxUBase
|
||||
{
|
||||
public function showOrderMailContent()
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -1,82 +1,92 @@
|
||||
<?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³') .
|
||||
' <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ügung, die im Livebetrieb sicherheitskritisch sein können. Es können Kunden- und Bestelldaten ausgelesen und auch Shopfunktionen manipuliert werden. Aktivieren Sie diese Erweiterung daher nur in einem Umfeld, in dem Sie Missbrauch ausschließen können. Für entstandene Schäden lehnen wir jede Haftung ab.</p>
|
||||
<ul><li>unterbindet Löschen des WKs nach Bestellabschluss</li>'.
|
||||
'<li><a style="text-decoration: underline;" href="'.oxRegistry::getConfig()->getCurrentShopUrl(false).'index.php?cl=thankyou&d3dev=1&d3ordernr=" target="_new">Thankyou ist ohne Bestellung aufrufbar</a></li>'.
|
||||
'<li>Mail-Templates kö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">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">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">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">User Plain</a></li></ul>'.
|
||||
'</li></ul>Jede dieser Optionen muss aus Sicherheitsgründen unter "Einstell." aktiviert werden. Weiterhin darf der Shop nicht im Produktivmodus betrieben werden.',
|
||||
'en' => ''),
|
||||
// 'thumbnail' => 'picture.png',
|
||||
'version' => '0.1',
|
||||
'author' => 'D³ 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'
|
||||
),
|
||||
),
|
||||
);
|
||||
<?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³') .
|
||||
' <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ügung, die im Livebetrieb sicherheitskritisch sein können. Es können Kunden- und Bestelldaten ausgelesen und auch Shopfunktionen manipuliert werden. Aktivieren Sie diese Erweiterung daher nur in einem Umfeld, in dem Sie Missbrauch ausschließen können. Für entstandene Schäden lehnen wir jede Haftung ab.</p>
|
||||
<ul><li>unterbindet Löschen des WKs nach Bestellabschluss</li>'.
|
||||
'<li><a style="text-decoration: underline;" href="'.oxRegistry::getConfig()->getCurrentShopUrl(false).'index.php?cl=thankyou&d3dev=1&d3ordernr=" target="_new">Thankyou ist ohne Bestellung aufrufbar</a></li>'.
|
||||
'<li>Mail-Templates kö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></ul>Jede dieser Optionen muss aus Sicherheitsgründen unter "Einstell." aktiviert werden. Weiterhin darf der Shop nicht im Produktivmodus betrieben werden.',
|
||||
'en' => ''),
|
||||
// 'thumbnail' => 'picture.png',
|
||||
'version' => '0.1',
|
||||
'author' => 'D³ 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'
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
if (class_exists('d3inquiry')) {
|
||||
$aModule['extend']['d3inquiry'] = 'd3/d3dev/modules/models/d3_dev_d3inquiry';
|
||||
$aModule['extend']['d3inquiryarticle'] = 'd3/d3dev/modules/models/d3_dev_d3inquiryarticle';
|
||||
}
|
||||
|
@ -1,55 +1,71 @@
|
||||
<?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 © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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')
|
||||
) {
|
||||
$oOrder = $this->d3GetLastOrder();
|
||||
$oBasket = $oOrder->d3DevGetOrderBasket();
|
||||
$this->_oBasket = $oBasket;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
<?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 © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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')
|
||||
) {
|
||||
$oOrder = $this->d3GetLastOrder();
|
||||
$oBasket = $oOrder->d3DevGetOrderBasket();
|
||||
$this->_oBasket = $oBasket;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
|
154
copy_this/modules/d3/d3dev/modules/models/d3_dev_d3inquiry.php
Normal file
154
copy_this/modules/d3/d3dev/modules/models/d3_dev_d3inquiry.php
Normal 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 © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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;
|
||||
}
|
||||
}
|
@ -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 © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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;
|
||||
}
|
||||
}
|
@ -1,59 +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 © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* This Software is the property of Data Development and is protected
|
||||
* by copyright law - it is NOT Freeware.
|
||||
*
|
||||
* Any unauthorized use of this software without a valid license
|
||||
* is a violation of the license agreement and will be prosecuted by
|
||||
* civil and criminal law.
|
||||
*
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,23 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* This Software is the property of Data Development and is protected
|
||||
* by copyright law - it is NOT Freeware.
|
||||
*
|
||||
* Any unauthorized use of this software without a valid license
|
||||
* is a violation of the license agreement and will be prosecuted by
|
||||
* civil and criminal law.
|
||||
*
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* This Software is the property of Data Development and is protected
|
||||
* by copyright law - it is NOT Freeware.
|
||||
*
|
||||
* Any unauthorized use of this software without a valid license
|
||||
* is a violation of the license agreement and will be prosecuted by
|
||||
* civil and criminal law.
|
||||
*
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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;
|
||||
}
|
||||
}
|
||||
|
@ -1,82 +1,146 @@
|
||||
<?php
|
||||
/**
|
||||
* This Software is the property of Data Development and is protected
|
||||
* by copyright law - it is NOT Freeware.
|
||||
*
|
||||
* Any unauthorized use of this software without a valid license
|
||||
* is a violation of the license agreement and will be prosecuted by
|
||||
* civil and criminal law.
|
||||
*
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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));
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* This Software is the property of Data Development and is protected
|
||||
* by copyright law - it is NOT Freeware.
|
||||
*
|
||||
* Any unauthorized use of this software without a valid license
|
||||
* is a violation of the license agreement and will be prosecuted by
|
||||
* civil and criminal law.
|
||||
*
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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));
|
||||
}
|
||||
}
|
||||
|
@ -1,94 +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 © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* This Software is the property of Data Development and is protected
|
||||
* by copyright law - it is NOT Freeware.
|
||||
*
|
||||
* Any unauthorized use of this software without a valid license
|
||||
* is a violation of the license agreement and will be prosecuted by
|
||||
* civil and criminal law.
|
||||
*
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,28 +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 © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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();
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* This Software is the property of Data Development and is protected
|
||||
* by copyright law - it is NOT Freeware.
|
||||
*
|
||||
* Any unauthorized use of this software without a valid license
|
||||
* is a violation of the license agreement and will be prosecuted by
|
||||
* civil and criminal law.
|
||||
*
|
||||
* http://www.shopmodule.com
|
||||
*
|
||||
* @copyright © D³ Data Development, Thomas Dartsch
|
||||
* @author D³ 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();
|
||||
}
|
||||
}
|
||||
|
@ -1,49 +1,49 @@
|
||||
<?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 © D³ Data Development, Thomas Dartsch
|
||||
* @package OrderManager
|
||||
* @author D³ 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.',
|
||||
);
|
||||
<?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 © D³ Data Development, Thomas Dartsch
|
||||
* @package OrderManager
|
||||
* @author D³ 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.',
|
||||
);
|
||||
|
@ -1,4 +1,4 @@
|
||||
=> 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)
|
||||
=> 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 sind im Browser darstellbar (unter Angabe der Bestellnummer auch für eine bestimmte Bestellung)
|
Loading…
Reference in New Issue
Block a user