Forum
Display Customer Details
I'm working on a rather large "Shop" site, and they want to be able to add tracking information when an order is shipped. I've been able to add custom fields to "Customers" in the control panel by updating customer.html. Is there any way I can output this customer information along with the order information? For instance, there is a perch_member_get function. I can use .perch_member_get('first_name') to get their name. Is there anything like that for customers? I also know you can use perch_shop_orders() to display details about the order. I just need to be able to display these new fields that I've added to the customer.html template.
This is my current code for displaying the customer name and the order history.
<div class="container margin-top intro">
<div class="col-sm-6 border-right halved-section">
<nav class="sidebar">
<?php
if (perch_member_logged_in()) {
echo '<h2>Welcome back, '.perch_member_get('first_name').'!</h2>';
?>
<ul class="nav nav-pills nav-stacked">
<li><a href="logout"><span class="glyphicon glyphicon-off" aria-hidden="true"> </span> Log out</a></li>
<li><a href="password"><span class="glyphicon glyphicon-repeat" aria-hidden="true"> </span> Change Password</a></li>
</ul>
<?php
}else{
// Returning customer login form
perch_members_login_form();
// New customer sign up form
perch_shop_registration_form([
'template' => 'checkout/customer_create.html'
]);
}
?>
</nav>
</div>
<hr class="visible-xs">
<div class="col-sm-6 halved-section">
<?php
if (perch_member_logged_in()) {
?>
<h1>Your Account</h1>
<hr>
<h3>Recent Orders</h3>
<?php
perch_shop_orders();
}
?>
</div>
</div>
I don't think we have anything like
perch_shop_customer()
for just displaying customer details at the moment.