How can I access extra customer registration form field values via the Bigcommerce API? - api

In the bigcommerce control panel, you are given the option to
add extra fields to the customer registration form.
This is shown in the control panel when Editing a customer record. They
show up, in the rendered html as this kind of thing:
<div class="field formRow ">
<label for="FormField_24"><span class="FormFieldLabel">FIELD NAME</span>
...
</label>
<div class="field-group value">
<input type="hidden" value="24" class="FormFieldId">
<input type="hidden" value="1" class="FormFieldFormId">
...
<input type="text" value="FIELD VALUE" class="field-xlarge FormField"
name="FormField[1][24]" id="FormField_24" ...>
</div>
</div>
However, walking the records with the Customer API doesn't show any of these extra fields.
Is there is anything in the Bigcommerce API that will let me access these custom customer form fields?
Update:
There are some older questions about this, that I didn't spot in searching (here, and here).
Given that those questions are from January & July last year, and still have no solution, it looks like this is simply a gap in the API. Damn.

Related

vuejs model not updating when using an address lookup

I am using a postcode search service to populate address form fields.
When an address is selected, the form fields are populated correctly, i.e. town is in town field etc.
Problem is, it doesn't update the model.
<div class="form-group address">
<label for="postcodeFormField">Postcode *</label>
<input name="postcode" v-model="contact.postcode" type="text" class="form-control" id="postcodeFormField" placeholder="SW7 3RX" required>
</div>
If I manually type into the fields, it does update the model. But the address data which displays in the form fields after an address is selected, is not being reflected in the model.
Add a ref to the input i.e ref="postcodeFormField"
Hit a method on submit button #click="myMethod()"
In that method:this.$refs.postcodeFormField.dispatchEvent(new Event('input'));

Splunk dashboard - token in search query

I'm new to Splunk, and I'm investigating the structure of an XML dashboard. I see the following in the code:
<input id="input" type="dropdown" token="serve" searchWhenChanged="false">
<label>Serve</label>
<fieldForLabel>serve</fieldForLabel>
<fieldForValue>name</fieldForValue>
<search id="search_serve">
<query>$custom_search$</query>
<earliest></earliest>
<latest></latest>
</search>
</input>
Searching through the complete XML file, I do not see the
$custom_search$
token listed anywhere. Is there another location where this token can be defined?
Try searching for custom_search instead of $custom_search$ within the XML.
When defined, the token won't include the dollar ($) signs. They are only included when the token is used.
What the provided dropdown does, is it dynamically populates dropdown values based on the output of another search passed via custom_search token
Here's an example where the dropdown is populated with the sourcetypes for either _internal or _introspection indexes. Notice how when defined, token is called custom_search
<input type="radio" token="custom_search">
and when used token is used as $custom_search$
<query>$custom_search$</query>
Feel free to slap the example in a dashboard to see it in action
<form>
<label>Search as token</label>
<fieldset submitButton="false">
<input type="radio" token="custom_search">
<label>Select Index</label>
<choice value="index=_internal |stats c by sourcetype|table sourcetype">_internal</choice>
<choice value="index=_introspection |stats c by sourcetype|table sourcetype">_introspection</choice>
<default>index=_internal |stats c by sourcetype|table sourcetype</default>
</input>
</fieldset>
<row>
<panel>
<input id="input" type="dropdown" token="serve" searchWhenChanged="false">
<label>Sourcetype</label>
<fieldForLabel>Sourcetype</fieldForLabel>
<fieldForValue>sourcetype</fieldForValue>
<search id="search_serve">
<query>$custom_search$</query>
<earliest></earliest>
<latest></latest>
</search>
</input>
</panel>
</row>
</form>
If this fixes your problem, take a moment to accept the answer. This can be done by clicking on the check mark beside the answer to toggle it from greyed out to filled in!

Experience Editor input with placeholder rendering issue in Sitecore

this issue happened when a input DOM with placeholder in Sitecore Experience Editor, does someone know how to solve this?
<div class="form-group">
<input class="form-control" placeholder="#Html.Sitecore().Field("Placeholder_Test")" value="123" />
</div>
Thanks
When Sitecore renders #Html.Sitecore().Field in Experience Editor mode, it adds extra html layout around the field value to allow content authors to edit the text.
So your generated output is something like that:
<input class="form-control" placeholder="<code attr="blah">aa</code><span>this is a text</span>" value="123" />
As you can see, this is not a valid html. And that's why you see incorrect output in Experience Editor.
What it means? That you cannot edit attributes of inputs inside Experience Editor using #Html.Sitecore().Field.
The simplest solution is to just render the value there, like (replace Sitecore.Context.Item with your datasource if needed):
<input class="form-control" placeholder="#Sitecore.Context.Item["Placeholder_Test"]" value="123" />
And to use Edit Frame to allow editing the placeholder text ( https://www.google.com/search?q=sitecore+edit+frame )

Show whitespaces in dropdown list in razor page

I have a query in SQL that return the name of my organizations with whitespaces Sql.
In my asp net core project i need to show in a dropdown list all the organizations retaining whitespaces.
<form method="get" class="form-horizontal" role="form">
<div class="col-md-2">
<label>Организация</label>
<select class="selectpicker" data-live-search="true" data-size="7" asp-items="#(new SelectList(#Model.Organizations, "Id", "Name"))" asp-for="FilterModel.OrganizationKey">
<option value="">Show Organizations</option>
</select>
</div>
My code shows the organizations w/o spaces. How can achieve that? Thanks
you may replace spaces in strings to \xA0.
This will produce during page rendering and so the user will see this as spaces.

Microformats Specifically hreview-aggregate

I had a question about microfomats and more specifically hreview-aggregate. A client implemented them a while ago but they are not showing in the SERPs however Google's rich snippet testing tool shows them working perfectly. I took a look at the code and it is currently
<div class="hreview-aggregate">
<div class="rating-45 clearfix">
<span class="rating" title="4.383 of 5 stars">4.383 of 5 stars</span>
<a tabindex="0" href="https://www.example.com/category/" title="View all xxxx Reviews">
<span class="count">View all xxxx Reviews</span>
</a>
</div>
</div>
I changed it up to include class="average" class="best" and a few other spans that they were missing.
<div class="hreview-aggregate">
<div class="rating-45 clearfix">
<span class="rating" title="4.383 of 5 stars"><span class="average">4.383</span> of <span class="best">5</span> stars</span>
<a tabindex="0" href="https://www.example.com/category/" title="View all xxxx Reviews">
View all <span class="count">xxxx</span> Reviews
</a>
</div>
</div>
Will the updated code finally show in the SERPs? Also, the page only has the rating but no reviews, should I use COUNT or VOTES?
I doubt the Google Rich Snippet Tool would pass this. The hreview-aggregate specification (specification) states an item needs to be specified that is being reviewed.
I've also seen the rich snippet tool speak of an average property, but the specification doesn't mention it, if you use value instead of average you comply to the spec and the rich snippet tool picks it up. And you should round the number to one decimal.
You should indeed use votes instead of count if the page doesn't contain any individual reviews.
This is an old question but to those still using hreview-aggregate.
The structure more or less is as follows:
<div class="hreview-aggregate">
<div class="item">
<span class="fn">Item Name</span>
</div>
<div class="rating">
<span class="average">3.5</span>
<span class="best">5</span>
<span class="count">15</span>
</div>
In your code you should have something like this:
<div class="hreview-aggregate">
<div class="item">
<span class="fn">Item Name</span>
</div>
<div class="rating-45 rating clearfix">
<span title="4.383 of 5 stars"><span class="average">4.383</span> of <span class="best">5</span> stars</span>
<a tabindex="0" href="https://www.example.com/category/" title="View all xxxx Reviews">
View all <span class="count">10</span> Reviews
</a>
</div>
</div>
So that it fully validates with: https://search.google.com/structured-data/testing-tool
Should I use COUNT or VOTES?
From the microformat doc itself: http://microformats.org/wiki/hreview-aggregate
count:: This property is used to specify the total number of reviews for the product or service.
votes:: This property is used to specify the total number of users who have rated the product or service, contributing to the average rating. For some sites, the number of votes is equal to the number of reviews, so count may be used and this property omitted.
in your case, see my example with count as I believe this is most applicable to you.
As mentioned before there are several factors that can cause google not to show it.
Google itself says:
When Google finds valid reviews or ratings markup, we may show a rich snippet that includes stars and other summary info from reviews or ratings.
Keyword: MAY
https://developers.google.com/search/docs/data-types/reviews#review-snippets
from my experience they usually do, just make sure its properly formatted and validated.