ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Customizing ProductCart
  New Posts New Posts RSS Feed - Forcing a Cart Save
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forcing a Cart Save

 Post Reply Post Reply Page  <12
Author
Message
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 29-January-2011 at 7:55am
Hi Avalight, Good idea, I'll move it to Customizing ProductCart
Back to Top
avalight View Drop Down
Newbie
Newbie


Joined: 21-September-2007
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote avalight Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Brett View Drop Down
Groupie
Groupie
Avatar

Joined: 22-April-2008
Location: Phoenix, AZ
Status: Offline
Points: 89
Post Options Post Options   Thanks (0) Thanks(0)   Quote Brett Quote  Post ReplyReply Direct Link To This Post 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:


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 %>
Back to Top
Brett View Drop Down
Groupie
Groupie
Avatar

Joined: 22-April-2008
Location: Phoenix, AZ
Status: Offline
Points: 89
Post Options Post Options   Thanks (0) Thanks(0)   Quote Brett Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply Page  <12
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.