get list of all discounted items episerver commerce - episerver

I am trying to display a collection of related items on a page which are at discounted price. I want to know the API call which gets all the discounted items from the database to filter out the related items to the currently displayed item.

Related

Modifying Schema only for one document

I'm creating an application in the MERN stack and I stumbled upon a problem. I will start by explaining how that app is going to work.
So, in that application users can create their Collections. It can be anything - a collection of books, a collection of a favorite food - anything. Now in these Collections, they can create Items - for example, specific books.
We can navigate through the application to the different Collection Pages or the specific Item Pages in those Collections. You get the idea. There is a list of all the Collections on the main page and we can click e.g. Books Collection, then click on the Harry Potter item, and we will visit the Page for that specific book.
When a user creates an Item, he has to add a name and tag to it. But the user can set his own fields, like for example Author field for that Books Collection. Then every Item (book) will gain that Author field. It's obvious, that the main Item Schema is not affected by that additional field. Because we don't wanna the Author field in the Favourite Food Collection.
Anyway, I know how to modify data of already existing Items, but how to change that Schema for an Items that user gonna create in the future? Because if the user added Author field, we obviously want that field to show every time that user creates a new Item (book) in that certain Collection. Should I create a whole new Schema, only for the modified document? Or is there a different, more approachable way of achieving what I want right here?
As far as saving dynamic data in the collection, you could use Mixed Type or Object Type, see more info here
For keeping track of the fields the user has used previously, we could maintain a array within, having all the fields

More than 50,000 records load ng-repeat in dropdown list in angularjs

I displayed 100 records using ng-repeat in dropdown list faster.
but,
I have to fetch more than 50,000 records using ng-repeat in dropdown list,
While fetching application is hanged and not responding needs to close a project.
How to display faster in dropdown list using ng-repeat?
No one have a time to scroll and select 50,000 records in dropdown and select. Instead use the dropdown with custom search option, it will give your users to more interactivity and performance in dropdown.
Initially render upto maximum of 500 records and display them in dropdown. Allow user to search through the drop down, when user enters the search value, based on value get those values from database and append it to dropdown.
Also you can achieve the above scenario using the following plugin.
https://github.com/axel-zarate/js-custom-select
You can use this plugin to create dropdown with custom search and make you own ajax function to get datas from server.
Hope this will help you.

How to include item's statistics in Collection on DSPace 6?

I have a collection with 15 documents, manually I added the views of each items anfd the total was 23.000~ but when I view the statistics of the colecction I get 3.200~. When viewing the statistics of a collection in DSpace 6 I only get the views the collection has gotten but it doesn't add the views the items of that collection has gotten.
How can I add each item's statistics into the collection?
The DSpace Usage Statistics for a Collection or Community only display views of the Collection or Community landing page. The total item views are not displayed in the user interface.
The question can be answered by querying the Solr repository within DSpace. We have built an internal reporting tool that computes these usage numbers.
All item views
type:2
All item views for a collection
You can get the item uuid from the database or from the url of the item edit page.
q=type:2 AND owningColl:59f3a497-9e82-4100-ba9a-e00cff04ec43
All item views for a community
q=type:2 AND owningComm:59f3a497-9e82-4100-ba9a-e00cff04ec43
All item views for a community for the last 12 months
q=type:2 AND owningComm:59f3a497-9e82-4100-ba9a-e00cff04ec43
facet.date=time
facet.date.start=NOW/MONTH/DAY-12MONTHS
facet.date.end=NOW/MONTH/DAY+1MONTH
facet.date.gap=+1MONTH
More information
I have a tutorial on using Solr with DSpace here: https://github.com/terrywbrady/TutorialSolrAdmin

What is the proper way to display a shared info panel for a list of items?

I am developing a web page. This page contains a list of items on the left side, and a information panel on the right side to show some summary information specific to the selected items see below:
When one item is selected by user, the information panel's content should be updated to show the active item's content.
My Question:
What is the proper way to implement this:
Spawn one information panel per list item. Then hide/show the the information panel for the active list item.
Make only one information panel globally. Then update the information panel's content based on list item selection?
Because I am using Angular 2 and Bootstrap, advices specific to these libraries are appreciated. (For example, shall I use route to implement the item-click-to-summary-display? Is there a component in Bootstrap library that is specifically for such purposes? )

Does ng-repeat recreate all child DOM elements when new data is appended to the array?

I created a directive that handles infinity loading of blog posts as the user scrolls down.
I'm wondering how AngularJS handles the addition of new blog posts when the feed is rendered using ng-repeat.
For example
<article ng-repeat="post in posts">
// stuff...
</article>
Are all the articles recreated each time posts is updated with new posts? Assuming that only new posts are appended to the array.
Is ng-repeat smart enough to only create the new posts?
I worry that after the user has scrolled down for a long period the refresh rate will get slower as ng-repeat recreates all the blogs each time new ones are fetched from the server.
ng-repeat, by default, tracks the items of the collection by their $id(): angular associates an identity to every item, and if you add a node to the collection, the elements already associated to the existing items of the collection won't be recreated.
OTOH, if your strategy is to recreate a new collection of items every time you scroll down, the new items will have a different identity (even if they represent the same post as before), and angular will recreate all the DOM elements. That's what track by is for: it allows telling ng-repeat how to associate DOM elements with items of the collection. You could for example use track by id, and an element previously associated with an item with id 3 will be preserved by ng-repeat and be associated to the new item having the id 3.

Resources