Search

I’m thinking about using Symphony for a new project that is basically a small online bookstore.

For what I see the only thing that is missing is a “Shopping Cart”… I wonder if anyone has done (or is doing) one in Symphony…

Although I’m fine with XSL, my PHP knowledge is very limited, so I think it might be hard for me to build it my self…

Cheers!

We have been implementing a shopping cart for a small wool store using a customized version of Cookie Monster.

Thanks Nils, I’ll take a look at it… :)

Just as an additional information: We saved entry ids in the cookie and used these ids to filter Symphony data sources which returned the shopping card items.

Cookie Monster was just used as a starting point as we needed to be able to add or remove a certain number of items. Furthermore instead of GET we used POST for shopping card interactions.

Once more, thank you Nils… Thats precious information. I’m going to try to follow your “steps”… I hope I can pull it out… ;)

Well, it should all be quite simple - the code we created needs some polishment but maybe we can release it as an extension sometime in the future. We had some trouble with the execution order of data sources and events: from time to time our shopping card miscalculates the item count as the data sources get executed before the events have added or removed an item. Not sure about this problem in detail as I couldn’t recreate the behaviour consistently.

We had some trouble with the execution order of data sources and events: from time to time our shopping card miscalculates the item count as the data sources get executed before the events have added or removed an item

I’ve had this before, but not with a Symphony site. It can be solved by redirecting back to the same page after the Event has done its work. This also avoids the problem of the user double-refreshing (sending the POST again) since the POST is flushed when the redirect is served. Hitting refresh again just refreshes the page, rather than resends the form.

That seems to be a good solution to fix the calculation problem but am I right that you won’t see any event results in the XML in this case?

Ah, good point. Unless your redirect appends known references to the querystring to trigger messages (in the XML or the XSLT):

/basket/?msg=updated

@nils do I get this right?: you modified the cookie monster to accept POST rather than GET? Is this already bypassing the problem of datasource-execution timing?

Just in case, would you mind sharing your frankencookie-monster? :)

@nickdunn how do I actually redirect back to the same page after the Event has done its work? <form method="POST" action=""> doesn’t seem to to the trick alone. What is it I’m missing?

Thanks for any clues!

Ok, I think I managed to get this done :)

I'm also interested in post frankencookiemonster version, can someone throw it my way? jeffleeder@gmail.com

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details