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

Thread: Query/Code for Import

  1. #1
    EAD is offline Junior Member
    Join Date
    Feb 2010
    Posts
    6

    Post Query/Code for Import

    Quote:
    Originally Posted by AspDotNetStorefront Staff - George View Post
    For which type of coupon (product or order), for what kind of discount (amount or percent), and will there be any restrictions on number of uses, expiration, or products?
    Product coupon, amount discount and no restriction on number of uses but restriction on products.

    Basically, I want to use coupons as an additionally method of discounts for selected products for selected users.

  2. #2
    Rob is offline Senior Member
    Join Date
    Aug 2004
    Posts
    3,037

    Default

    Ok. but i'm not quite sure what the question is here?
    AspDotNetStorefront
    Shopping Cart

  3. #3
    EAD is offline Junior Member
    Join Date
    Feb 2010
    Posts
    6

    Default

    Well, I've asked the question in two threads now and every time I follow up with the additional information that was asked I get no response.

    I am looking for sample sql queries/sample code for importing coupons through WSI.

  4. #4
    Mike The Last Boyscout is offline User
    Join Date
    Nov 2008
    Posts
    254

    Default

    You can't add coupons through WSI the way you do with products or customers, we just haven't implemented that yet. You'd need to use the ExecuteSQL node to do a direct DB insert - something along the lines of:

    Code:
    <ExecuteSQL Name="string">
    <SQL>
    <![CDATA[
    INSERT INTO Coupon           (CouponCode,Description,StartDate,ExpirationDate,DiscountPercent,DiscountAmount,ExpiresOnFirstUseByAnyCustomer,ExpiresAfterOneUsageByEachCustomer,ExpiresAfterNUses,RequiresMinimumOrderAmount,Deleted,CreatedOn) 
             VALUES(somecode,somename,getdate(),getdate()+30,10,0,0,1,5,0,0,getdate())
    
    ]]>
    </SQL>
    </ExecuteSQL>

    *Please ensure that you have a full, functioning backup before making any code modifications or file changes to your AspDotNetStorefront website, or running any ad-hoc queries against your database. Improperly making code modifications or running queries against your database can cause your website to be non-functional and/or your data to be permanently lost. As part of your disaster recovery plan, you should make regular backups of all files and data, and perform periodic checks to ensure your backups function properly. If you are not sure if your data is adequately protected, contact an IT professional or your hosting provider for assistance.