Skip to content

Customise My Account

Steps for

How it works

My Account brings together a customer's My Details, Recent Activity (orders, quotes and their statuses), Shopping Lists, Address Book and, if turned on, Company Users. Its data comes from your eCommerce platform. For example, on Shopify, tracking numbers you add when fulfilling an order appear on the customer's order details.

You change My Account in three ways:

Allow address editing

Address editing is on by default. Customers manage their own address book in My Account: they click Add new address to add one, or use the icons next to an address to edit or delete it.

To change it, edit the customer group's Address management settings at Customers,Groups (opens in your SparkLayer Dashboard in a new tab). You can turn off address editing completely. Or you can stop customers adding and changing billing addresses only, and still let them manage other addresses. See Allow customers to edit addresses.

Setting in Address managementWhat it does
Allow address editing in My AccountBuyers can add or edit their addresses.
Allow buyers to add and edit billing addressesBuyers can set a default billing address.

Show order tracking details

Customers see tracking details on an order's details page, including for orders shipped in parts. They see a Track shipment link, the carrier and the tracking number.

When you fulfil an order in Shopify, enter the Tracking number and Shipping carrier under Tracking information (optional). A third-party app can do this for you automatically. The details then appear in My Account.

Show payment status

Alongside the order status, customers can see a Payment column showing whether each order is Paid or Unpaid. It's on by default. Turn it on or off with Payments visibility at Settings,Configurations,Ordering (opens in your SparkLayer Dashboard in a new tab) ("Show the payment status of orders in the My Account area."). See Payment methods.

Change where customers go after signing in

When a signed-in B2B customer opens your store's own account page (for example /account), SparkLayer sends them to the SparkLayer My Account interface. You can send them somewhere else instead, such as a collection page.

Shopify only

On Shopify with customer accounts (new accounts), you can do this without code:

  1. In your Shopify admin, go to Settings,Checkout (opens in your Shopify admin in a new tab).
  2. Under Configurations, click Customize.
  3. Go to the Orders page, click Apps and turn on the B2B Account Redirect extension.
  4. Optionally, add placeholder text to show customers while they're redirected, and the URL to send them to, such as a collection or landing page.

On any platform, including Shopify with legacy (classic) customer accounts, your developer or agency can add an accountRedirect to your Core Script instead.

Code for your developer
Core Script
accountRedirect: {
  urlRegex: /\/account/g,
  goTo: "/index", // page to redirect logged in users to
},

Shopify only

Different pages for different customer groups (Shopify legacy accounts)

With Shopify's legacy (classic) customer accounts, you can send each customer group to its own page, for example group ABC to /collections/wholesale-page and group XYZ to /collections/wholesale-vip. Replace the code above with Liquid code like this and change the tags and pages to suit:

Core Script
accountRedirect: {
  urlRegex: /\/account/g,

  {% assign goTo = "/index" %}
  {% for tag in customer.tags %}
    {% if tag == "b2b-group-1" %}
      {% assign goTo = "/collections/wholesale-page" %}
    {% elsif tag == "b2b-group-2" %}
      {% assign goTo = "/collections/another-wholesale-page" %}
    {% endif %}
  {% endfor %}

  goTo: {{ goTo | json }},
},

Other My Account features

These features also show in My Account, and have their own guides:

FeatureWhat it doesSee
Account credit and balancesShows the customer's credit, balance and payment terms.Credit limits and net terms
Timeline and communicationsBrings messages, internal notes, order events and email notifications for orders and quotes into one place on the order details page.Order timeline and messages
Links straight to an orderTakes a customer straight to an order's or quote's details from a link.My Account
Invoices on ordersAttaches invoices, such as PDFs, to a customer's orders.Credit limits and net terms
Imported and manual ordersShows orders created outside the SparkLayer checkout, such as Shopify admin draft orders or imported history, in the customer's order history (Shopify).Show imported or manual orders in My Account

For developers

The settings in this section are made in your SparkLayer Core Script, or with metafields (extra fields on a customer or order record in your store). Your developer or agency usually makes them.

Add custom fields to My Details

The My Details section shows the customer's email address, name, company and financial details, such as their account balance and payment terms. You can add your own fields, such as a website, phone number or account manager's email.

Add a customAccountDetails list to your Core Script. It works like custom checkout fields.

Core Script
customAccountDetails: [
  {
    title: "Website",
    value: "{{ customer.metafields.global.company_website }}",
    type: "website",
    displayText: "Visit Website",
  },
  {
    title: "Phone",
    value: "01234567890",
    type: "phone",
  },
  {
    title: "Email",
    value: "contact@sparklayer.io",
    type: "email",
    displayText: "Click to email",
  },
  {
    title: "Some normal text",
    value: "This is a normal value with no formatting",
  },
],
KeyWhat it does
titleThe label the customer sees, for example "Website".
valueThe value. Set it directly or generate it, for example from a metafield or setting.
typeOptional. Turns the value into a link: email makes a mailto: link, phone makes a tel: link and website makes a link to the value.
displayTextOptional. Text to show instead of the value, for example displayText: "Click here" for a link.

If you use sales agent ordering, fields based on a customer metafield show the sales agent's value, not the customer's, when an agent is signed in as a customer.

Rename order statuses

My Account shows each order's status, such as Processing, Shipped, Part-Shipped, Cancelled or Requires Review. See My Account for what each status means.

To change the names, add translations to your Core Script (see Languages and international):

Core Script
translations: {
  en: {
    "account.order-status.incoming": "Incoming",
    "account.order-status.returned": "Returned",
    "account.order-status.cancelled": "Cancelled",
    "account.order-status.shipped": "Shipped",
    "account.order-status.part_shipped": "Part-shipped",
    "account.order-status.part_returned": "Part-returned",
    "account.order-status.varied": "Varied",
    "account.order-status.processing": "Processing",
    "account.order-status.awaiting_approval": "Requires approval",
    "account.order-status.awaiting_merchant": "Awaiting merchant",
    "account.order-status.archived": "Archived",
  }
},  

Show the shipping address on orders

To show each order's shipping address under it in the order list, add this to the display object in your Core Script:

Core Script
display: {
  orderListShowShippingAddress: true,
},

Show a custom order ID

You can replace the order number customers see with your own (a "visible ID"), so order numbers match across your systems.

Shopify only

On Shopify, this is set with a metafield: see Shopify metafields and data mapping.

Add custom content with slots

Custom slots (or targets) are places in My Account, such as above Recent Activity, where you can add your own HTML. See Custom slots.

Advanced account settings

Customer metafields give you finer control over account and address data, for example when a backend system such as an ERP needs specific customer IDs. Each one uses the namespace sparklayer with the key below.

SettingKeyTypeWhat it does
Accounting IDaccounting_idSingle line textA unique account ID for the customer, for example from your ERP or accounts package. When set, it's added to the order's metadata in your eCommerce platform.
TitletitleSingle line textA title for the customer.
Company Namecompany_nameSingle line textThe customer's company name.
Shipping Address IDshipping_address_idSingle line textA unique shipping address ID. When set, it's the customer's default shipping address.
Billing Address IDbilling_address_idSingle line textA unique billing address ID. When set, it's the customer's default billing address.
Available Shipping Addresses by IDavailable_shipping_address_idsJSONThe shipping addresses the customer can use, by Shopify address ID, as a list. For example [9840404758756,9840404758756].

To add them on Shopify, go to Settings,Metafields and metaobjects,Customers (opens in your Shopify admin in a new tab), as Shopify metafields describes. On other platforms, see Metafields.

Lots of customers? Fill them in one tableShopify

In your Shopify admin, go to Customers, tick the customers and click Edit customers. Click Columns, tick the SparkLayer field under Metafields, then type the values (one row per customer) and click Save. Shopify's guide

Build the list of shipping address IDs

Enter each Shopify address ID the customer can use, and copy the value into Available Shipping Addresses by ID:

Build the value Fill in what you need and leave the rest blank.
Paste into sparklayer.available_shipping_address_ids
Fill in a value above

FAQs

Was this page helpful?

Last updated