API for Multi Vendor

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
Hi

I want to develop a web api for nopcommerce with multi vendor functionality, meaning I should be able to CRUD products on vendor bases.

This functionality is already there in nopcommerce and if possible, I want to reuse it. For that, I wan to understand how multi vendor code/functionality is implemented. Where do I find that code?

Any help would be appreciated.

Thanks
Krtya
8 years ago
You can see product controller of admin. That may help you.
8 years ago
Thanks... that has gave me somewhere to start.
8 years ago
It would have been really helpful if there where comments on each method of what it does.
8 years ago
bhaveshkrtya wrote:
It would have been really helpful if there where comments on each method of what it does.


In addition with Anik  


Path: Presentation\Nop.Web\Administration\Controllers\ProductController.cs
namespace Nop.Admin.Controllers
#region Product list / create / edit / delete
8 years ago
Hi

can't find Path: Presentation\Nop.Web\Administration\Controllers\ProductController.cs

There is Nop.Admin.Controllers and I think that's what Anik meant and that's where I am started look at. Not sure if meant to point me some where else. Let me know if that's the case.

Thanks
Bhavesh
8 years ago
bhaveshkrtya wrote:
Hi

can't find Path: Presentation\Nop.Web\Administration\Controllers\ProductController.cs

There is Nop.Admin.Controllers and I think that's what Anik meant and that's where I am started look at. Not sure if meant to point me some where else. Let me know if that's the case.

Thanks
Bhavesh


You are right place!!
8 years ago
Hi

Need little help in getting right direction.

I want to return/get products filtered by Specification Attribute but not sure how to go about searching product with filtered.

There is a method in ProductService called SearchProduct which take "IList<int> filteredSpecs" as one of its argument but how do I construct this parameter. Tried to debug the code but couldn't find out where its getting that array list.


Any help would be much appreciated.

Thanks
Bhavesh
8 years ago
bhaveshkrtya wrote:
Hi

Need little help in getting right direction.

I want to return/get products filtered by Specification Attribute but not sure how to go about searching product with filtered.

There is a method in ProductService called SearchProduct which take "IList<int> filteredSpecs" as one of its argument but how do I construct this parameter. Tried to debug the code but couldn't find out where its getting that array list.


Any help would be much appreciated.

Thanks
Bhavesh


See the following code >>


//products
           IList<int> alreadyFilteredSpecOptionIds = model.PagingFilteringContext.SpecificationFilter.GetAlreadyFilteredSpecOptionIds(_webHelper);
            IList<int> filterableSpecificationAttributeOptionIds;
            var products = _productService.SearchProducts(out filterableSpecificationAttributeOptionIds,
                true,
                categoryIds: categoryIds,
                storeId: _storeContext.CurrentStore.Id,
                visibleIndividuallyOnly: true,
                featuredProducts: _catalogSettings.IncludeFeaturedProductsInNormalLists ? null : (bool?)false,
                priceMin: minPriceConverted,
                priceMax: maxPriceConverted,
                filteredSpecs: alreadyFilteredSpecOptionIds,
                orderBy: (ProductSortingEnum)command.OrderBy,
                pageIndex: command.PageNumber - 1,
                pageSize: command.PageSize);



//specs
            model.PagingFilteringContext.SpecificationFilter.PrepareSpecsFilters(alreadyFilteredSpecOptionIds,
             filterableSpecificationAttributeOptionIds != null ? filterableSpecificationAttributeOptionIds.ToArray() : null,
                _specificationAttributeService,
                _webHelper,
                _workContext,
                _cacheManager);



This example  from         public ActionResult Category(int categoryId, CatalogPagingFilteringModel command)
..path -->Nop.Web\Controllers\CatalogController.cs

Debug this..Hope it will help you to understand your desired.
8 years ago
That is what I know but want to know how SpecificationAttribute is implemented in nopcommerce.

It gets alreadyFilteredSpecOptionIds from url parameter. For example in my case if I select Brand = Dell, it appends spec=3 in url. What I want to know if how it links this 3 to Brand = apple? What if I have Brand = "customText"?

Thanks
Bhavesh
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.