Jump to content

E-Commerce with ProcessWire?


Crash-n-Burn

Recommended Posts

Raydale: I was thinking about at least post to showcase, since that was interesting project. It is actually using multisite module together with this site (www.marttaperinne.fi). But I have been very short of time, so this will take little longer.

Link to comment
Share on other sites

  • 3 weeks later...

Antti, I've been sacrificing forum time for PW development time, and just wanted to apologize I've not been able to actively participate in this more. But I wanted to let you know how impressed and interested I am in this. I already have all kinds of plans for using this and getting more involved, and am thinking it will be perfect to use for the DI bookstore. This is the coolest and biggest PW project to come along, and I just wanted to explain my lack of posts in here. The reason is that I'm about to jump into a work schedule (this week) where I'm not going to be able to do anything major with PW for 6 weeks, other than fix bugs and make 2.2 official. Though I'll be developing [a site] in it, rather than developing for it, so I guess that still counts as ProcessWire time. :) But I've been redirecting my forum time to put out a couple new PW features ahead of schedule (primarily repeatable fields), to hopefully buy some patience for the weeks ahead where I have to focus mostly on another project. But once that is done, I am looking forward to building a store and participating in the project.

Thanks for all the hard work, and the release of PW 2.2. Are you still planning on participating in this project? I hope this will help this project gain momentum, as I think a project like this will help PW get noticed.

Link to comment
Share on other sites

Thanks for all the hard work, and the release of PW 2.2. Are you still planning on participating in this project? I hope this will help this project gain momentum, as I think a project like this will help PW get noticed.

I'm always here to support any projects being developed in PW. But when it comes to development time, I mostly have to focus on the things that help to make ProcessWire and my business marketable to my clients. Right now, there isn't a demand for this with my own clients, but maybe there will be in the future. I hope there is because I agree about the value of this and am thrilled with the work that's been done thus far. This project is already under great direction and doesn't necessarily need me. One of the reasons for lack of demand with my own clients has to do with recent draconian PCI compliance rules. These rules push clients (and developers) to want to delegate the PCI compliance to dedicated service providers like Shopify, Volusion, etc. There is still a place for the self-hosted and open source carts though, it just means that the checkout strategy has to be different and a little less open/flexible from what it has traditionally been.

Link to comment
Share on other sites

Maybe this is more of a general PW question, or even a general php question. How do I controll and modify the default output of modules?? I am trying to modify the default shoppingcart. I heart about hooks, but don't know if they are there, and if they are there, how to use them.

Another thought would be to extend the shoppingCart class in my own module, but without success sofar.

Could someone please help this novice in the right direction a bit??

Thanks.

Link to comment
Share on other sites

You can hook in before or after any method that starts with 3 underscores, like: ___methodName(). For more about this take a look at the Helloworld.module file included in the PW installation (/site/modules/Helloworld.module). Antti can probably advise better than me as to if or what methods in the shopping cart are intended to be hooked. But to answer your question I think we'd need to know more about specifically what you are trying to do in terms of output?

Link to comment
Share on other sites

I am planning to make all render methods (the ones that output markup) hookable and also configurable. Although other way to look at it is that these modules should give you all the "low level" methods that make it simple to build your own cart.

So current method here is to render the cart by yourself all together (in your template for example). So instead of this:

<?= $modules->get("ShoppingCart")->renderCart() ?>

You would do something like this:

$cart = $modules->get("ShoppingCart");
$items = $cart->getCurrentCart();
foreach ($items as $item) {
  // get product price from actual product page
  $product	 = $pages->get($item->product_id);
  $total_price = $item->qty * $product->sc_price;
  $out .= "<td>{$product->title}</td>";
  $out .= "<td><input data-price='" . $product->sc_price . "' name='items[{$product->id}]' type='number' size='2' value='" . (int) $item->qty . "'/></td>";

  $out .= "<td>" . $cart->renderPrice($total_price) . "</td>";
  $out .= "<td><a class='remove' href='./?sc_remove=" . $product->id . "'>remove</a></td>";
 }
echo $out;

Well, look into renderCart() method in ShoppingCart module, it should give you best picture what to do there. But $items has all your items (page id and title), just iterate over them.

  • Like 1
Link to comment
Share on other sites

If you need a quick affordable and PCI compliant solution to plug a cart into Processwire you might want to take a look at Foxycart.com. It is a javascript based cart (obviously requires javascript client side)that you can plug into anything trivially. It's well thought out. Lots of options. Nothing to maintain. What's nice is being free to turn any page anywhere in your site into a product. Used it with Modx sites without a hitch.

  • Like 1
Link to comment
Share on other sites

I am planning to make all render methods (the ones that output markup) hookable and also configurable. Although other way to look at it is that these modules should give you all the "low level" methods that make it simple to build your own cart.

So current method here is to render the cart by yourself all together (in your template for example). So instead of this:

<?= $modules->get("ShoppingCart")->renderCart() ?>

You would do something like this:

$cart = $modules->get("ShoppingCart");
$items = $cart->getCurrentCart();
foreach ($items as $item) {
  // get product price from actual product page
  $product	 = $pages->get($item->product_id);
  $total_price = $item->qty * $product->sc_price;
  $out .= "<td>{$product->title}</td>";
  $out .= "<td><input data-price='" . $product->sc_price . "' name='items[{$product->id}]' type='number' size='2' value='" . (int) $item->qty . "'/></td>";

  $out .= "<td>" . $cart->renderPrice($total_price) . "</td>";
  $out .= "<td><a class='remove' href='./?sc_remove=" . $product->id . "'>remove</a></td>";
 }
echo $out;

Well, look into renderCart() method in ShoppingCart module, it should give you best picture what to do there. But $items has all your items (page id and title), just iterate over them.

Sweeeeeet!! I will play with this. Thanks for pointing me out in the right direction!!

Link to comment
Share on other sites

  • 1 month later...

I have been cracking on with E-commerce for Processwire, and I love it so far!

Still lots to do. Thinking of building an IcePay Payment module (http://www.icepay.com/api-2-en). This will add the, for the Dutch widely-used iDEAL paymentmethod tp Processwire

Using "Repeater" for product-variations is working great at the moment. Only one front-end question.

At the moment it lists all the product-variations for a given product. I would like to ajax-load the different variations based on a select-option, just like Drupal commerce does (http://demo.commerce...fee-holders/mug)

Any suggestions for a solution? Learning a lot at the moment, backend-end and front-end coding!

Thanks for any help!

k7k5q.png

Link to comment
Share on other sites

Spoetnik, great to hear. I will be adding support for product variations in to the module somewhere between August and December, since I need to implement them for a client. Great to hear that the concept of using repeater for variations works, since that is what I am planning to use in shop core as well!

Hard to give much help with so little information. I myself don't like that "variations" are so much variations, that they require different images. I always tell my clients that good example for product variations is different sizes for t-shirt, but bad variation is different colors. Make each color a new product and then each size as a variable.

Link to comment
Share on other sites

I don't think colour is any different a variation to size. The product details may well otherwise be the same, such as description, title, price so you'd have unnecessary duplication unless you created a layer above product such as product-group.

I built a shop this summer using the above e-commerce modules, but significantly rewrote the checkout module to be a lot simpler. I used repeaters as variations and allowed a number of fields for each variation.

If you have a tshirt design, in three different colours and three different sizes, each of those colour and size combinations will need an inventory count. As such I added two drop downs for size and colour and a field for stock to the variation template.

The title and price of each variation were set using another module and a couple of property hooks. The title concatenated the titles of the product, size and colour. The price checked if the variation had a price set on it, and if not, grabbed the price from the product it was a variation of.

I found this the most sane way of dealing with the variations and it allowed the cart module to be none the wiser as it simply viewed each variation as a product and when it asked, was supplied with a title, price and stock count for that variation.

Stephen

Link to comment
Share on other sites

I don't think colour is any different a variation to size. The product details may well otherwise be the same, such as description, title, price so you'd have unnecessary duplication unless you created a layer above product such as product-group.

I think it depends a little. The shops what I have been building really were better when different colors were different products. When browsing for products it is much nicer to see different colors right away, on a category level. But of course if you have shop where "the thing" is the design print and you can choose whatever from 14 color for a shirt - then of course color should be a variation instead of own product.

I built a shop this summer using the above e-commerce modules, but significantly rewrote the checkout module to be a lot simpler.

Interested in hearing more about this. What stuff was unnecessary for you? Trying to find the sweet spot for the features baked in so that Shop module would be as easy and flexible as possible.

Also - excellent that shop module works out of the box with stock variations. I thought it should (since variation is just a page), but haven't got time to test this yet.

Is your shop online already Stephen?

Link to comment
Share on other sites

Can anyone help me please....How can i build an e-commerce website using processwire?

I need some guidelines...Thanks

I think you'd need to be more specific in your question and give this context:

  • What will you sell (products, services, e-books, etc)?
  • Will your store need to handle taxes and/or shipping?
  • What payment types do you want to support?
  • What countries are you selling in?
  • Are you subject to PCI compliance?
  • Have you ever managed an e-commerce site before?

There is a ProcessWire ecommerce module that @apeisa has built and is building, as discussed in this thread. While I am not an expert on that module, your answers to the above questions may help others to make suggestions as to whether that module would be good for your needs.

If you find you can't answer all of the questions above, or don't yet have any e-commerce experience, then my suggestion would be this: Regardless of what CMS you are using, use an e-commerce service rather than trying to run your own. It's one of the most complex online applications, especially with PCI compliance, shipping, and taxes. Personally, I use http://shopify.com and am happy with it. Another user here mentioned they are happy with http://lemondstand.com . Many of these services (Shopify at least) include web hooks that allow you to trigger actions on your ProcessWire site (like creating subscriber access, for instance). This opens up a lot of power without requiring a lot of work or expertise about ecommerce on your part.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

Would it be possible to use a formbuilder form as input for a shop-for-processwire product?

This way I could build the product options/customisations using a formbuilder form, and process the order using the shop-for-processwire module.

The "actions"-tab on formbuilder could have an option, "generate order" or something?

Link to comment
Share on other sites

Interesting idea. Since orders are just pages it might work... but orders need some children (products that are being bought) it might be a lot trickier than that. I think you cannot achieve that without some custom coding.

Link to comment
Share on other sites

Is there any documentation on how to implement custom "from-builder actions"??

I'm not sure I understand the question, but I should be able to answer to anything Form Builder related. Can you post more details (in the Forum Builder support forum)?

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...