How to Filter category data without change URL and querystring in bigcommerce - bigcommerce

I am new in bigcommerce and I using the stencil and bigcommerce/stencil-utils.
When I filter data from provided option then add query string with existing URL as per below URL.
https://gemsnytest.mybigcommerce.com/loose-gemstones/?_bc_fsnf=1&carat[]=0.46&carat[]=3
After then data filter.
Any possible way to product data filter data without add query string in URL in bigcommerce
Please help.

This is not natively possible with Cornerstone and you would have to build this out yourself.
One option would be to create & inject custom scripts on custom catalog templates that can handle the filtering with JS, compared to how BigCommerce natively handles this, with query strings. The method BigCommerce is using with query strings could be useful from a merchandising/marketing perspective as you can link to your filtered results as its own page so that's something to consider when thinking of alternatives without present in the url.
Depending on the priority, size and flexibility needed for this requirement and where you are in your site building process, you could also consider building out a headless storefront. You could use the GraphQL API to query catalog results, or our S2S APIs. To handle the filtering, you could look at storing this in the state (if you were to build a storefront with a state management library) or something custom to your liking that can handle the filtering in a more discrete way.

Related

TYPO3 - Insert api medipim

I want to call products on a web page via the api of Medipim. I have never done this before and I have never worked with TYPO3.
Therefore two questions.
In which (config) file do I place the authentication (I have an ID and secret key) and what exactly does that code look like?
When I want to call up the products, how do I use this in the TYPO3 page environment? Do I have to choose a html page or can I just enter it in the TYPO3 editor on a page?
Documentation: watch
You probably need an extension which converts the data you get from medipim to HTML. I Expect you get information as JSON, XML, or CSV.
As you won't publish your access code you probably will not use a javascript call from the browser to access the API, then you need some PHP.
Using PHP in TYPO3 is done in extensions. You should learn about building extensions in TYPO3. As a healper you might use the TYPO3 extension "Extension Builder" (=EB). As you have no local records you only need the extension frame with just one plugin from the EB.
Depending on your usage (will an editor select products from Medipim (option A) or should the visitor be able to select products (option B)?) you need a plugin with an option to insert desired product identification for BackEnd editors or just an input mask.
you can configure your plugin with typoscript so an integrator can enter the authentification information just once.
For option A you need to enhance your plugin with a field for the product ids.
keyword: flexform
for Option B you need a form.
Then you need to display the product information you get from the API. provide the returned data in variables and use Fluid templates to get a nice display.
Without any knowledge of TYPO3 this will be hard work and a lot to learn. The other possibility: hire an experienced TYPO3 developer and let him build this extension for you.

Shopify [Plus] Liquid to Retrieve Orders & Customers, or Include App Proxy Snippets

I'm looking for a way in Liquid to retrieve all Customers, or all Orders. I know it's targeted from a Client POV so probably not, but I just wanted to double check if there are any undocumented handles anyone has come across? Its for a protected page for staff user only access.
If the only solution to fetch this data is to use the App Proxy (for API access), is there a tidy way of including the output in a template? I gather there is no way to simply include an App Proxy liquid file into a Page as you can with Snippets, so does that purely leave either having the webpage at a proxy url or to pull in the contents with a jQuery call?
Your question is confusing. If you're on the front-end of a store, using Liquid, it seems pretty obvious you cannot easily access all customers. That would not be a front-end store thing. If you were logged in as a customer, with Liquid you'd have all that customer's order data.
With a clearer question, maybe you might get more help. What are you trying to do, and why?

How can I handle the resource expansion while designing/making the transitions in Moqui?

I am not able to figure out how should I handle the names of transitions so that it is aligned to the best practices of RESTful API in case of resource expansion.
For instance, if I want to fetch all the orders for a particular customer the URI should be like https://api.website.com/customers/1000/orders.
I am able to make the transitions restful for a single resource i.e. customers or orders (as it was demonstrated in the Example App file in Moqui.) but was unable to find any example which will solve the purpose of resource expansion.
The problem that I am facing is while designing the transitions as per the best practices of a restful API. The ExampleApp.xml only has examples for a single resource i.e. Example Entity.
If I take the case of the data model used in HiveMind regarding Project management then the URI should be like this according to the best practices
For fetching all Projects- https://api.website.com/projects
For fetching a Milestone for a particular Project - https://api.website.com/projects/DP/milestones/DP-MS-01 (Here, DP is the Project Id)
For fetching a Tasks of a particular Project- https://api.website.com/projects/DP/tasks/DP-1
Now if I am designing an API in Moqui framework, this is how I have to name the URIs
For fetching all Projects- https://api.website.com/projects
For fetching a Milestone of a Project- https://api.website.com/projects/DP/DP-MS-1
For fetching a Task of a Project- https://api.website.com/projects/DP/DP-1
So you can see that these URIs are confusing as I am not able to differentiate between the URI for fetching a milestone or a task.
I can still make the URIs as per the best practices of restful API design by checking the path-parameters (i.e. if tasks is in the path parameter then execute the task related operations and similarly for milestones). But this approach will not be a clean one as its maintenance will become difficult if the parameters in the URIs are too many like https://api.website.com/projects/DP/milestones/DP-MS-1/tasks/DP-1/worklogs/DP-1-WL-2/party.
This is just an example scenario in which I want to get the party/person who has added worklog for a task in a particular milestone of a particular project. This is the case of one data model i.e the WorkEffort.
But what about party, customers, orders, products etc. data-models? Designing an API will become an extremely tedious job for the developer of the API.
So I was just asking if there was another cleaner approach that is implemented in Moqui which I could use as reference?
In the latest version of Moqui Framework (not yet released, just available in the GitHub repo though will be part of the next release) there is now an automatic entity REST interface to do find and CrUD operations.
It supports patterns like that described in this question and many others, for some examples see the comments in the rest.xml screen file (that handles the entity REST requests):
https://github.com/moqui/moqui/blob/master/runtime/base-component/webroot/screen/webroot/rest.xml
The concept in Moqui that handles this is path parameters. The easiest examples of it are in the RESTful service examples in the ExampleApp.xml screen:
https://github.com/moqui/moqui/blob/master/runtime/base-component/example/screen/ExampleApp.xml
The example request, in a comment in that screen, with curl looks like:
curl -X GET -H "Authorization: Basic am9obi5kb2U6bW9xdWk="
http://localhost:8080/apps/example/ExampleEntity/TEST2
The transition that handles this request looks like:
<transition name="ExampleEntity" method="get" read-only="true">
<path-parameter name="exampleId"/>
<actions>
<entity-find-one entity-name="Example" value-field="example"/>
<script>ec.web.sendJsonResponse(example)</script>
</actions>
<default-response type="none"/>
</transition>
Note the use of the transition.path-parameter element, and that this transition only applies to requests with the HTTP GET method. Everything after the transition location in the URL is treated as a path parameter and put in context fields, like "exampleId" above, in the order of the path-parameter elements.
In your case you would have 2 path parameters, a customer ID and the "orders" string telling it to retrieve orders for the customer.

Best approach to build a DYNAMIC query-by-example form in AngularJS?

I'm relatively experienced with Angular having written many directives, but I have a new requirement where I have to build a query-by-example form into which a user can enter different search criteria. My problem is that I do not know ahead of time what the possible criteria will be. This criteria information will be coming from the server via an ajax request and can differ per user. Thus I will need to dynamically construct a suitable user interface based on the information I get from the server.
I have built individual directives suitable for capturing the search criteria (for example a custom calendar control for date criteria) but I am unsure of the best approach to adding these directives to a form dynamically. Is this even possible in Angular?
I have built something like this before in jQuery but its not so clear to me how I would best do this in an 'Angular way'?
Any suggestions would be most appreciated!
Everything that you can express as a model-to-view projection can be implemented in AngularJS.
I think here you can make a model consisting of "query params". Each of them has name, type and data for filter builder. For example, for the "select" type a data can contain a list of all possible values to choose from.
Then you iterate through the list of "query params" with ng-repeat, rendering each control differently according to its type. That's all.
If I understood the task wrong, please provide more info.

Search Option in Catalyst Framework

I have developed a web page for a database using catalyst and template toolkit. I have a table in my webpage. I want to have a search option in the same web page, which fetches data dynamically from the back end(database) and allows the user to search in the database.
I have jQuery datatables in my page, but it doesnot fetch the data from the database instead it will search in the table and give the result. As I am a new user to perl and catalyst, I request to tell me how can I have a search option in my webpage.
If my question is not clear,I would explain in detail.
What you're asking is not trivial to achieve, but can be done.
You need to first have a good read of the documentation on DataTables regarding server-side processing, and then rewrite the Catalyst Controller in your app that generates your data so that it mirrors the behaviour of Allan's PHP code: applying filters, sorts and limits, then returning JSON results. If you're using DBIx::Class and/or SQL::Abstract modules, it should be possible to create the equivalent functionality in far less code.
It's not for the faint-hearted, though. I've written and manage an application that uses Catalyst, TT and DT to render CRUD screens and I'm still not rushing to do a conversion to server-side processing until it proves absolutely necessary. (YAGNI principle + time-poor life.)