• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

drinehart
#1 Posted : Tuesday, September 2, 2008 11:54:59 AM(UTC)
drinehart

Rank: Member

Joined: 8/21/2008(UTC)
Posts: 12

I would like to restrict some items for sale in specific US states. I believe I can do this by simply removing the states from a dropdown list if product X is in the cart.


When I go to checkout.aspx.vb I don't see where this page captures the shopping cart through a post method so I assume everything goes to a session. Can someone tell me how to do the following:



1) Use VB.net to load the session to a variable

2) loop through the session looking for product X (or SKU)

3) change IsValid to FALSE so the person can't checkout (and produce an alert - "can't ship to state with product X")



or



4) when loading states if product X (or SKU) is found in session, do not display state in <option> secion



Duane
bvcoder
#2 Posted : Tuesday, September 2, 2008 2:52:40 PM(UTC)
bvcoder

Rank: Member

Joined: 8/1/2007(UTC)
Posts: 310

Hello Duane,

You need to first retrieve the Shopping Cart. SessionManager.CurrentShoppingCart will get you the basket. Then loop through the line items (Basket.Items) in the basket and figure out if your "NOT VALID" product is in the cart. If so, you may want to present an error message on the top of the Address page (use the same error control).

However, I dont understand one thing. How many products do you want to restrict? Is it only one? If so, then you are good to go with this. But in case if you end up with multiple products not being shipped to different states, then this solution will not work.

First, you will need to store that information (what product does not ship to which states?) somewhere in a matrix (in BV Admin). And then you need to automate the checking for products on whatever page you want. Thats the right way of doing it.

Thanks,
Satya
support @ bayquel.com
Thanks,
Satya
support @ bayquel.net
Work: +1 803 883 3226
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012