where are the queries hidden?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
OK, I am wanting to mdify the product query (connect to a different database and pull up items from columns that are named differently), and of course I can not even find where the queries are hidden in asp.net...

I know to look at the Web.Templates.Products.VariantsInGrid page, drill down to

Web.Modules.ProductInfo and there I see, for example:

        <div class="shortdescription">
            <asp:Literal ID="lShortDescription" runat="server" />
        </div>

How can I change where to pull that lShortDescription information from?
14 years ago
Check stored procedures and edit.

But you'll have to edit corresponding files also to match what you are pulling from the db.
14 years ago
Thank you.

Some more studying of ASP.net is needed I see :) plain ASP was easier!

I still do not exactly understand which of the stored procedures are being called for and where they are being called.

For example, if we pull up a product on the product page, in which file is the link made to certain stored procedures?
14 years ago
NopCommerce uses a provider model for data access.

The EntityManager classes in Nop.Common call the provider methods in Nop.DataAccess.

The providers are responsible for passing the request to the relevant data store specific provider - currently Nop.DataAccess.SqlServer - this is where you will find the methods that call the relevant stored procedures in your MSSQL db.

Hope this helps,
Ben
14 years ago
Yes, thank you. Now I know where to look. I will study it some more.

I may have products with the same item number (ID), like
BMW 550
Mercedes 550

I would like to call the Product ID 550. but I am afraid that the Product ID has to be unique?
Can I modify this to look for both manufacturer and item number? Something along these lines in
Nop.DataAccess.SqlServer.xml??

        <member name="M:NopSolutions.NopCommerce.DataAccess.Products.SQLProductProvider.GetProductByID(System.Int32)">
            <summary>
            Gets product
            </summary>
            <param name="ManufacturerID">Manufacturer identifier</param>
            <param name="ProductID">Product identifier</param>
            <returns>Product</returns>
        </member>


Thanks
14 years ago
Your ID should always be unique.

What is the reason for requiring duplicate ID values?
14 years ago
Yes, the ID has to be unique. And I do now want to duplicate them, I want to duplicate the item number. I can do that, but also need it to be the thing we search for.

The products we sell often have item numbers instead of names. And thus they are known by their item number, and identified as such.

For example, we may have a Dell 1200, and a Compaq 1200 in our inventory (I am making up these items).

Right now in our system (not NopCommerce), both items have a unique ID, but the customer never really sees that ID.

When they search on the website, they can:

-search by just the item number (in this case it would give them 2 results: Dell 1200, and Compaq 1200)

-search by just the manufacturer (in this case it would give them many results, and offer categories and subcategories to narrow search)

-search by manufacturer and itemnumber (in this case it would find the specific item, and show the product)

So instead of searching by that unique ID (which in my case is just a rowkey, and has nothing to do with the actual product), I would like to search by item number and manufacturer.

Thank you!
14 years ago
You should not change the GetProductByID method as this is used to get single product instances.

If your aim is to extend the customer search so that it searches an additional field as well (your item number) then have a look at the GetAllProducts methods in Nop.Common.Products.ProductManager.

In fact you could probably get away with just changing your stored procedure/xml provider

Hope this helps,
Ben
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.