forked from verdnatura/hedera-web
Checkout improved, refactor
This commit is contained in:
parent
5ddfaf1d6c
commit
3d222a5d53
|
@ -1,4 +1,4 @@
|
||||||
hedera-web (1.405.71) stable; urgency=low
|
hedera-web (1.405.72) stable; urgency=low
|
||||||
|
|
||||||
* Initial Release.
|
* Initial Release.
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ Hedera.Checkout = new Class
|
||||||
else
|
else
|
||||||
Htk.Toast.showMessage (_('OrderStarted'));
|
Htk.Toast.showMessage (_('OrderStarted'));
|
||||||
|
|
||||||
this.hash.set ({'form': 'ecomerce/catalog'});
|
this.hash.set ({form: 'ecomerce/catalog'});
|
||||||
}
|
}
|
||||||
|
|
||||||
,onCancelClick: function ()
|
,onCancelClick: function ()
|
||||||
|
@ -92,31 +92,12 @@ Hedera.Checkout = new Class
|
||||||
}
|
}
|
||||||
|
|
||||||
,agencySteps: ['method', 'date', 'address', 'agency', 'confirm-agency']
|
,agencySteps: ['method', 'date', 'address', 'agency', 'confirm-agency']
|
||||||
,deliverySteps: ['method', 'date', 'address', null, 'confirm-delivery']
|
|
||||||
,pickupSteps: ['method', 'date', 'address', 'pickup', 'confirm-pickup']
|
,pickupSteps: ['method', 'date', 'address', 'pickup', 'confirm-pickup']
|
||||||
|
|
||||||
,stepFunc: function (stepIndex)
|
,stepFunc: function (stepIndex)
|
||||||
{
|
{
|
||||||
var steps;
|
var isDelivery = this.$('rg-method').value == 'AGENCY';
|
||||||
var isDelivery;
|
var steps = isDelivery ? this.agencySteps : this.pickupSteps;
|
||||||
|
|
||||||
switch (this.$('rg-method').value)
|
|
||||||
{
|
|
||||||
case 'AGENCY':
|
|
||||||
steps = this.agencySteps;
|
|
||||||
isDelivery = true;
|
|
||||||
break;
|
|
||||||
case 'DELIVERY':
|
|
||||||
steps = this.deliverySteps;
|
|
||||||
isDelivery = true;
|
|
||||||
break;
|
|
||||||
case 'PICKUP':
|
|
||||||
default:
|
|
||||||
steps = this.pickupSteps;
|
|
||||||
isDelivery = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
var stepId = steps[stepIndex];
|
var stepId = steps[stepIndex];
|
||||||
|
|
||||||
if (!stepId)
|
if (!stepId)
|
||||||
|
@ -130,6 +111,11 @@ Hedera.Checkout = new Class
|
||||||
_('OrderDatePickupQuestion'));
|
_('OrderDatePickupQuestion'));
|
||||||
this.$('calendar').goToSelectedMonth ();
|
this.$('calendar').goToSelectedMonth ();
|
||||||
break;
|
break;
|
||||||
|
case 'address':
|
||||||
|
Vn.Node.setText (this.$('address-question'), isDelivery ?
|
||||||
|
_('AddressQuestion'):
|
||||||
|
_('AddressQuestionPickup'));
|
||||||
|
break;
|
||||||
case 'agency':
|
case 'agency':
|
||||||
this.$('agencies').refresh ();
|
this.$('agencies').refresh ();
|
||||||
break;
|
break;
|
||||||
|
@ -144,7 +130,7 @@ Hedera.Checkout = new Class
|
||||||
,onFieldChange: function ()
|
,onFieldChange: function ()
|
||||||
{
|
{
|
||||||
if (!this.autoStepLocked)
|
if (!this.autoStepLocked)
|
||||||
setTimeout (this.goNextStep.bind (this), 75);
|
this.$('assistant').moveNext ();
|
||||||
}
|
}
|
||||||
|
|
||||||
,goNextStep: function ()
|
,goNextStep: function ()
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
,"OrderDateDeliveryQuestion": "Quin dia vols rebre la comanda?"
|
,"OrderDateDeliveryQuestion": "Quin dia vols rebre la comanda?"
|
||||||
,"OrderDatePickupQuestion": "Quin dia vols recollir la comanda?"
|
,"OrderDatePickupQuestion": "Quin dia vols recollir la comanda?"
|
||||||
,"AddressQuestion": "On vols rebre la comanda?"
|
,"AddressQuestion": "On vols rebre la comanda?"
|
||||||
|
,"AddressQuestionPickup": "A què direcció vols associar la comanda? (Opcional)"
|
||||||
,"AgencyQuestion": "Per quina agència vols rebre la comanda?"
|
,"AgencyQuestion": "Per quina agència vols rebre la comanda?"
|
||||||
,"PickupWarehouseQuestion": "En quin magatzem vols recollir la comanda?"
|
,"PickupWarehouseQuestion": "En quin magatzem vols recollir la comanda?"
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
,"OrderDateDeliveryQuestion": "What day you want to receive the order?"
|
,"OrderDateDeliveryQuestion": "What day you want to receive the order?"
|
||||||
,"OrderDatePickupQuestion": "What day you want to pickup your order?"
|
,"OrderDatePickupQuestion": "What day you want to pickup your order?"
|
||||||
,"AddressQuestion": "Where do you want to receive the order?"
|
,"AddressQuestion": "Where do you want to receive the order?"
|
||||||
|
,"AddressQuestionPickup": "To which address do you want to associate the order? (Optional)"
|
||||||
,"AgencyQuestion": "By wich agency you want to receive the order?"
|
,"AgencyQuestion": "By wich agency you want to receive the order?"
|
||||||
,"PickupWarehouseQuestion": "What store you want to pickup your order?"
|
,"PickupWarehouseQuestion": "What store you want to pickup your order?"
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
,"OrderDateDeliveryQuestion": "¿Qué día quieres recibir el pedido?"
|
,"OrderDateDeliveryQuestion": "¿Qué día quieres recibir el pedido?"
|
||||||
,"OrderDatePickupQuestion": "¿Qué día quieres recoger el pedido?"
|
,"OrderDatePickupQuestion": "¿Qué día quieres recoger el pedido?"
|
||||||
,"AddressQuestion": "¿Dónde quieres recibir el pedido?"
|
,"AddressQuestion": "¿Dónde quieres recibir el pedido?"
|
||||||
|
,"AddressQuestionPickup": "¿A qué dirección quieres asociar el pedido? (Opcional)"
|
||||||
,"AgencyQuestion": "¿Por qué agencia quieres recibir el pedido?"
|
,"AgencyQuestion": "¿Por qué agencia quieres recibir el pedido?"
|
||||||
,"PickupWarehouseQuestion": "¿En qué almacén quieres recoger el pedido?"
|
,"PickupWarehouseQuestion": "¿En qué almacén quieres recoger el pedido?"
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
,"OrderDateDeliveryQuestion": "Date de livraison?"
|
,"OrderDateDeliveryQuestion": "Date de livraison?"
|
||||||
,"OrderDatePickupQuestion": "Date retrait commande?"
|
,"OrderDatePickupQuestion": "Date retrait commande?"
|
||||||
,"AddressQuestion": "Adresse livraison?"
|
,"AddressQuestion": "Adresse livraison?"
|
||||||
|
,"AddressQuestionPickup": "À quelle adresse voulez-vous associer la commande? (Optionnel)"
|
||||||
,"AgencyQuestion": "Pour quelle agence vous souhaitez recevoir la commande?"
|
,"AgencyQuestion": "Pour quelle agence vous souhaitez recevoir la commande?"
|
||||||
,"PickupWarehouseQuestion": "Dans quel magasin vuoulez-vous retirer votre commande?"
|
,"PickupWarehouseQuestion": "Dans quel magasin vuoulez-vous retirer votre commande?"
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
,"OrderDateDeliveryQuestion": "Que dia queres receber a encomenda?"
|
,"OrderDateDeliveryQuestion": "Que dia queres receber a encomenda?"
|
||||||
,"OrderDatePickupQuestion": "Que dia queres levantar a encomenda?"
|
,"OrderDatePickupQuestion": "Que dia queres levantar a encomenda?"
|
||||||
,"AddressQuestion": "Onde queres receber a encomenda?"
|
,"AddressQuestion": "Onde queres receber a encomenda?"
|
||||||
|
,"AddressQuestionPickup": "Para qual endereço deseja associar o pedido? (Opcional)"
|
||||||
,"AgencyQuestion": "Por qual agência queres receber a encomenda?"
|
,"AgencyQuestion": "Por qual agência queres receber a encomenda?"
|
||||||
,"PickupWarehouseQuestion": "Em qual armazém queres levantar a encomenda?"
|
,"PickupWarehouseQuestion": "Em qual armazém queres levantar a encomenda?"
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,20 @@
|
||||||
</custom>
|
</custom>
|
||||||
</db-model>
|
</db-model>
|
||||||
</db-form>
|
</db-form>
|
||||||
<db-model id="agencies" auto-load="false" on-status-changed="onAgenciesReady">
|
<db-model id="agencies"
|
||||||
|
auto-load="false"
|
||||||
|
result-index="1"
|
||||||
|
on-status-changed="onAgenciesReady">
|
||||||
<custom>
|
<custom>
|
||||||
CALL vn.agencyListForMethod(#date, #address, 'AGENCY')
|
CALL vn.agencyListAvailable (#date, #address);
|
||||||
|
SELECT DISTINCT m.id, m.description
|
||||||
|
FROM tmp.agencyAvailable a
|
||||||
|
JOIN vn.agencyMode m
|
||||||
|
ON m.agencyFk = a.agencyFk
|
||||||
|
JOIN vn.deliveryMethod d
|
||||||
|
ON d.id = m.deliveryMethodFk
|
||||||
|
WHERE d.code IN ('AGENCY', 'DELIVERY');
|
||||||
|
DROP TEMPORARY TABLE tmp.agencyAvailable;
|
||||||
</custom>
|
</custom>
|
||||||
<sql-batch property="batch">
|
<sql-batch property="batch">
|
||||||
<custom>
|
<custom>
|
||||||
|
@ -32,9 +43,20 @@
|
||||||
</custom>
|
</custom>
|
||||||
</sql-batch>
|
</sql-batch>
|
||||||
</db-model>
|
</db-model>
|
||||||
<db-model id="warehouses" auto-load="false" on-status-changed="onWarehousesReady">
|
<db-model id="warehouses"
|
||||||
|
auto-load="false"
|
||||||
|
result-index="1"
|
||||||
|
on-status-changed="onWarehousesReady">
|
||||||
<custom>
|
<custom>
|
||||||
CALL vn.agencyListForMethod(#date, #address, 'PICKUP')
|
CALL vn.agencyListAvailable (#date, #address);
|
||||||
|
SELECT DISTINCT m.id, m.description
|
||||||
|
FROM tmp.agencyAvailable a
|
||||||
|
JOIN vn.agencyMode m
|
||||||
|
ON m.agencyFk = a.agencyFk
|
||||||
|
JOIN vn.deliveryMethod d
|
||||||
|
ON d.id = m.deliveryMethodFk
|
||||||
|
WHERE d.code IN ('PICKUP');
|
||||||
|
DROP TEMPORARY TABLE tmp.agencyAvailable;
|
||||||
</custom>
|
</custom>
|
||||||
<sql-batch property="batch">
|
<sql-batch property="batch">
|
||||||
<custom>
|
<custom>
|
||||||
|
@ -73,10 +95,6 @@
|
||||||
<htk-radio radio-group="rg-method" value="AGENCY"/>
|
<htk-radio radio-group="rg-method" value="AGENCY"/>
|
||||||
<label><t>ReceiveThroughtAgency</t></label>
|
<label><t>ReceiveThroughtAgency</t></label>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<htk-radio radio-group="rg-method" value="DELIVERY"/>
|
|
||||||
<label><t>ReceiveThroughtRoute</t></label>
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<htk-radio radio-group="rg-method" value="PICKUP"/>
|
<htk-radio radio-group="rg-method" value="PICKUP"/>
|
||||||
<label><t>PickupInStore</t></label>
|
<label><t>PickupInStore</t></label>
|
||||||
|
@ -84,7 +102,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="date-step">
|
<div id="date-step">
|
||||||
<h2 id="date-question"><t>OrderDateDeliveryQuestion</t></h2>
|
<h2 id="date-question"/>
|
||||||
<div class="answers">
|
<div class="answers">
|
||||||
<htk-calendar
|
<htk-calendar
|
||||||
id="calendar"
|
id="calendar"
|
||||||
|
@ -95,7 +113,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="address-step">
|
<div id="address-step">
|
||||||
<h2><t>AddressQuestion</t></h2>
|
<h2 id="address-question"/>
|
||||||
<db-form id="address-form" model="addresses"/>
|
<db-form id="address-form" model="addresses"/>
|
||||||
<div class="answers target">
|
<div class="answers target">
|
||||||
<htk-repeater
|
<htk-repeater
|
||||||
|
|
|
@ -223,10 +223,8 @@ input[type=checkbox],
|
||||||
input[type=radio]
|
input[type=radio]
|
||||||
{
|
{
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin: 0.2em;
|
margin: .2em;
|
||||||
padding: 0.3em;
|
padding: .3em;
|
||||||
width: 0.8em;
|
|
||||||
height: 0.8em;
|
|
||||||
}
|
}
|
||||||
select
|
select
|
||||||
{
|
{
|
||||||
|
@ -256,7 +254,7 @@ input[type=reset]
|
||||||
{
|
{
|
||||||
border: none;
|
border: none;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
padding: 0.5em;
|
padding: .5em;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: 0.1em;
|
border-radius: 0.1em;
|
||||||
margin: -0.5em;
|
margin: -0.5em;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "hedera-web",
|
"name": "hedera-web",
|
||||||
"version": "1.405.71",
|
"version": "1.405.72",
|
||||||
"description": "Verdnatura web page",
|
"description": "Verdnatura web page",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
Loading…
Reference in New Issue