Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 9 of 9

Thread: Dynamically Add Multiple Products to the cart

  1. #1
    hjavaher is offline Member
    Join Date
    May 2009
    Posts
    34

    Default Dynamically Add Multiple Products to the cart

    Hi,
    I have read the post about how to dynamically add products to the shopping cart at http://forums.aspdotnetstorefront.co...ead.php?t=5771 but I can not figure out how to add multiple products at the same time.
    My scenario is that I was asked to make a Express Order option on the site where on that page the customer is shown a list of all the products in their customer level. they can then select quantities for any of the products and then click one button to send them all to the shopping cart.

    any help would be greatly appreciated.
    Thanks,
    Hiva

  2. #2
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    You'll probably have to tweak it a bit, but we have an entity.tableorderform.xml.config xmlpackage that you can set on an entity (Category, Manufacturer, etc...) that will list all products in that entity with a quantity box. The user can enter in quantities for any of the items listed there, and then click one add to cart button to add all of those items to the cart. The modifications you'll need to make will be to only show the products for the customer level of the customer that is signed in. You may also want to force the customer to login to be able to view that particular page if you are going to filter on customer level, unless you don't care if a customer sees one set of products when adding to the cart anonymously and then a separate set of products once logged in.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  3. #3
    hjavaher is offline Member
    Join Date
    May 2009
    Posts
    34

    Default

    Wow that's actually great. Exactly what I need Thanks. how can I easily pull the customer level of the current logged in customer both through VB.net and the XML Package that you mentioned?

    Thank you,
    Hiva

  4. #4
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    In any of the codebehind pages that inherit from the SkinBase class, you can just use
    Code:
    ThisCustomer.CustomerLevelID
    to get the integer value representing the customer level id or
    Code:
    ThisCustomer.CustomerLevelName
    to get the string value representing the customer level name (will be blank if the customer is not logged in or a member of the default (Level 0) customer level).

    To get this in the xmlpackage, just use
    Code:
    <xsl:value-of select="/root/Runtime/CustomerLevelID" />
    or
    Code:
    <xsl:value-of select="/root/Runtime/CustomerLevelName" />
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  5. #5
    hjavaher is offline Member
    Join Date
    May 2009
    Posts
    34

    Default

    also, I'm a bit new to ASPDotNetStorefront, how would I make use of this package? (How would I display this?)

    Thank you,
    Hiva

  6. #6
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    In the admin section you would browse to one of your categories, click to edit, then set the xmlpackage of that category to the entity.tableorderform.xml.config xmlpackage. Then save the changes by clicking the update button, then click the Reset Cache link in the admin section. Now when you browse to the page it will be using that display format.

    Additional information on xmlpackages can be found in our manual here
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  7. #7
    hjavaher is offline Member
    Join Date
    May 2009
    Posts
    34

    Default

    Im sorry for a lot of questions but is there a way of making a custom aspx page that will utilize and display this package?

    Thank you,
    Hiva

  8. #8
    hjavaher is offline Member
    Join Date
    May 2009
    Posts
    34

    Default

    Last Think I promise, I am Looking at that XML Package you were talking about and it doesn't seem to display all the variants to a product???? why is that? how can this be solved?

    Thank you,
    Hiva

  9. #9
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    That's the way it was designed...to just display a simple list of products in that entity, using the default variant of that product as the piece to display. You should just be able to change the @ViewType value in the stored procedure call at the top of the package from 1 to 0
    Code:
    @ViewType = 0,
    to force the stored procedure to return all variants instead of just the default variant.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>