Forcing a Cart Save
Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=4252
Printed Date: 16-November-2024 at 1:22pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Forcing a Cart Save
Posted By: claydough
Subject: Forcing a Cart Save
Date Posted: 13-January-2011 at 4:26pm
I am developing a site with PC4.1 BTO and my client would like a way for someone to fill their cart, click on Save Cart, name that cart and see it in their saved carts list. Right now it looks like it doesn't save the cart until you leave, and come back...only then can you see it in your saved cart list and rename it.
Am I missing something with this functionality? It seems there is an easy jump to adding a feature to manually save a cart state.
Thanks!
------------- -----
Clay Johnston
Sprung
P: 952-303-3598
Visit us at: www.madebysprung.com
|
Replies:
Posted By: Brett
Date Posted: 23-January-2011 at 9:05am
I don't think you are missing anything. I don't have any clients, but I'll take a look at this and see if I can figure the code out for you. Like you said, it should be an easy jump!
|
Posted By: Brett
Date Posted: 23-January-2011 at 9:33am
Here you go:
<%if session("idcustomer")=0 then%>
Please log in to save this cart.
<%else%>
<a href="CustSavedCartsRename.asp?id=<%=IDSC%>">Save This Cart</a>
<%end if%>
|
I pasted it after the <h1> section of viewCart.asp. It must be somewhere on viewCart.asp. It must be after inc_SaveShoppingCart.asp.
So this isn't a technical limitation of ProductCart, and you didn't miss anything. It's just a simple feature request that takes 15 minutes to figure out and implement.
*edit*
Wow I just realized your post was from the 13th. I haven't been active for the past couple weeks, but hopefully this helps you and your client!
|
Posted By: claydough
Date Posted: 23-January-2011 at 1:54pm
Thanks Brett! You rock! I had no idea it would have been this easy. I'm somewhat embarrassed that I didn't see this. Works great. Many thanks!
------------- -----
Clay Johnston
Sprung
P: 952-303-3598
Visit us at: www.madebysprung.com
|
Posted By: Brett
Date Posted: 23-January-2011 at 4:47pm
No problem. Sorry for being a bit of an ass about it. I guess sometimes I forget that not everyone has spent the greater part of a year or two exploring productcarts sometimes strange quirks. The answer came intuitively to me because I've had to mess with stuff like that so many times. Thankfully productcart is one of the easiest platforms to modify and extend. I hope it continues to work well for you and I'm sure you'll find most of the community here are much nicer than me ;)
|
Posted By: Hamish
Date Posted: 25-January-2011 at 6:23pm
Hi Claydough, Thanks for asking the question & Hi Brett, thanks for posting a solution. It seems like a good idea so we will look into making it an option in the next release.
Regards, Hamish
------------- Editing ProductCart Code?
See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code
|
Posted By: avalight
Date Posted: 28-January-2011 at 9:00pm
Brett Can you tell me what line are you suggesting to insert this code? I see the <h1> tag, and I would like to have the save text appear right below cart total. Thanks Curt
------------- Curt
|
Posted By: avalight
Date Posted: 28-January-2011 at 9:01pm
Hamish- do you think this post should be moved to customizing productcart.?
------------- Curt
|
Posted By: Brett
Date Posted: 29-January-2011 at 6:31am
I think it probably should be moved. Curt ill let you know in an hour or so when I'm at laptop.
|
Posted By: Brett
Date Posted: 29-January-2011 at 7:38am
Hey avalight, put this code at line 1591 (might be different on your cart page if mine has been edited - i'm not sure if it has been):
<%if session("idcustomer")=0 then%>
<div style="text-align:right; clear: both;">
Please log in to save this cart.
</div>
<%else%>
<div style="text-align:right; clear: both;">
<a href="CustSavedCartsRename.asp?id=<%=IDSC%>">Save This Cart</a>
</div>
<%end if%>
|
It should go just before this section:
<%' ------------------------------------------------------
' START - Show estimated shipping charges link
' ------------------------------------------------------
if iShipService=0 then
if scShowEstimateLink="-1" then %>
|
|
Posted By: Hamish
Date Posted: 29-January-2011 at 7:55am
Hi Avalight, Good idea, I'll move it to Customizing ProductCart
------------- Editing ProductCart Code?
See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code
|
Posted By: avalight
Date Posted: 29-January-2011 at 3:04pm
Okay Brett Here is the code I ended up using. Beginning with yours, I added a link for someone to jump directly to the login screen in case they weren't already logged in, and also once they were logged in, the link changes so they can view all their saved carts, not the page where they can rename their carts. As far as code placement , tried putting the code where you suggested, and it didn't show up. So thru trial and error, the only place I could get it to show up in a decent place in the storefront was just before the code section labeled BTO ADDON-S - Putting it here makes the links show up above the cart contents, under the checkout button. I couldn't get it to show up at the bottom of the page, where it would be more noticable. Maybe there is another asp file that gets loaded for that section of the page...who knows.
<% 'avalight: Add save cart functionality per forum post 4252 if session("idcustomer")=0 then%> <div style="text-align:right; clear: both;">
Please <a href="/productcart/pc/Checkout.asp?cmode=1">log in or register</a> to save this cart.
</div>
<%else%> <div style="text-align:right; clear: both;">
<a href="CustSavedCarts.asp">View or Save Cart</a>
</div>
<%end if%>
|
So there you have it. At least it is there and is functional. Thanks again curt
------------- Curt
|
Posted By: Brett
Date Posted: 29-January-2011 at 5:15pm
hey Curt,
im glad you got it working! what's funny is the only tricky thing I really did was pull the save cart id and append that to the CustSavedCarts url. now all you've done is provide a link to the view or save cart page, which already exists in custpref.asp. however, i agree that it is far more useful on the shopping cart page, for this particular use.
Here's my viewCart.asp, where I have the link just below the list of cart items and the <hr>. the problem with the previous code may have been a lack of table row and divisions.
Here's a screenshot of the portion of the cart where you can see the link is displayed:
uploads/1159/viewcart.zip - viewcart.zip
Here's the edited code:
<tr>
<td colspan="6">
<%
'avalight: Add save cart functionality per forum post 4252
if session("idcustomer")=0 then%>
<div style="text-align:right; clear: both;">
Please <a href="/productcart/pc/Checkout.asp?cmode=1">log in or register</a> to save this cart.
</div>
<%else%>
<div style="text-align:right; clear: both;">
<a href="CustSavedCarts.asp">View or Save Cart</a>
</div>
<%end if%>
</td>
</tr>
|
I put it right above:
<%' Calculate & display order total
total=total-CatDiscTotal-TotalPromotions %>
|
|
Posted By: Brett
Date Posted: 29-January-2011 at 5:26pm
you might like this:
<%
'avalight: Add save cart functionality per forum post 4252
if session("idcustomer")=0 then%>
<div style="text-align:right; clear: both;">
Please <a href="/productcart/pc/Checkout.asp?cmode=1">log in or register</a> to save this cart.
</div>
<%else%>
<form action="CustSavedCartsRename.asp" method="post" class="pcForms">
<input type="hidden" value="<%=IDSC%>" name="id">
<table class="pcMainTable"><tbody>
<tr>
<td><input type="text" value="Save this cart" name="SavedCartName" size="50"> <input type="submit" name="submit" class="submit2" value="Save Cart"></td>
</tr>
</tbody></table>
</form>
<%end if%>
|
If they are logged out, it will show them the login link like you had. If they are logged in, it will show them a form to name and save the cart directly from the viewCart.asp page. The stipulation is this code must be OUTSIDE the other main <form> from the page. I put it right before the opening <form, just after "<% '// START main form %>"
You could probably also put it after the end of that form, it just can't be inside because I guess you can't have a form within a form.
|
|