ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Customizing ProductCart
  New Posts New Posts RSS Feed - Adding Stock to Product List View
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Adding Stock to Product List View

 Post Reply Post Reply Page  12>
Author
Message
knifepro View Drop Down
Newbie
Newbie


Joined: 18-February-2008
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote knifepro Quote  Post ReplyReply Direct Link To This Post Topic: Adding Stock to Product List View
    Posted: 11-July-2010 at 5:34pm

Is it possible to add the number of units in stock to the product list view. The items are listed in the AJAX view. Would like to add them to the regular view.

Can someone tell me what code I need to add

Okay I figured this one out. I used the following code to show stock on the list page:

      <% if (scdisplayStock=-1) and (pNoStock=0) then %>
        <% if (pstock>0) then %>
            <p class="pcShowProductStock">
            <%response.write dictLanguage.Item(Session("language")&"_viewPrd_19") & " " & pStock %>
            </p>
        <% end if
    end if %>

Now I am trying to get the backorder message to display on products that are out of stock and allow backordering. Here is what I have but I can't get it to work. Any ideas?

        <% If (scOutofStockPurchase=-1 AND CLng(pStock)<1 AND pserviceSpec=0 AND pNoStock=0 AND pcv_intBackOrder=1) OR (pserviceSpec<>0 AND scOutofStockPurchase=-1 AND iBTOOutofstockpurchase=-1 AND CLng(pStock)<1 AND pNoStock=0 AND pcv_intBackOrder=1) Then %>
        <%If clng(pcv_intShipNDays)>0 then%>
            <%response.write "<div>"&dictLanguage.Item(Session("language")&"_viewPrd_60")&dictLanguage.Item(Session("language")&"_sds_viewprd_1") & pcv_intShipNDays & dictLanguage.Item(Session("language")&"_sds_viewprd_1b") & "</div>"%>
            <% end if
    end if %>


Edited by knifepro - 14-July-2010 at 6:59pm
Brian

brian@theknifeprofessional.com
brian@heartlandbraidedrugs.com
www.theknifeprofessional.com
www.heartlandbraidedrugs.com
ProductCart v4.7
QuickBooks Sync
Mobile
Back to Top
knifepro View Drop Down
Newbie
Newbie


Joined: 18-February-2008
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote knifepro Quote  Post ReplyReply Direct Link To This Post Posted: 14-July-2010 at 9:37pm
Can anyone give me any ideas?
Brian

brian@theknifeprofessional.com
brian@heartlandbraidedrugs.com
www.theknifeprofessional.com
www.heartlandbraidedrugs.com
ProductCart v4.7
QuickBooks Sync
Mobile
Back to Top
knifepro View Drop Down
Newbie
Newbie


Joined: 18-February-2008
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote knifepro Quote  Post ReplyReply Direct Link To This Post Posted: 24-October-2010 at 4:35pm
I was successful in adding stock to my list view and I am still trying to add the "Ships with N Days" message to the items I allowed to be back ordered. I get the message to show but I can not get the value entered into the N Days to show. I would appreciate any help.

       <% if (scdisplayStock=-1) and (pNoStock=0) then %>
        <% if (pstock>0) then %>
            <p class="pcShowProductStock">
            <%response.write dictLanguage.Item(Session("language")&"_viewPrd_19") & " " & pStock %>
            </p>
        <% else %>
        <p class="pcShowProductStock">
        <% response.write dictLanguage.Item(Session("language")&"_sds_viewprd_1") & " " & pcv_intShipNDays %>
        </p>
        <% end if
    end if %>
Brian

brian@theknifeprofessional.com
brian@heartlandbraidedrugs.com
www.theknifeprofessional.com
www.heartlandbraidedrugs.com
ProductCart v4.7
QuickBooks Sync
Mobile
Back to Top
Greg Dinger View Drop Down
Certified ProductCart Developers
Certified ProductCart Developers
Avatar

Joined: 23-September-2006
Location: United States
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Greg Dinger Quote  Post ReplyReply Direct Link To This Post Posted: 24-October-2010 at 4:41pm
Brian - pStock and pcv_intShipNDays represent values that were retrieved from the product table.  If you are not getting those values to display, you need to make certain that you have listed the appropriate fields in your query, then populated the page-level variables to display them as presented above. make sense?
Back to Top
knifepro View Drop Down
Newbie
Newbie


Joined: 18-February-2008
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote knifepro Quote  Post ReplyReply Direct Link To This Post Posted: 24-October-2010 at 8:26pm
Greg,

It makes sense. Can you advise the file that links up to pcShowProductH.asp. pStock works and shows the number so it must be defined in a query. But I can fine no query in pcShowProduct.asp.
Brian

brian@theknifeprofessional.com
brian@heartlandbraidedrugs.com
www.theknifeprofessional.com
www.heartlandbraidedrugs.com
ProductCart v4.7
QuickBooks Sync
Mobile
Back to Top
Greg Dinger View Drop Down
Certified ProductCart Developers
Certified ProductCart Developers
Avatar

Joined: 23-September-2006
Location: United States
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Greg Dinger Quote  Post ReplyReply Direct Link To This Post Posted: 24-October-2010 at 8:38pm

What page are you working on?  ViewCategories.asp?  Another page?  Tthere are several that use pcShowProductH.asp for product summary formatting.

Back to Top
knifepro View Drop Down
Newbie
Newbie


Joined: 18-February-2008
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote knifepro Quote  Post ReplyReply Direct Link To This Post Posted: 26-October-2010 at 6:21pm
It is the viewcategories.asp. I see where the stock is query:

'// Query Products of current category
    query="SELECT products.idProduct, products.sku, products.description, products.price, products.listhidden, products.listprice, products.serviceSpec, products.bToBPrice, products.smallImageUrl,products.noprices,products.stock, products.noStock,products.pcprod_HideBTOPrice, POrder,products.FormQuantity,products.pcProd_BackOrder FROM products, categories_products WHERE products.idProduct=categories_products.idProduct AND categories_products.idCategory="& mIdCategory&" AND active=-1 AND configOnly=0 and removed=0 " & pcv_strCSFilters & query1
    set rs=Server.CreateObject("ADODB.Recordset")  
    rs.CacheSize=iPageSize
    rs.PageSize=iPageSize
    pcv_strPageSize=iPageSize

So I would add products.pcProd_ShipNDays.
Brian

brian@theknifeprofessional.com
brian@heartlandbraidedrugs.com
www.theknifeprofessional.com
www.heartlandbraidedrugs.com
ProductCart v4.7
QuickBooks Sync
Mobile
Back to Top
Greg Dinger View Drop Down
Certified ProductCart Developers
Certified ProductCart Developers
Avatar

Joined: 23-September-2006
Location: United States
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Greg Dinger Quote  Post ReplyReply Direct Link To This Post Posted: 26-October-2010 at 7:42pm
yes, add that field so that in the middle of the query you have this:

,products.pcProd_BackOrder,products.pcProd_ShipNDays
 
That gets the data pulled out, then you have to grab it for use on the page. Find the following statement, and add the next one below it.
 
pcv_intBackOrder=pcArray_Products(15,pCnt)
pcv_intShipNDays=pcArray_Products(16,pCnt)
Back to Top
knifepro View Drop Down
Newbie
Newbie


Joined: 18-February-2008
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote knifepro Quote  Post ReplyReply Direct Link To This Post Posted: 27-October-2010 at 6:26pm
Okay here is what I have in the query on viewcategories.asp:

query="SELECT products.idProduct, products.sku, products.description, products.price, products.listhidden, products.listprice, products.serviceSpec, products.bToBPrice, products.smallImageUrl,products.noprices,products.stock, products.noStock,products.pcprod_HideBTOPrice, POrder,products.FormQuantity,products.pcProd_BackOrder,products.pcProd_ShipNDays FROM products, categories_products WHERE products.idProduct=categories_products.idProduct AND categories_products.idCategory="& mIdCategory&" AND active=-1 AND configOnly=0 and removed=0 " & pcv_strCSFilters & query1

I also added pcv_intShipNDays=pcArray_Products(16,pCnt).

In the ShowProductH.asp I have the following:

   <% if (scdisplayStock=-1) and (pNoStock=0) then %>
        <% if (pstock>0) then %>
            <p class="pcShowProductStock">
            <%response.write dictLanguage.Item(Session("language")&"_viewPrd_19") & " " & pStock %>
            </p>
        <% else %>
        <p class="pcShowProductStock">
        <% response.write dictLanguage.Item(Session("language")&"_sds_viewprd_1") & pcProd_ShipNDays & dictLanguage.Item(Session("language")&"_sds_viewprd_1b") %>
        </p>
        <% end if
    end if %>
I am getting the text from the language.asp but not the value for N days. I have tried both pcProd_ShipNDays and pcv_intShipNDays in the above statement. Do I need to include the following in the in one of the files. If so where at:

pcv_intShipNDays = rs("pcProd_ShipNDays")



Brian

brian@theknifeprofessional.com
brian@heartlandbraidedrugs.com
www.theknifeprofessional.com
www.heartlandbraidedrugs.com
ProductCart v4.7
QuickBooks Sync
Mobile
Back to Top
Greg Dinger View Drop Down
Certified ProductCart Developers
Certified ProductCart Developers
Avatar

Joined: 23-September-2006
Location: United States
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Greg Dinger Quote  Post ReplyReply Direct Link To This Post Posted: 27-October-2010 at 7:33pm

I guided you as to what I believed was the correct code, based on looking at a page in another site.  If you are unable to tackle this it might be best to hire a developer.  Sorry, busy day.

Back to Top
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.