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 |
|
|