Program Structure

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Program Structure

Marc Pinnell-3
Afternoon all,

I have a client that is asking questions (demanding features - is  
there a difference?!) that is making me question my methodology with  
Lasso. His biggest complaint centers around the "back" button in his  
browser. Currently the site flows like this:

Products Page >> Update Cart Inline Page >> Display Cart Page

He wants to be able to hit the back button in his browser and go to  
the Products Page (I guess to order more stuff) rather than hit the  
menu item or page link.

So, in thinking about this and browsing the archives, I wonder if I  
have been stuck in an "old" method of Lasso or at some rather I just  
went down the wrong road with my programming. Should I be doing the  
Update Inlines on the top of the Display Cart Page? If I do that and  
someone clicks on the "cart" button, then would I do some type of  
[If] statement check to avoid adding blanks to the cart? Should I be  
looking in Ajax solutions?

Help, I'm so confused!

Thanx for any advice
Marc

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Program Structure

Doug Gentry
Every time I try an answer to something like this I'm sure there are  
a dozen more sophisticated approaches out there, but here goes anyway...

One way to approach this is as you speculated. Put the update inlines  
on the Display Cart page. Have them test for the presence of an  
action_param that tells you a real action took place and needs  
dealing with. (So the form action on the product page passes an  
action_param like "add" for example.) The absence of the action_param  
would say "skip those update inlines and just display the cart  
contents." The presence of the action_param would trigger the update  
inlines, and then a fresh search of the cart in order to display it.  
I'm pretty sure that using the browser button doesn't trigger the old  
add/update action - it just displays the page results. If I'm wrong  
about this, then you'd need a more sophisticated test.

I guess another way you could do it, but I'm not sure I see the  
advantage to it, is to have your "Update Cart Inline Page" be a sort  
of process page, that then does a redirect_url to the Display Cart  
page. Adding an item to the cart passes control to the process page,  
but the client never sees it, and instead after it is done with its  
work things are passed to the display page.

And, of course our new set of AJAX jockeys probably have a ton of  
nifty ideas.

...Doug Gentry

On Jun 7, 2006, at 3:14 PM, Marc Pinnell wrote:

> Afternoon all,
>
> I have a client that is asking questions (demanding features - is  
> there a difference?!) that is making me question my methodology  
> with Lasso. His biggest complaint centers around the "back" button  
> in his browser. Currently the site flows like this:
>
> Products Page >> Update Cart Inline Page >> Display Cart Page
>
> He wants to be able to hit the back button in his browser and go to  
> the Products Page (I guess to order more stuff) rather than hit the  
> menu item or page link.
>
> So, in thinking about this and browsing the archives, I wonder if I  
> have been stuck in an "old" method of Lasso or at some rather I  
> just went down the wrong road with my programming. Should I be  
> doing the Update Inlines on the top of the Display Cart Page? If I  
> do that and someone clicks on the "cart" button, then would I do  
> some type of [If] statement check to avoid adding blanks to the  
> cart? Should I be looking in Ajax solutions?
>
> Help, I'm so confused!
>
> Thanx for any advice
> Marc
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription: http://www.listsearch.com/ 
> lassotalk.lasso?manage


---
Doug Gentry
Dynapolis & Southern Oregon University
p:  541-261-8501 / Toll Free: 888-490-0644
[hidden email]


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Program Structure

Clive Bruton
In reply to this post by Marc Pinnell-3

On 7 Jun 2006, at 23:14, Marc Pinnell wrote:

> Products Page >> Update Cart Inline Page >> Display Cart Page

Do you mean you do a redirect after the update or something?

I don't really see much point in showing the customer an "update"  
page (maybe you have a good reason), I'd just put the update inline  
at the top of the display cart page, with some logic as Doug suggests.

There are other approaches, like actually not leaving the product  
page at all, if you're just adding one item to the order (ie logic in  
the product page calls update inlines when necessary). I've got an  
example of this:

        Go to secure.indx.co.uk/fontzone/shop/

        Click on "Publications"

        In the publications section click "quick add"

Notice that you're still in the publications listing, with some  
update notification. To see the order details click "your order".


-- Clive

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Program Structure

Marc Pinnell-3
In reply to this post by Marc Pinnell-3
Yes, the "update cart inline page" is just an inline (with some error  
checking) and a js redirect. I will check out your page, thanks!

Marc


On Jun 7, 2006, at 4:06 PM, Clive Bruton wrote:

>
> On 7 Jun 2006, at 23:14, Marc Pinnell wrote:
>
>> Products Page >> Update Cart Inline Page >> Display Cart Page
>
> Do you mean you do a redirect after the update or something?
>
> I don't really see much point in showing the customer an "update"  
> page (maybe you have a good reason), I'd just put the update inline  
> at the top of the display cart page, with some logic as Doug suggests.
>
> There are other approaches, like actually not leaving the product  
> page at all, if you're just adding one item to the order (ie logic  
> in the product page calls update inlines when necessary). I've got  
> an example of this:
>
> Go to secure.indx.co.uk/fontzone/shop/
>
> Click on "Publications"
>
> In the publications section click "quick add"
>
> Notice that you're still in the publications listing, with some  
> update notification. To see the order details click "your order".
>
>
> -- Clive
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription: http://www.listsearch.com/ 
> lassotalk.lasso?manage


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Program Structure

Paul Melia
In reply to this post by Marc Pinnell-3

On Jun 7, 2006, at 6:45 PM, Doug Gentry wrote:

>
> And, of course our new set of AJAX jockeys probably have a ton of  
> nifty ideas.

Actually, in Ajax land, the back button is the obnoxious uncle at  
family gatherings that everyone tolerates but doesn't want to get  
stuck sitting next to at the table.

The Dojo framework has a methodology/solution for handling back  
button usage, so if you are considering an Ajax solution, that is  
where I would start.

http://dojo.jot.com/WikiHome/BackButtonPatterns

FWIW,
Paul

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Program Structure

Clive Bruton
In reply to this post by Marc Pinnell-3

On 8 Jun 2006, at 00:34, Marc Pinnell wrote:

> Yes, the "update cart inline page" is just an inline (with some  
> error checking) and a js redirect.

Ok, then I think Doug is right, you just need some logic in the page  
that shows the cart to determine whether there is an update required  
or not, before you show the cart. Rather than having two page steps.

        {if: I need to do an update ]

                add an item

        [/if]

        run routines to display cart


-- Clive

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Program Structure

Marc Pope
In reply to this post by Marc Pinnell-3
Sorrt to get in on this late, but if you have the inline -add at the top of
the cart page, if someone hits the "refresh" button in the browser (they do
it, trust me) then it will double add to the cart. It's much better practice
IMO to add to cart on a hidden page and then use redirect_url to show the
cart. This way they can both hit the back button and the refresh without an
issue. The back button will not go to the hidden cart page.

If you wanted the cart page to show that an action happened, just make the
cart page have a action_param in it like:

http://somedomain.com/shop/cart.lasso?action=add

Then on the cart page, you could say the item has been added to their cart.
Even if they refresh it will say that without repeating the event.

Make sense? Hope so. I've been doing this for years and I've never had a
complaint.

HTH,
Marc



On 6/7/06 8:48 PM, "Clive Bruton" <[hidden email]> wrote:

>
> On 8 Jun 2006, at 00:34, Marc Pinnell wrote:
>
>> Yes, the "update cart inline page" is just an inline (with some
>> error checking) and a js redirect.
>
> Ok, then I think Doug is right, you just need some logic in the page
> that shows the cart to determine whether there is an update required
> or not, before you show the cart. Rather than having two page steps.
>
> {if: I need to do an update ]
>
> add an item
>
> [/if]
>
> run routines to display cart
>
>
> -- Clive
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage



------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Program Structure

Clive Bruton
In reply to this post by Marc Pinnell-3

On 8 Jun 2006, at 15:36, Marc Pope wrote:

> It's much better practice
> IMO to add to cart on a hidden page and then use redirect_url to  
> show the
> cart. This way they can both hit the back button and the refresh  
> without an
> issue. The back button will not go to the hidden cart page.

What's a "hidden" page?

If you want to stop people adding duplicate items it's much better to  
put the logic in the code that prevents such. On the site I pointed  
to previously I don't do that very much, but there are items there  
that you can only ever order one of per session - you get an error  
when trying to add more. There's also a global setting that can  
prevent any duplicate items, with a single variable in the site config.


-- Clive

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Program Structure

Marc Pinnell-3
In reply to this post by Marc Pinnell-3
Marc,

If I understand what you are saying, if I simply replace the JS  
redirect with the [redirect_url] then the back button will go from  
Cart to Product page and skip the "hidden" inline page?

Marc


On Jun 8, 2006, at 7:36 AM, Marc Pope wrote:

> Sorrt to get in on this late, but if you have the inline -add at  
> the top of
> the cart page, if someone hits the "refresh" button in the browser  
> (they do
> it, trust me) then it will double add to the cart. It's much better  
> practice
> IMO to add to cart on a hidden page and then use redirect_url to  
> show the
> cart. This way they can both hit the back button and the refresh  
> without an
> issue. The back button will not go to the hidden cart page.
>
> If you wanted the cart page to show that an action happened, just  
> make the
> cart page have a action_param in it like:
>
> http://somedomain.com/shop/cart.lasso?action=add
>
> Then on the cart page, you could say the item has been added to  
> their cart.
> Even if they refresh it will say that without repeating the event.
>
> Make sense? Hope so. I've been doing this for years and I've never  
> had a
> complaint.
>
> HTH,
> Marc
>
>
>
> On 6/7/06 8:48 PM, "Clive Bruton" <[hidden email]> wrote:
>
>>
>> On 8 Jun 2006, at 00:34, Marc Pinnell wrote:
>>
>>> Yes, the "update cart inline page" is just an inline (with some
>>> error checking) and a js redirect.
>>
>> Ok, then I think Doug is right, you just need some logic in the page
>> that shows the cart to determine whether there is an update required
>> or not, before you show the cart. Rather than having two page steps.
>>
>> {if: I need to do an update ]
>>
>> add an item
>>
>> [/if]
>>
>> run routines to display cart
>>
>>
>> -- Clive
>>
>> ------------------------------
>> Lasso Support: http://support.omnipilot.com/
>> Search the list archives: http://www.listsearch.com/lassotalk.lasso
>> Manage your list subscription:
>> http://www.listsearch.com/lassotalk.lasso?manage
>
>
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Program Structure

Marc Pope
In reply to this post by Marc Pinnell-3
Here's what I basically mean by a hidden page, very rude example:

Page 1: (item_detail.lasso)

<form action="update_cart.lasso" method="post">
    Enter Qty: <input type="text" name="qty" value="">
    <input type="hidden" name="sku" value="nike-001">
    <input type="submit" name="Add to Cart" value="Add to Cart">
</form>

Page 2: (update_cart.lasso)

[ inline: -add,
          -database='myDB', -table='cart',
         'qty'=(action_param:'qty');
  /inline;

    redirect_url: 'cart.lasso';
]

Page 3: (cart.lasso)

This page shows the cart. Page 2 is never really seen my the user, so in
essence, it's hidden. Nothing is displayed on it.

I am pretty sure that all browsers support this, including even old IE on
Mac which is now an unsupported browser.

-Marc


> What's a "hidden" page?
>
> If you want to stop people adding duplicate items it's much better to
> put the logic in the code that prevents such. On the site I pointed
> to previously I don't do that very much, but there are items there
> that you can only ever order one of per session - you get an error
> when trying to add more. There's also a global setting that can
> prevent any duplicate items, with a single variable in the site config.
>
>



------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Program Structure

Greg Willits-2
On Jun 8, 2006, at 11:42 AM, Marc Pope wrote:

> Here's what I basically mean by a hidden page, very rude example:
>
> Page 1: (item_detail.lasso)
>
> <form action="update_cart.lasso" method="post">
>     Enter Qty: <input type="text" name="qty" value="">
>     <input type="hidden" name="sku" value="nike-001">
>     <input type="submit" name="Add to Cart" value="Add to Cart">
> </form>
>
> Page 2: (update_cart.lasso)
>
> [ inline: -add,
>           -database='myDB', -table='cart',
>          'qty'=(action_param:'qty');
>   /inline;
>
>     redirect_url: 'cart.lasso';
> ]
>
> Page 3: (cart.lasso)
>
> This page shows the cart. Page 2 is never really seen my the user,  
> so in
> essence, it's hidden. Nothing is displayed on it.
>
> I am pretty sure that all browsers support this, including even old  
> IE on
> Mac which is now an unsupported browser.


By "support" do you mean that once a user is on Page 3, that the back  
button will go to Page 1 in all browsers (and not just back to Page 2  
which then adds to the cart again and jumps again to Page 3 -- I'm  
98% sure I've seen this behavior).

What happens if all the non-caching mechanisms are employed? This is  
where I have had a lot of trouble. If all the no-cache stuff is  
turned on, then that changes the back button behavior in at least  
some browsers.

-- gw



------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Program Structure

Marc Pinnell-3
In reply to this post by Marc Pope
Exactly what I am doing, I just should have been using the  
redirect_Url instead of JS.

Marc

On Jun 8, 2006, at 11:42 AM, Marc Pope wrote:

> Here's what I basically mean by a hidden page, very rude example:
>
> Page 1: (item_detail.lasso)
>
> <form action="update_cart.lasso" method="post">
>     Enter Qty: <input type="text" name="qty" value="">
>     <input type="hidden" name="sku" value="nike-001">
>     <input type="submit" name="Add to Cart" value="Add to Cart">
> </form>
>
> Page 2: (update_cart.lasso)
>
> [ inline: -add,
>           -database='myDB', -table='cart',
>          'qty'=(action_param:'qty');
>   /inline;
>
>     redirect_url: 'cart.lasso';
> ]
>
> Page 3: (cart.lasso)
>
> This page shows the cart. Page 2 is never really seen my the user,  
> so in
> essence, it's hidden. Nothing is displayed on it.
>
> I am pretty sure that all browsers support this, including even old  
> IE on
> Mac which is now an unsupported browser.
>
> -Marc
>
>
>> What's a "hidden" page?
>>
>> If you want to stop people adding duplicate items it's much better to
>> put the logic in the code that prevents such. On the site I pointed
>> to previously I don't do that very much, but there are items there
>> that you can only ever order one of per session - you get an error
>> when trying to add more. There's also a global setting that can
>> prevent any duplicate items, with a single variable in the site  
>> config.
>>
>>
>
>
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Program Structure

Alex Pilson
In reply to this post by Greg Willits-2
At 11:47 AM -0700 6/8/06, Greg Willits wrote:

>
>
>By "support" do you mean that once a user is on Page 3, that the
>back button will go to Page 1 in all browsers (and not just back to
>Page 2 which then adds to the cart again and jumps again to Page 3
>-- I'm 98% sure I've seen this behavior).
>
>What happens if all the non-caching mechanisms are employed? This is
>where I have had a lot of trouble. If all the no-cache stuff is
>turned on, then that changes the back button behavior in at least
>some browsers.

http://www.buywake.com/catalog/detail/HY_fxiyv

Add to cart then hit back button. This uses an interim page to add to
cart then redirect to cart contents.
--
<------------------------------------------------------------------------------>
     Alex Pilson          FlagShip Hosting, LLC
     800.592.6781     <http://www.flagshiphosting.com>
<------------------------------------------------------------------------------>

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Program Structure

Clive Bruton
In reply to this post by Marc Pope

On 8 Jun 2006, at 19:42, Marc Pope wrote:

> This page shows the cart. Page 2 is never really seen my the user,  
> so in
> essence, it's hidden. Nothing is displayed on it.
>
> I am pretty sure that all browsers support this, including even old  
> IE on
> Mac which is now an unsupported browser.

Well, I think that some browser, at least, will try to go back to  
your redirection page, which is exactly what you don't want to  
happen. Personally, when I find this happening to me on web sites  
where I've been redirected, I find that I end up hitting "back"  
several times before I realise what's going on (which is really what  
you don't want) - Marc Pinnell just observed this happening.

I kind of hate to tell you how to run your own sites, and make your  
code more complex, but there are logical ways to do this - what  
you're doing seems more of a hack rather than well considered  
programming.

If I were concerned about people adding duplicates, then perhaps I'd  
have some code that ensured that they couldn't add the same item  
within a certain time span, for example.


-- Clive

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Program Structure

Clive Bruton
In reply to this post by Alex Pilson

On 8 Jun 2006, at 19:51, Alex Pilson wrote:

> Add to cart then hit back button. This uses an interim page to add  
> to cart then redirect to cart contents.

Why do you think it's better to do this, than just have the logic in  
one page?


-- Clive

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Program Structure

Ke Carlton
In reply to this post by Marc Pope

What about simply allowing only one of each product in the cart - obviously
allow for people to change the quantity, this would allow for reloads and
avoid messy redirects.

Ke

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage