Orchard Ajax Request - ajax

Currently we have a few products defined in Orchard.
We managed do display these products by using a query in combination with projection.
I executed the same steps as described in this tutorial, Defining and rendering the ProductCatalog Content Type
There is also a menu to navigate inside products catalog. When selecting category, the full page is refreshed. How can we implement a ajax request each time user select a product category in menu?
Here i will show you an example of the screen:

I guess your best bet is to do something along those lines:
Create a module with a custom ApiController
Write an alternate for your category navigation in which you send an ajax request to your controller
Use IContentManager in your controller to query for your products and return them as a json result
Update your page from your result

Related

Laravel nova on action show page to get data from various field from user

I have one resource (User table) for which I need to perform some action.
However when that action selected I want to pass too many additional fields and selection is dynamic.
For example, if I select any user and click on action then in action I should select a category from DB and based on that category I need to get subcategory and based on that subcategory I want to get some seller on action page in Nova...
Is there any way i can do this.
I think Action Fields might help you with that. You can add additional nova fields to your collection of models before handling them in the action.
Hope that this can help: nova action fields
you can use this great NovaPackage
https://github.com/epartment/nova-dependency-container

How to choose appropriate controller to handle a request in MVC?

I want to create a post so I'm using the create method of post controller. but this page has category and subcategory fields and I want to get the subcategories using AJAX.
The question is which controller is more appropriate to get the subcategories?
AJAX controller
Post controller
Category controller
If it's only one method then you should implement it in CategoryController because maybe other entities of your project will have relations with categories. It doesn't make sense to query route to PostController to get categories for select on, let's say, user category permissions editing page.
But if you need a bunch more methods it would be better to delegate a separate CategoryApiController for different AJAX methods and group it's routes separately too.

How can i get the url of the filterable attribute in layered navigation?

As we know the filterable attributes on the layered navigation has certain url that magento creates on click which filters the product list.
Let me explain my issue by giving an example. Let's say i have an attribute city which is filterable.Now the city attribute has options like "melbourne","sydney",etc.When I click on melbourne it redirects to url like
http://Your_Base_Url/Category/filter/city/melbourne.html
Same way if there are multiple attributes Magento manages the url like that.So what I want is i have a seperate dropdown where there is listed all the options for city when i click that i have to filter the products of that category.
So I am thinking if i can generate the url same as magento creates for the layered navigation i could get my work done.
So i was hoping if someone could help me on this.I have tried to trace how the layered navigation is working but i couldn't implement that way of generating urls in my case.So any help on this is appreciable.
Regards,
aton

Apply Custom Option via Ajax to a product

Has anyone had any success in Applying a custom option to the product object via Ajax.
ie. A ajax request will get triggered when ever I select a custom option which changes the product price.
I have a ajax Block in the Product View page that depends on the Product Price. Since Magento Applies the Custom Options after the product is added to the cart , I am finding it difficult to render the ajax block with my updated product price.
Any idea's ?
Try this module, its good ajax cart and it has exactly what you need and you can customize it easily
https://github.com/hws47a/VF_AjaxCart

Getting links to a category in Joomla

Even just 30 minutes google the forums and found nothing ... I am interested in - actually I see a new link to a category created not by me, while also having access to the database (to see it directly) being available to only access the admin panel. Help me please.
If you want to create a link to determined category, you have to understand that there is a component responsible of show the content, if you see this Link, you can pass parameters in the url, therefore a link to category will be something like this:
index.php?option=com_content&view=category&layout=blog&id=4&Itemid=6
where category it's the type of view. You can put category or section
Put blog in the layout parameter if you want to show the articles as blog form, this parameter its optional
id its the number of the category id
and finally itemid its the id of the menu from was clicked

Resources