filter in nextjs using API on click radio buttons - sorting

How can i implement the filter using buttons on product page. those are filter by all and most viewed products. so i have two buttons one is All product and second is most viewed product also i have both the data in API (all and most viewed respectively). Now i want to display the data accordingly. by default data will be shown as all product and when i will click on most viewed products it will change or filter accordingly. same for all product.]
these are the following requirements:
action will be on radio buttons named as all and recent.
both the buttons will call data from two different API's.
By default all the data of the product will be displaying.

Related

Telerik Kendo UI Grid - Inline editing of composite object as a single column with multi-field widget

We are considering kendo ui to replace GWT in our ERP product. The main motivator is kendo grid. We have many composite objects that are rendered and edited as a single column. The column editor will contain multiple fields.
An example: In sales invoice lines, the product column should display product code (autocomplete field), product name (Link), and a button to open products browser (a modal dialog with search fields and a grid that displays products along with images, names, available quantities, etc).After selecting a product in the products browser the grid should update the product in the row that requested the browser.
I think I know how to implement the products browser. But the composite editor is the one I do not know how to implement.
My question is: how can I edit a composite object in a single grid column using a composite widget? And we need inline editing not popup editors.
I have been browsing the demos to find a close example but could not find any. My search was "kendo grid composite object custom editor".
Yes, you can do that with Kendo UI
Check this demo (a ComboBox with a custom template)
http://demos.telerik.com/kendo-ui/combobox/template
You can create a custom row's template for the ComboBox (with multiple columns like in the demo) and in the grid you can use a custom template for the column products and use the ComboBox with the custom template.
Check this demo for the grid with a custom column template
http://demos.telerik.com/kendo-ui/grid/editing-custom

filtering and searching not working in magento 2 custom grid in product edit page

i have created one custom grid as new tab in product edit page.data is displaying in grid form.searching or sorting is not working there.if i put
$this->setUseAjax(false);
then every time total product page is reloading.if i put ajax as true giving ajax error.so what we have to define in grid if we writing that as custom tab in product admin

Getting configurable product options pre selected from the layered navigation

I have several configurable products (with many simple products associated to them).
When browsing the super attributes through the layered navigation, you can filter down to all products that have (for instance) size= medium, Colour = Red.
I have set my simple products to not be visible and showing my configurable products, however, when you select the configurable product, the product options do not default to what has been filtered in the layered navigation.
Is there a way to get the relevant product options pre-selected on the product page?
suppose the user selected the filters from the listing page as size ="medium" colour ="red"
Now when user selects the configurable product from listing page after applying filter corresponding values must be pre selected on product detail page.
There is no ready-made way to do this. When the request is made for the product that product knows nothing of the layered navigation state. In theory you could add in some server side code to do that however this might have a performance penalty as you might not be able to use cache effectively.
You could do something on the front end in javascript. Add an event listener to the links in the filtered navigation and store an object in local storage, e.g. with size and colour.
On the product page you could then set the configurable product according to those values by waiting for the configurable product options to be built, then load the options object from local storage and then update the configurable product accordingly. You will need to then fire off events so the product page knows that options have been selected and can do things like update the price accordingly.
Internally Magento uses attribute option values that have numerical ids. These can be a bit complicated to work with, so you may want to put some logic in to read the labels instead, e.g. 'Red' instead of e.g. '461'.
There is no prototype specific way of working with local storage and you don't need some layer of jquery, normal javascript should suffice when it comes to storing/retrieving your size/colour object.
I found the following article to be the head start needed for doing things with the configurable product drop-downs:
http://inchoo.net/ecommerce/magento/how-to-make-configurable-options-autoselected-on-configurable-product-view-page/

List all products with a certain attribute value in Magento

What I am trying to do is add some links below the layered navigation in Magento on the Product Listing Page. I have the layered navigation working nicely but I have some other groups of items that I would like to have listed on click of a link. These items can be identified by a custom attribute that I added. In example a featured_product list.

Magento: Different products in the different store views under the same store?

I have multi website, multi stored Magento shop, and I have a need to make some products available in one store_view, but not available in the other, where both store_views are part of the same store and website.
All my products are configurable with simple products attached to them. Only way I could think of solving this is registering a new product attribute through which I control where each product goes. That works great for the catalog and lists of products, but I have huge problems with single product view and choosing the configurable product options.
I can't seem to find where in Magento core those option are generated, so I could override that and strict some options for each store view. Basically, I need to know where is this
generated. My last resort would be managing this through AJAX, but there is already a lot of AJAX code and calls in that page that it would be confusing.
Any help or tip would be very appreciated.
I am pretty sure that the way above is not working because the attribute enable/disable product has impact at website level and not store or store view!
So if you do like tomakun says the product will be disabled at the whole website and not just for the store view you choose first!
I have the same problem that I want to assign different products all to one website but to different stores.
So far I just found the solution above to change the visibility at store view level.
But I think this not the optimal solution. It should be possible to disable a product on store level!
This feature is already available by default in Magento.
For bulk enabling/disabling products for a particular store view, do the following:
Go to your Catalog > Products
Select a store view above the product list.
You are now viewing all products included in THIS store view.
Once you have the correct store view selected, select the products you want to Enable or Disable using the checkbox on the left.
Now, using the Actions dropdown menu on top right of the product list, choose 'Change Status', select 'Disabled' or 'Enabled' and hit the Submit button.
Doing this will Enable or Disable the selected products from the selected store view (step 2). This is good for bulk actions but you can also do the same for all products one by one:
Open your product, select the relevant store view on top left of the page. Then in the General Tab, you have status: Enabled or Disabled. Choose the option that you want to apply for the current store view and hit Save.
That's it!

Resources