Quantcast
Channel: NBStore Discussions Rss Feed
Viewing all articles
Browse latest Browse all 4081

New Post: Add Item into Cart by SQL Insert

$
0
0
Hi,
In the CurrentCart.vb there is a functioncalled setCartID
    Private Shared Sub setCartID(ByVal PortalID As Integer, ByVal cartID As String)
        Dim CartCookieName As String = "NB_Store_Portal_"

        If GetStoreSetting(PortalID, "cookiecart.byuser", "None") = "1" Then
            CartCookieName = CartCookieName & "_" & HttpContext.Current.User.Identity.Name & "_"
        End If

        Dim cartCookie As HttpCookie = New HttpCookie(CartCookieName & PortalID.ToString)
        cartCookie("CartID") = cartID
        Dim cookieExpire As Integer = 30

        If GetStoreSetting(PortalID, "cookiecart.expire", "None") = "0" Then
            cartCookie.Expires = Nothing
        Else
            If IsNumeric(GetStoreSetting(PortalID, "cookiecart.expire", "None")) Then
                cookieExpire = CInt(GetStoreSetting(PortalID, "cookiecart.expire", "None"))
            End If
            cartCookie.Expires = DateAdd(DateInterval.Day, cookieExpire, Today)
        End If

        HttpContext.Current.Response.Cookies.Add(cartCookie)
    End Sub
Obviously this is private, so you can't call it. But you might be able to copy it, the problem comes on how you place it onto the user PC, I don't know what process flow you have for your store, but you'll need to inject this onto the user PC before they got the cart page.

I've not tried this, so you'll have to see how you go!

Regards,
Dave.

Viewing all articles
Browse latest Browse all 4081

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>