Jump to content

Catalog with wishlist-like functionality


darrenc
 Share

Recommended Posts

Still pretty new to all of this, I am looking to build a website with a catalog component showing products in various categories with various options. I assume most of these, if not all, will be set up as pages (allowing maximum flexibility?). The structure isn't concrete yet but that is the loose plan for now.

The client has since requested a scope change that any user looking at the site could...

  1. add a browsed item to some kind of wish-list functionality "build a quote" that they could...
  2. review what they selected on one page (potentially removing or changing quantities i assume) and then... 
  3. submit this wishlist/quote request, along with some basic contact information, back to the client so that they could follow up further.

It isn't an industry where one would ever provide a cart, with prices, and allow someone to buy an item -- so a formal cart seems somewhat overkill.

Because of my unfamiliarity I was wondering if someone could help provide some insight as to how something like this could be accomplished with processwire off the shelf, or with a basic module, or perhaps it would need a completely custom module to be built. At the very least it would help me respond to the client with options. Ideally I would like to build with processwire.

Thanks for any thoughts.

Link to comment
Share on other sites

Hi darrenc,

Your project sounds perfect for Pw (and vice versa :)).

For the site-structure: I suggest to look at kongondo's excellent tutorial here: http://processwire.com/talk/topic/3579-tutorial-approaches-to-categorising-site-content/

Bookmarking: I would just store the ids of the products a visitor has bookmarked in the session. On the review-page, display them together with a form and send the data to the client afterwards. 

Some pseudo code:

// in template product
// ....
// Check if this product was bookmarked, e.g. on top of the product template
if ($bookmark = $input->get->bookmark) {
  $bookmarks = ($session->bookmarks) ? $session->bookmarks : array();
  $bookmarks[] = (int) $bookmark;
  $session->bookmarks = $bookmarks; 
}

// this is the link to bookmark the actual product
<a href='<?= $page->url; ?>?bookmark=<?= $page->id; ?>'>Bookmark me!</a>

// in template review
if (count($session->bookmarks)) {
  foreach ($session->bookmarks as $b) {
    echo 'You bookmarked ' . $b->title;
  }
} else {
  echo 'no bookmarks';
}
  • Like 3
Link to comment
Share on other sites

Wanze, soooooo helpful thank you. I have lots of work to do to explore the API and "get" the pseudo code to the fullest, but this conceptualization was great. I think that was a stiff push in the right direction.

Thank you again for taking the time to reply.

  • Like 1
Link to comment
Share on other sites

It sounds to me like what you need is a basic shopping cart.
You have products, which you can add to a cart (wish list in this case), can then review the list and then checkout (no payment info, just contact details).

I think you could build this around the Shop for ProcessWire module.
It provides you with a basic shopping cart and the visitor can then sumbit their contact details.
After installing the module you'll need to make some modifications like hiding prices in the front end and changing text on buttons and throughout the checkout process. ("Add to cart" to "Add to wishlist" etc).

However if you also want product variations (pink shirt XXL), I don't think it's possible out of the box, so maybe others can pitch in?

Link to comment
Share on other sites

Before actually starting to code, I would decide if some sort of login is necessary at all.

If anyone can create wishlists, you'd probably want to use cookies. If there's a user-login, you can store the items in the DB, i.e. in a custom user input field. (comma-delimited id page list reference, or JSON).

Link to comment
Share on other sites

Jacknails, we approached the issue more from a end-user UI perspective and decided they should jump through as few hoops as possible. The most accurate description might be that it's a contact form with an attached wishlist. Secondly, while I am definitely open to looking at, and trying to strip-down, a cart module I think it would be better for us (totally new to PW) to learn a bit more by building this feature up exactly how we want it to behave. 

Dragan, yes requiring user signup was also a consideration and, for now, it is not a requirement. And yes we could set a cookie, and that was something that occurred to me once I read the pseudocode.

Thank you both for following up.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...