Skip to content
Code-Schnipsel Gruppen Projekte
Commit 0c64f0c1 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

refactor: order process

Übergeordneter 0a9ebcde
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -19,11 +19,9 @@ function ($orderId) {
$Output = new QUI\Output();
$result = $OrderProcess->create();
$css = QUI\Control\Manager::getCSS();
$css = QUI\Control\Manager::getCSS();
return $Output->parse($css . $result);
return $Output->parse($css.$result);
},
array('orderId')
);
......@@ -156,6 +156,7 @@ define('package/quiqqer/order/bin/frontend/controls/OrderProcess', [
});
}
Prom.then(function () {
QUIAjax.get('package_quiqqer_order_ajax_frontend_order_getControl', function (html) {
self.getElm().set('html', html);
......@@ -177,9 +178,13 @@ define('package/quiqqer/order/bin/frontend/controls/OrderProcess', [
next: function () {
var self = this;
if (!parseInt(this.$Form.get('data-products-count'))) {
return Promise.resolve();
}
this.$beginResultRendering();
this.saveCurrentStep().then(function () {
return this.saveCurrentStep().then(function () {
return new Promise(function (resolve, reject) {
QUIAjax.get('package_quiqqer_order_ajax_frontend_order_getNext', function (result) {
self.$renderResult(result).then(resolve);
......@@ -202,9 +207,13 @@ define('package/quiqqer/order/bin/frontend/controls/OrderProcess', [
previous: function () {
var self = this;
if (!parseInt(this.$Form.get('data-products-count'))) {
return Promise.resolve();
}
this.$beginResultRendering(false);
this.saveCurrentStep().then(function () {
return this.saveCurrentStep().then(function () {
return new Promise(function (resolve) {
QUIAjax.get('package_quiqqer_order_ajax_frontend_order_getPrevious', function (result) {
self.$renderResult(result, false).then(resolve);
......@@ -224,9 +233,13 @@ define('package/quiqqer/order/bin/frontend/controls/OrderProcess', [
send: function () {
var self = this;
if (!parseInt(this.$Form.get('data-products-count'))) {
return Promise.resolve();
}
this.$beginResultRendering();
this.saveCurrentStep().then(function () {
return this.saveCurrentStep().then(function () {
return new Promise(function (resolve, reject) {
QUIAjax.get('package_quiqqer_order_ajax_frontend_order_send', function (result) {
self.$renderResult(result).then(resolve);
......@@ -250,6 +263,11 @@ define('package/quiqqer/order/bin/frontend/controls/OrderProcess', [
openStep: function (step) {
var self = this;
if (!parseInt(this.$Form.get('data-products-count'))) {
var FirstLi = this.$Timeline.getElement('li:first-child');
step = FirstLi.get('data-step');
}
this.$beginResultRendering();
this.saveCurrentStep().then(function () {
......
......@@ -38,15 +38,16 @@ public function __construct($attributes = array())
parent::__construct($attributes);
$this->addCSSFile(dirname(__FILE__) . '/Basket.css');
$this->addCSSFile(dirname(__FILE__).'/Basket.css');
}
/**
* @param null|QUI\Locale $Locale
* @return string
*/
public function getName()
public function getName($Locale = null)
{
return 'basket';
return 'Basket';
}
/**
......@@ -109,7 +110,7 @@ public function getBody()
'count' => $Articles->count()
));
return $Engine->fetch(dirname(__FILE__) . '/Basket.html');
return $Engine->fetch(dirname(__FILE__).'/Basket.html');
}
/**
......
......@@ -67,11 +67,12 @@ public function getBody()
}
/**
* @param null|QUI\Locale $Locale
* @return string
*/
public function getName()
public function getName($Locale = null)
{
return 'checkout';
return 'Checkout';
}
/**
......
......@@ -30,15 +30,16 @@ public function getBody()
'User' => $Order->getCustomer()
));
return $Engine->fetch(dirname(__FILE__) . '/Delivery.html');
return $Engine->fetch(dirname(__FILE__).'/Delivery.html');
}
/**
* @param null|QUI\Locale $Locale
* @return string
*/
public function getName()
public function getName($Locale = null)
{
return 'delivery';
return 'Delivery';
}
/**
......
......@@ -29,15 +29,16 @@ public function getBody()
'User' => $Order->getCustomer()
));
return $Engine->fetch(dirname(__FILE__) . '/Finish.html');
return $Engine->fetch(dirname(__FILE__).'/Finish.html');
}
/**
* @param null|QUI\Locale $Locale
* @return string
*/
public function getName()
public function getName($Locale = null)
{
return 'finish';
return 'Finish';
}
/**
......
......@@ -122,6 +122,10 @@
width: 100%;
}
.quiqqer-order-ordering-buttons a {
text-decoration: none;
}
.quiqqer-order-ordering-buttons-next {
float: right;
}
......
<form name="order"
action="{url site=$Site}"
method="post"
data-products-count="{$Order->count()}"
>
<div class="quiqqer-order-ordering-timeline">
<ul>
......
......@@ -13,17 +13,17 @@ interface OrderingStepInterface
/**
* Return the step name
*
* @param null|\QUI\Locale $Locale
* @return string
*/
public function getName();
public function getName($Locale = null);
/**
* @param null $Locale
* @param null|\QUI\Locale $Locale $Locale
* @return mixed
*/
public function getTitle($Locale = null);
/**
* @throws Exception
*/
......
......@@ -55,12 +55,8 @@ public static function onRequest(QUI\Rewrite $Rewrite, $requestedUrl)
$hash = false;
$title = '/Bestellungen/';
if (strpos($requestedUrl, '#')) {
$hashParts = explode('#', $requestedUrl);
if (isset($hashParts[1])) {
$hash = $hashParts[1];
}
if (isset($_REQUEST['order'])) {
$hash = $_REQUEST['order'];
}
$Process = new OrderProcess();
......@@ -81,6 +77,11 @@ public static function onRequest(QUI\Rewrite $Rewrite, $requestedUrl)
Debugger::barDump($hash, 'Order Hash');
Debugger::barDump($parts, 'Order Parts');
Debugger::barDump($requestedUrl, 'Requested url');
if ($Process->getOrder()) {
Debugger::barDump($Process->getOrder()->getId(), 'ORDER ID');
}
$Site = new QUI\Projects\Site\Virtual(array(
'id' => 1,
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren