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

refactor: order process -> checkout

Übergeordneter 9661977e
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -53,6 +53,12 @@ define('package/quiqqer/order/bin/frontend/controls/orderProcess/CustomerData',
VatId.addEvent('change', this.$onVatIdChange);
VatId.addEvent('keyup', this.$onVatIdChange);
var val = parseInt(this.getElm().get('data-validate'));
if (isNaN(val) || !val) {
this.openAddressEdit();
}
},
/**
......@@ -62,11 +68,10 @@ define('package/quiqqer/order/bin/frontend/controls/orderProcess/CustomerData',
},
/**
* Open the address edit
*
* @param {DOMEvent} event
* @param {DOMEvent} [event]
* @return {Promise}
*/
openAddressEdit: function (event) {
......
......@@ -123,6 +123,9 @@ public function getProducts()
* Add a product to the basket
*
* @param Product $Product
*
* @throws QUI\Exception
* @throws QUI\ERP\Products\Product\Exception
*/
public function addProduct(Product $Product)
{
......@@ -189,6 +192,11 @@ public function save()
/* @var $Product Product */
$fields = $Product->getFields();
/* @var $Field QUI\ERP\Products\Field\UniqueField */
foreach ($fields as $Field) {
$Field->setChangeableStatus(false);
}
$productData = array(
'id' => $Product->getId(),
'title' => $Product->getTitle(),
......
{if isset($Gateway)}
<section class="quiqqer-order-step-checkout quiqqer-order-step-checkout-gateway">
<header>
<h1>{locale group="quiqqer/order" var="ordering.step.title.CheckoutPayment"}</h1>
</header>
CHECKOUT
{locale group="quiqqer/order" var="ordering.step.checkoutPayment.text"}
{$gatewayDisplay}
<input type="hidden" name="paymentGateway" value="1"/>
</section>
{else}
<section class="quiqqer-order-step-checkout"
data-qui="package/quiqqer/order/bin/frontend/controls/orderProcess/Checkout"
>
......@@ -44,5 +31,4 @@
</label>
</div>
</section>
{/if}
\ No newline at end of file
</section>
\ No newline at end of file
......@@ -25,7 +25,8 @@ public function __construct($attributes = array())
parent::__construct($attributes);
$this->setAttributes([
'data-qui' => 'package/quiqqer/order/bin/frontend/controls/orderProcess/CustomerData'
'data-qui' => 'package/quiqqer/order/bin/frontend/controls/orderProcess/CustomerData',
'data-validate' => 0
]);
$this->addCSSFile(dirname(__FILE__).'/CustomerData.css');
......@@ -103,9 +104,9 @@ public function getBody()
try {
$this->validate();
$validate = true;
$this->setAttribute('data-validate', 1);
} catch (QUI\ERP\Order\Exception $Exception) {
$validate = false;
$this->setAttribute('data-validate', 0);
}
$Engine->assign([
......@@ -114,8 +115,7 @@ public function getBody()
'isB2B' => QUI\ERP\Utils\Shop::isB2B(),
'b2bSelected' => $isB2B(),
'commentMessage' => $commentMessage,
'commentCustomer' => $commentCustomer,
'validate' => $validate
'commentCustomer' => $commentCustomer
]);
return $Engine->fetch(dirname(__FILE__).'/CustomerData.html');
......
......@@ -113,7 +113,7 @@ public function __construct($attributes = [])
foreach ($products as $Product) {
try {
/* @var QUI\ERP\Order\Basket\Product $Product */
$Order->addArticle($Product->toArticle());
$Order->addArticle($Product->toArticle(null, false));
} catch (QUI\Users\Exception $Exception) {
QUI\System\Log::writeDebugException($Exception);
}
......
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