DwZone Forum DwZone Forum
Welcome to the DwZone-it Forum
 
  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups  
    RegisterRegister -->   LoginLogin  
Shopping Cart  
DwZone Forum Index -> Shopping Cart

Moderators: AdministratorsModerators 
Hint: For improved responsiveness, use Internet Explorer 4 (or above) with Javascript enabled, choose 'Dynamic' from the View dropdown and hit 'Set Options' to save your changes.
New Topic Search for
 View     Per page     Messages Since 
Messages 21 to 30 of 197 (Total: 93) First |  Prev |  Next |  Last  
 Subject Author Date  
   Re: Change : item_name  
View this persons public profile  Gianluigi   9:08 29 Nov 2011  
    query/reference an item in the cart  
View this persons public profile  Adrian Smith   2:52 17 Nov 2011  
 
Hi,

Is there anyway of referencing/accessing info from the cart using the product ID?

I want to query the cart before a user adds an item to their basket to check whether the item is already in the basket and if so what is the quantity is in ther basket (of that product).

For instance imagine I have a product with a stock level of 10 - if the user adds 5 to their basket and then continues shopping and goes back to that product I need to check whether the product is already in the basket and how many have been added (in this case 5) and therefore stop the customer from adding more than 5 to their basket on the second visit.

In the past you showed me how to access the last added item using this code:
<%
dim lastIndexItem
lastIndexItem = objCart.cartItems()-1
%>
<%=(objCart.GetColumnValue(lastIndexItem, "ProductName"))%>

(where ProductName was the name of my product)

Is it possible to use something similar to get the Quantity from the basket using the product ID (in my case IdProduct) - i.e. something like:

<%
dim myIndexItem
myIndexItem = objCart.cartItems(IdProduct)
%>
<%=(objCart.GetColumnValue(myIndexItem, "Quantity"))%>

I know the extension comes with lots of stock querying options but none of them fit what I'm trying to do.

Hope you can help.

Regards

Adrian
 
Reply to this current thread  View this persons public profile  Send Private Message
   Re: query/reference an item in the cart  
View this persons public profile  Gianluigi   9:44 17 Nov 2011  
   Re: query/reference an item in the cart  
View this persons public profile  Adrian Smith   0:30 18 Nov 2011  
   Grand total question  
View this persons public profile  Michel Post   2:44 24 Nov 2010  
   Re: Grand total question  
View this persons public profile  Gianluigi   10:50 24 Nov 2010  
   Re: Grand total question  
View this persons public profile  Michel Post   11:08 24 Nov 2010  
   Re: Grand total question  
View this persons public profile  Gianluigi   11:40 24 Nov 2010  
   Re: Grand total question  
View this persons public profile  Michel Post   13:47 24 Nov 2010  
   Re: Grand total question  
View this persons public profile  Gianluigi   14:43 24 Nov 2010  
Last Visit: Thursday 9 May, 2024 6:07 pm First |  Prev |  Next |  Last  
 Login
Username:  Password:    
Read Message Read Message   Unread message Unread message
Read message [popular] Read message [popular]   Unread message [popular] Unread message [popular]
Read message [locked] Read message [locked]   Unread message [locked] Unread message [locked]
All times are GMT-2

Jump to: