473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Shopping cart-fly to basket in asp.net

hi all. i saw one dhtml program in the url http://www.dhtmlgoodies.com/index.html?whichScript=fly-to-basket. i need the same thing in asp.net. In my program products binded in datalist.. when i click 'addtobasket' items should be added automatically in shopping cart... any one have any sweet idea...? or some other way?
Thank you.
Dec 12 '07 #1
9 4131
http://www.google.com/search?hl=en&q...ing+cart&meta=
hi. I need shopping cart items automatically fly in to the shopping list. Do u know any other script for this.. just check it up the following url:
http://www.dhtmlgoodies.com/index.html?whichScript=fly-to-basket. i need output like this. that means product added in the shopping cart visually shown to the users...
thaks for ur reply...
Dec 12 '07 #3
radcaesar
759 Expert 512MB
Download that script

In that script itself, u will find a js/fly-to-basket.js file. Inside that there will be a method addToBasket(productId). This is the method which performs that functionality. Can't u edit this code based on ur requirement ?

:)

hi all. i saw one dhtml program in the url http://www.dhtmlgoodies.com/index.html?whichScript=fly-to-basket. i need the same thing in asp.net. In my program products binded in datalist.. when i click 'addtobasket' items should be added automatically in shopping cart... any one have any sweet idea...? or some other way?
Thank you.
Dec 12 '07 #4
Download that script

In that script itself, u will find a js/fly-to-basket.js file. Inside that there will be a method addToBasket(productId). This is the method which performs that functionality. Can't u edit this code based on ur requirement ?

:)
I have used Datalist in asp.net.. Products bind with in the Datalist.. so i couldnt pass dynamic value to that addtobasket() function.. and also that js method didnt support dynamic value.. i am new to asp.net .. so i couldnt make it for my requirement... do u have any idea...


To use that method we have to pass dynamic value to div tag id properties.. ie
<div id="slidingProducts"+ProductId>.. is it possible...
Dec 12 '07 #5
radcaesar
759 Expert 512MB
Don't prefer to use server controls and server validations for this kind of requirements.

If you use datalist, then achieve this requirement (Fly) using javascript codes.

In the onclick event of the datalist call the js method.

like, onclick="javascript:methostofly()" also u should use divs to show the objects. There will be no other solutions, u have to change ur UI design for this functionality.
Dec 12 '07 #6
Don't prefer to use server controls and server validations for this kind of requirements.

If you use datalist, then achieve this requirement (Fly) using javascript codes.

In the onclick event of the datalist call the js method.

like, onclick="javascript:methostofly()" also u should use divs to show the objects. There will be no other solutions, u have to change ur UI design for this functionality.
thanks for your reply. this is my datalist coding..

<asp:DataList ID="dlstProductDetails" runat="server" RepeatDirection="Horizontal" RepeatColumns="3" HorizontalAlign="Center" >
<ItemTemplate>

<asp:ImageButton ID="imgbtnProductImage" runat="server" ImageUrl='<%#"images.aspx?id=" + Eval("ProductNo")%>' Height="100" Width="100" Commandname='<%#DataBinder.Eval(Container.DataItem , "ProductNo")%>' OnCommand="Filterdescription"/><br/>
<asp:Label ID="lblProductName" runat ="server" Text ='<%#DataBinder.Eval(Container.DataItem, "Productname")%>'></asp:Label>
<asp:Label ID="lblHyp" runat="server" text=" - " ForeColor="#ff8000"/>
<asp:Label ID="lblModelNo" runat ="server" Text ='<%#DataBinder.Eval(Container.DataItem, "ModelNo")%>'></asp:Label>
<br />
<asp:Label ID="lblrs" runat="server" text="RS." ForeColor="#ff8000"/>
<asp:Label ID="lblPrice" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SalesPrice")%>' ForeColor="#ff8000" ></asp:Label>
<br />
<asp:LinkButton ID="lnkbtnAddToCart" runat="server" Commandname='<%#DataBinder.Eval(Container.DataItem , "ProductNo") %> ' OnCommand="FilterData" >Add to cart</asp:LinkButton> &nbsp;&nbsp;&nbsp;&nbsp;
<asp:LinkButton ID="lnkViewCart" runat="server" PostBackUrl="~/shoppingCart.aspx">View Cart</asp:LinkButton> &nbsp;&nbsp;&nbsp;&nbsp;

</ItemTemplate>
</asp:DataList>


here when i click the "lnkbtnAddtoCart" link that the product add in list.. that visually shown to user.. i couldnt do this using client control.. i have to pass dynamic value to that script.. do u get my point?
thanks
Dec 12 '07 #7
radcaesar
759 Expert 512MB
Use Datareader

Get the values u want using while (Datareader.read())

Bind it inside a table and show images in a div

In Onclick of the div, write this fly functionality

After the user has added products to cart, allow him to submit the pages.
Dec 12 '07 #8
Use Datareader

Get the values u want using while (Datareader.read())

Bind it inside a table and show images in a div

In Onclick of the div, write this fly functionality

After the user has added products to cart, allow him to submit the pages.
hi. thank u for your reply.
i cant pass dynamic productid to that addtobasket javascript function.
this is my function..
function addToBasket(productId)
{
if(!shopping_cart_div)shopping_cart_div = document.getElementById('shopping_cart');
if(!flyingDiv){
flyingDiv = document.createElement('DIV');
flyingDiv.style.position = 'absolute';
document.body.appendChild(flyingDiv);
}

shopping_cart_x = shoppingCart_getLeftPos(shopping_cart_div);
shopping_cart_y = shoppingCart_getTopPos(shopping_cart_div);

currentProductDiv = document.getElementById('slidingProduct' + productId);

currentXPos = shoppingCart_getLeftPos(currentProductDiv);
currentYPos = shoppingCart_getTopPos(currentProductDiv);

diffX = shopping_cart_x - currentXPos;
diffY = shopping_cart_y - currentYPos;



var shoppingContentCopy = currentProductDiv.cloneNode(true);
shoppingContentCopy.id='';
flyingDiv.innerHTML = '';
flyingDiv.style.left = currentXPos + 'px';
flyingDiv.style.top = currentYPos + 'px';
flyingDiv.appendChild(shoppingContentCopy);
flyingDiv.style.display='block';
flyingDiv.style.width = currentProductDiv.offsetWidth + 'px';
flyToBasket(productId);

}
this is my asp.net code


<asp:DataList ID="dlstProductDetails" runat="server" RepeatDirection="Horizontal" RepeatColumns="3" HorizontalAlign="Center" style="text-align: center" Width="100%" SkinID="DataList" >
<ItemTemplate>
<div id="slidingProduct+dynamicvalue" class="sliding_product"><asp:ImageButton ID="imgbtnProductImage" runat="server" ImageUrl='<%#"images.aspx?id=" + Eval("ProductNo")%>' Height="100" Width="100" Commandname='<%#DataBinder.Eval(Container.DataItem , "ProductNo")%>' OnCommand="Filterdescription"/>
<br/>
<asp:Label ID="lblProductName" runat ="server" Text ='<%#DataBinder.Eval(Container.DataItem, "Productname")%>'></asp:Label>
<asp:Label ID="lblHyp" runat="server" text=" - " ForeColor="#ff8000"/>
<asp:Label ID="lblModelNo" runat ="server" Text ='<%#DataBinder.Eval(Container.DataItem, "ModelNo")%>'></asp:Label>
<br />
<asp:Label ID="lblrs" runat="server" text="RS." ForeColor="#ff8000"/>
<asp:Label ID="lblPrice" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SalesPrice")%>' ForeColor="#ff8000" ></asp:Label>
<asp:Label ID="Label1" runat ="server" Text ='<%#DataBinder.Eval(Container.DataItem, "ProductNo")%>'></asp:Label>

<br />
<a href="#" onclick="addToBasket(productno);return false;"><img src="images/basket.gif"></a>

</div>
</ItemTemplate>
</asp:DataList>

just see those functions. i need to pass dynamic value to addtobasket method and div id


do u have any idea... pls modify this code for my requirement.. thaks again..
Dec 13 '07 #9
hi. thank u for your reply.
i cant pass dynamic productid to that addtobasket javascript function.
this is my function..
function addToBasket(productId)
{
if(!shopping_cart_div)shopping_cart_div = document.getElementById('shopping_cart');
if(!flyingDiv){
flyingDiv = document.createElement('DIV');
flyingDiv.style.position = 'absolute';
document.body.appendChild(flyingDiv);
}

shopping_cart_x = shoppingCart_getLeftPos(shopping_cart_div);
shopping_cart_y = shoppingCart_getTopPos(shopping_cart_div);

currentProductDiv = document.getElementById('slidingProduct' + productId);

currentXPos = shoppingCart_getLeftPos(currentProductDiv);
currentYPos = shoppingCart_getTopPos(currentProductDiv);

diffX = shopping_cart_x - currentXPos;
diffY = shopping_cart_y - currentYPos;



var shoppingContentCopy = currentProductDiv.cloneNode(true);
shoppingContentCopy.id='';
flyingDiv.innerHTML = '';
flyingDiv.style.left = currentXPos + 'px';
flyingDiv.style.top = currentYPos + 'px';
flyingDiv.appendChild(shoppingContentCopy);
flyingDiv.style.display='block';
flyingDiv.style.width = currentProductDiv.offsetWidth + 'px';
flyToBasket(productId);

}
this is my asp.net code


<asp:DataList ID="dlstProductDetails" runat="server" RepeatDirection="Horizontal" RepeatColumns="3" HorizontalAlign="Center" style="text-align: center" Width="100%" SkinID="DataList" >
<ItemTemplate>
<div id="slidingProduct+dynamicvalue" class="sliding_product"><asp:ImageButton ID="imgbtnProductImage" runat="server" ImageUrl='<%#"images.aspx?id=" + Eval("ProductNo")%>' Height="100" Width="100" Commandname='<%#DataBinder.Eval(Container.DataItem , "ProductNo")%>' OnCommand="Filterdescription"/>
<br/>
<asp:Label ID="lblProductName" runat ="server" Text ='<%#DataBinder.Eval(Container.DataItem, "Productname")%>'></asp:Label>
<asp:Label ID="lblHyp" runat="server" text=" - " ForeColor="#ff8000"/>
<asp:Label ID="lblModelNo" runat ="server" Text ='<%#DataBinder.Eval(Container.DataItem, "ModelNo")%>'></asp:Label>
<br />
<asp:Label ID="lblrs" runat="server" text="RS." ForeColor="#ff8000"/>
<asp:Label ID="lblPrice" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SalesPrice")%>' ForeColor="#ff8000" ></asp:Label>
<asp:Label ID="Label1" runat ="server" Text ='<%#DataBinder.Eval(Container.DataItem, "ProductNo")%>'></asp:Label>

<br />
<a href="#" onclick="addToBasket(productno);return false;"><img src="images/basket.gif"></a>

</div>
</ItemTemplate>
</asp:DataList>

just see those functions. i need to pass dynamic value to addtobasket method and div id


do u have any idea... pls modify this code for my requirement.. thaks again..
any one know answer for my previous post?
Dec 14 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Don Grover | last post by:
I am retrieving costs and product id's from a sql db. and need to build a shopping cart around it. How do I store the selected items and qty req so I can move into another catalog and total up as...
1
by: madison | last post by:
Hi, I am trying to start a website using paypals shopping cart function. If i have 10 items and they sell out, how do I make it so the item is then listed as sold out. The next person would not...
1
by: Jia Sun | last post by:
hello , everybody , i need a similar program , just like fancyimport.com if possible, pls contact me ,thank you very much . inchina@gmail.com
1
by: Adil Akram | last post by:
I have created a site shopping cart in ASP.net. I am using ASP session object's SessionID on non SSL connection to track session. While adding products to cart DB I insert product and SessionID...
2
by: G.E.M.P | last post by:
High Level Session Handling Design for a Shopping cart 0) What am I missing? 1) How does OSCommerce do it? I'm thinking about building a shopping cart from scratch, using a library of dynamic...
7
by: isaac2004 | last post by:
hi i have a basic asp page that acts as an online bookstore. on my cart page i am having trouble generating 3 numbers; a subtotal, a shipping total, and a final price. here is my code i would...
1
by: jecha | last post by:
I'm implementing a shopping cart but am having a problem in checking out a person who has added item in his/her shopping busket.The code for the checkout.php script is given below <?...
15
gregerly
by: gregerly | last post by:
Hello, I once again turn to this community of genius' for some help with a problem. I've got a shopping cart (which is working well so far) that I will be implementing all kinds of AJAX...
3
by: Paulo | last post by:
Hi, beginner on asp.net 2.0 C# VS 2005, how can I use the shopping cart concept on my application? When the user clicks add item, it will be stored on some storage format, I dont know what is the...
6
by: frank | last post by:
can anyone point me to a free shopping-cart script?
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.