Author |
Topic |
|
goshen
VP-CART New User
132 Posts |
Posted - March 01 2007 : 22:01:08
|
Hi guys, I tried this with suppliers and it works except that when I select the supplier from the drop down, it takes me to the shopproducts.asp page with no product displayed.
I believe the query is not retrieving the products attached to the suppliers. Here is my code: Dim Mfgset,sqlstr,myconn,strMfgline,rs ShopOpenDatabaseP myconn Set rs = myconn.Execute("select distinct ucase(suppliers.name) as mfg, products.supplierid as pid FROM suppliers INNER JOIN products ON suppliers.supplierid = products.supplierid where suppliers.supplierid is not null") %>
<form name="form1"> <select name="menu1" onChange="MM_jumpMenu('parent',this,0)" style="font-size:8pt"> <OPTION VALUE="Select Supplier" selected>Select by Brand</option> <% Do While Not rs.EOF if rs("mfg")<>"" then %> <OPTION VALUE="shopquery.asp?mfg=<%= rs("pid") %>"><%= rs("mfg") & "(" & rs("pid") & ")" %></option>
<% end if
rs.MoveNext %> <% Loop %>
What do I make shopdsiplayproducts.asp to accept the supplier id (pid) so that it can write out all the products with that supplier id and format it exactly as it will normally do when a product is searched.
I have tried changing shopdisplayproduct.asp which is where the shopquery.asp redirect to but all I get is all the products and not the products specific to that supplier.
Please help |
|
|
revrat
Starting Member
47 Posts |
Posted - March 20 2007 : 18:58:54
|
Hey all.
Thanks for this thread
I have followed these directions and the homepage looks great. Drop downs look great.
Only problem is they do not do anything.
I did one menu for the Artist (artist field in my table) and one menu for the Label (mfg field in my table)
here is my code from the Headers page
<!-- START CATEGORY BOX --> <h2>Label Search</h2> <div class="box ac"> <% ShowManufacturers %> </div> <!-- END CATEGORY BOX --> <!-- START ARTIST BOX --> <h2>Artist Search</h2> <div class="box ac"> <% ShowArtists %> </div> <!-- END ARTIST BOX -->
Here is my code from the DB Page:
Sub ShowManufacturers ' All russ's code starts here: Dim Mfgset,sqlstr,myconn,strMfgline,rs ShopOpenDatabaseP myconn Set rs = myconn.Execute("SELECT distinct ucase(mfg) as mfg from products where mfg is not null order by ucase(mfg)") 'ucase for access %> </font></font> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <form name="form1"> <select name="menu1" onChange="MM_jumpMenu('parent',this,0)" style="font-size:8pt"> <OPTION VALUE="Select Manufacturer" selected>Search Labels</option> <% Do While Not rs.EOF if rs("mfg")<>"" then %> <OPTION VALUE="shopquery.asp?mfg=<%= rs("mfg") %>"><%= rs("mfg") %></option> <% end if
rs.MoveNext %> <% Loop %> </SELECT> </form> </font> <%rs.Close myconn.Close Set rs = Nothing Set myconn = Nothing ' all russ's code ends here End Sub Sub ShowArtists ' All russ's code starts here: Dim artistset,sqlstr,myconn,strartistline,rs ShopOpenDatabaseP myconn Set rs = myconn.Execute("SELECT distinct ucase(artist) as artist from products where artist is not null order by ucase(artist)") 'ucase for access %> </font></font> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <form name="form2"> <select name="menu2" onChange="MM_jumpMenu('parent',this,0)" style="font-size:8pt"> <OPTION VALUE="Select Artist" selected>Search Artist</option> <% Do While Not rs.EOF if rs("artist")<>"" then %> <OPTION VALUE="shopquery.asp?artist=<%= rs("artist") %>"><%= rs("artist") %></option> <% end if
rs.MoveNext %> <% Loop %> </SELECT> </form> </font> <%rs.Close myconn.Close Set rs = Nothing Set myconn = Nothing ' all russ's code ends here End Sub %>
i'm a bit stuck at this point |
|
|
revrat
Starting Member
47 Posts |
Posted - March 20 2007 : 19:07:17
|
Never mind
Thanks guys I re-read the posts and had the java pasted incorrectly.
Great info!! |
|
|
Mark Priest
VP-CART Expert
United Kingdom
580 Posts |
Posted - March 29 2007 : 21:40:41
|
I actually got this working so thanks, and played with it to match my site, but can someone tell me how to have the results in nomal text instead of all upper case?
Regards,
Mark Fireworks |
|
|
Mark Priest
VP-CART Expert
United Kingdom
580 Posts |
Posted - March 29 2007 : 21:45:07
|
Mmmm, just as an add on to this, would it be easy to count the products with that manufacturer and return the result next to the manufacturer?
Regards,
Mark Fireworks |
|
|
rustytec
VP-CART New User
Australia
113 Posts |
Posted - March 29 2007 : 22:01:04
|
quote: Originally posted by Mark Priest
I actually got this working so thanks, and played with it to match my site, but can someone tell me how to have the results in nomal text instead of all upper case?
Regards,
Mark Fireworks
Hi Mark,
Set rs = myconn.Execute("SELECT distinct ucase(mfg) as mfg from products where mfg is not null order by ucase(mfg)") 'ucase for access
Just remove the references to 'ucase' (or 'upper') and it will read as it was originally entered into the database.
cheers
Russ
rustytec |
|
|
rustytec
VP-CART New User
Australia
113 Posts |
Posted - March 30 2007 : 00:01:37
|
quote: Originally posted by Mark Priest
Mmmm, just as an add on to this, would it be easy to count the products with that manufacturer and return the result next to the manufacturer?
Regards,
Mark Fireworks
Hi Mark,
I haven't looked at this really yet, but as an idea, what about in this section :
<% Do While Not rs.EOF
if rs("mfg")<>"" then %>
<OPTION VALUE="shopquery.asp?mfg=<%= rs("mfg") %>"><%= rs("mfg") %></option>
<% end if
rs.MoveNext %>
<% Loop %>
After this line:
if rs("mfg")<>"" then %>
Add in another line of code to count the number if products with that mfg name.
set pcnt= myconn.execute("select count(ccode) from products where mfg='" & rs("mfg")& "'")
add pcnt into the dim statement above
You then need to write it into the option data......
I'm not quiet sure here, it seems a bit tricky.....
Russ
rustytec |
|
|
Mark Priest
VP-CART Expert
United Kingdom
580 Posts |
Posted - May 05 2008 : 21:47:32
|
Hi Guys.
I have this working great, but it's displaying manufacturers for products that we no longer stock or have no stock of, I don't want to delete these products from the database as this screws with the reports.
What I want to be able to do is make the search only display the manufacturer if there is stock of that particular product or if its not hidden.
Any ideas?
Regards,
Mark Fireworks UK |
|
|
carfin
VP-CART Expert
United Kingdom
948 Posts |
Posted - May 06 2008 : 02:56:06
|
Hi Mark,
add your checks for stock and hidden products to your Sub ShowManufacturers
Set rs = myconn.Execute("SELECT distinct ucase(mfg) as mfg from products where mfg is not null and cstock>0 and hide is not null order by ucase(mfg)")
Regards,
Carrol www.deanston-electrical.co.uk
|
|
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - May 06 2008 : 03:55:42
|
if it's any help, we released a supplier/manufacturer addon for this kind of thing a while ago, have a look at: http://www.bigyellowzone.com/shopexd.asp?id=154 which also has a demo link on it. it lets you use a drop down or a tabular list, for suppliers and/or manufacturers, and it'll use the standard vpasp logic when it comes to things like stock-checking, productmatch, hide etc.
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons |
|
|
Mark Priest
VP-CART Expert
United Kingdom
580 Posts |
Posted - May 06 2008 : 17:54:12
|
Carrol
That worked a treat! thank you very much
Regards,
Mark Fireworks UK |
|
|
micrographics
Starting Member
13 Posts |
Posted - May 09 2008 : 06:20:30
|
Hi
I'm also thinking of doing similar but in my case it is not a Dropdown, it has to be in tabular format with three columns.
Please advise me how to do ? |
|
|
ianphillips
Starting Member
United Kingdom
42 Posts |
Posted - May 24 2008 : 15:41:37
|
Why aren't you using the supplierid. This appears from a drop down and is pulled in from the supplier table so you wont encounter spelling errors as you might from the mfg field....
quote: Originally posted by Questar
Thanks! I changed "conn" to "myconn" in a couple of places and it works perfectly now.
|
|
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - May 25 2008 : 03:14:28
|
some people use supplier for the real supplier (ie the people who physically supply the goods; the wholesaler), and the mfg for the manufacturer, so they're often different. If using something like the mfg then it'd normally need to be encoded too (ie using Server.URLEncode(variable) for the mfg value in the url. Our addon caters for that aspect on its dropdown/tabular-list; it has both supplier and mfg options and you can use either/both.
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons |
|
|
borisvel
Starting Member
Slovenia
47 Posts |
Posted - November 11 2014 : 05:06:21
|
Hello,
i have problem displaying all products for choosen manufacturer using URL in product extended description template, e.g.
<a href="shopquery.asp?mfg=[mfg]">All products</a>
With such URL it displays both parent and child products, i would like only parent products. I tried with additional parameter: &higherCatalogId, but i can find any valid expressions.
Did some already have solution for my problem?
Thanks for help...
www.lingerie.si |
|
|
|
Topic |
|