Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Accept 1 address for both shipping and billing #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
this.resetModel();
},
save() {
this.model.shipping = this.type == 'shipping' ? true : false;
this.model.billing = this.type == 'billing' ? true : false;
// this.model.shipping = this.type == 'shipping' ? true : false;
// this.model.billing = this.type == 'billing' ? true : false;
this.model.user_id = this.customer.id;

if (this.creating) {
Expand Down Expand Up @@ -46,11 +46,13 @@
this.creating = false;
var address = this.addresses[item];
this.model = address;
/*
if (address.shipping) {
this.type = 'shipping';
} else {
this.type = 'billing';
}
*/

this.editing = true;
this.title = "Edit Address";
Expand Down Expand Up @@ -80,7 +82,7 @@
state: '',
zip: '',
country: '',
shipping: true,
shipping: false, // true
billing: false
};

Expand All @@ -106,7 +108,8 @@
<th width="10%">State</th>
<th>Zip</th>
<th>Country</th>
<th>Shipping / Billing</th>
<!-- <th>Shipping / Billing</th> -->
<th>Type</th>
<th width="7%"></th>
</tr>
</thead>
Expand All @@ -130,8 +133,13 @@
<td>{{ address.zip }}</td>
<td>{{ address.country }}</td>
<td>
<span class="text-info" v-if="address.shipping">Shipping</span>
<span class="black" v-if="address.shipping && address.billing">/</span>
<span class="text-info" v-if="address.billing">Billing</span>
<!--
<span class="text-info" v-if="address.shipping">Shipping</span>
<span class="text-warning" v-if="address.billing">Billing</span>
-->
</td>
<td>
<button class="btn btn-action btn-default" @click="edit(index)"><fa icon="edit"></fa></button>
Expand Down Expand Up @@ -221,10 +229,22 @@
<div class="col-md-6">
<div class="form-group">
<label>Type</label>
<ul class="list-unstyled list-inline">
<li class="list-inline-item">
<label>Shipping</label>
<input type="checkbox" v-model="model.shipping" id="shipping">
</li>
<li class="list-inline-item">
<label>Billing</label>
<input type="checkbox" v-model="model.billing" id="billing">
</li>
</ul>
<!--
<select class="form-control" v-model="type">
<option value="shipping">Shipping</option>
<option value="billing">Billing</option>
</select>
-->
</div>
</div>
</div>
Expand All @@ -236,4 +256,4 @@

</candy-modal>
</div>
</template>
</template>