That makes a lot of sense to me. I have never build interfaces or abstract classes before, only read and used sometimes. I agree that this is pretty ideal place to use one. This will probably end like a horrible mess, but I will try
E-Commerce with ProcessWire?
#41
Posted 13 February 2012 - 04:06 PM
That makes a lot of sense to me. I have never build interfaces or abstract classes before, only read and used sometimes. I agree that this is pretty ideal place to use one. This will probably end like a horrible mess, but I will try
#42
Posted 13 February 2012 - 04:32 PM
#43
Posted 14 February 2012 - 06:43 PM
- ShoppingCart
- ShoppingOrdersManagement
- ShoppingCheckout (You can now choose from all the installed payment methods which one to use.)
- PaymentExample (which let's you choose: I have already paid / Send me an invoice)
I haven't given any thought about which methods should be hookable, what should be default shipping details, how default checkout process goes etc... Also code needs still a lot cleaning and security stuff etc. But if you guys see something wrong in big picture, now is pretty good time to say it
#44
Posted 14 February 2012 - 06:46 PM
#45
Posted 14 February 2012 - 06:49 PM
I haven't given any thought about which methods should be hookable, what should be default shipping details, how default checkout process goes etc... Also code needs still a lot cleaning and security stuff etc. But if you guys see something wrong in big picture, now is pretty good time to say it
Just realized that checkout steps array is just a mess. Will implement that flow much better now that I got this together.
#46
Posted 15 February 2012 - 04:33 AM
#47
Posted 15 February 2012 - 04:47 AM
#48
Posted 15 February 2012 - 01:18 PM
For what it's worth I really like the way you are going about it, by building a simple set of functionality and then expanding over time. So many eCommerce systems out there try to do everything and end up being buggy and bloated - therefore doing nothing well.
Are you planning a simple PayPal gateway to serve common needs or are you leaving this up to the individual to build these gateways?
I should get some time to test this module over the next week or two and can help with anything up to the point of programming (coding is something I'm not particularly good at).
#49
Posted 15 February 2012 - 02:32 PM
Yes, I am trying to keep it as simple and streamlined as possible. I think that PW makes it easy since I don't have to touch the front end / product catalog at all.
I think few features that I am thinking of that should be in "core" implementation, but I haven't touched at all yet:
- Currencies (I think first just that you can choose the currency, later maybe multiple currencies)
- Taxes
- Stock levels (should support variations)
Are you planning a simple PayPal gateway to serve common needs or are you leaving this up to the individual to build these gateways?
There should definitely be a PayPal gateway as a module. I am not sure if I will build that, since I cannot add any hours from my day job into that (we don't need paypal with our customers), but I really don't think that it can take many hours, so I could do that at some point. I will build Finnish bank gateways first and one local integrator (www.verkkomaksut.fi). We mostly pay directly from our bank account here in Finland and many doesn't even have a credit card.
#50
Posted 15 February 2012 - 02:33 PM
#51
Posted 15 February 2012 - 03:05 PM
I'm currently looking into your new version and at what I've done to your previous version. Also looking at what I've done with the current shop I'm still working on. It got delayed because of missing content, images etc.
There's a couple things I'm thinking about the different parts and how they could be extended or made flexible/configurable in some parts.
Module Cart
Looks good and somehow still the needed basic functionality. I'm asking if it would be possible to include variations ( simple child-pages approach ) into the cart model? This would only require to change the following functions:
- getTotalSumFromItems()
- renderCart() // though I've done the cart rendering in a template I created "sc-cart".
In my version I just done it like this:
// see if variant page has price field // if not choose from parent product page if($product->sc_prize) $total_price = $item->qty * $product->sc_price; else $total_price = $item->qty * $product->parent()->sc_price; ...
Maybe I could make a fork and try to implement those myself? What you think?
Also I see something for "shipping costs" is needed in the cart rendering, and of course in the order management. What have you planed on this?
Maybe it would in some cases be useful to have some discount based on the total cost, and no shipping costs after a minimum of total costs too.
Those are thing commonly need in shops as I see it.
Checkout Module
As with the previous version, I see you still only basic fields for the order form. I think it would require some more in most cases.
- Having a gender is questionable but definately something to consider. Event it not needed at the end it would be there.
- I would see having a "prename" "lastname" instead of full name
- Instead of address having a textarea, I think it would be better to have "address" for street, "zip", "city" and "country" separate
Regarding the order template and complete order, I think there will be some more fields needed.
- 1 field for the "payment_id" as some payment services generate a payid in addition to the order_id, that comes from the shop.
- Depending on the payment service, there's possibly some more fields that could be useful, like payment card type used, last 4 digits of card, if the order wasn't successfull theres error codes provided.
I have no idea as of now how this would be doable in the current model. I think some sort of basic set of fields that would serves for all payment types would make sense? Or would it be possible to make configurable to add custom fields to the order, so it would be dynamicly handled depending on a config and saved into a text field serialized? I have hard time seeing through this.
Also how do you plan doing the validation on the order form? I currently have the whole shipping-address-completeorder-to-payment process handled in 1 template with custom validation class.
In my current shop, once the process is complete I save order using shop API with status "not-complete". Also in same template it handles the return from the payment service, changing the state of the order to "complete". But because the payment method I use is on demand, with authorisation for the payment, I need to have a status "payed" once it's payed and "processed" once it's shipped and done.
---
Basicly I'm trying to get a clearer view of what module should provide what function. How could hook-able functions being useful here and for what?
Also I really would like to bring in my experience from the current shop I'm doing, which seems to have little different requirements than yours. And see if it could be done without touching the module codes. But I have a hard time doing so still
@somartist | modules created | support me, flattr my work flattr.com
#52
Posted 15 February 2012 - 03:42 PM
Shopping Cart
I think we need to wait for repeater to ship and see how it works with variations. I have a feeling that it will be the best way to implement variations. Shipping costs: are you thinking about per product shipping or per shipping method chosen? Or both? I think shipping stuff is something I need to focus soon.
Checkout
All those checkout stuff like having only fullname, email, address are just for quick developing, nothing final there
I think I'll add payment_id, and if other stuff is needed to save from payment service, all those will go to one textarea field. I don't think we need anything custom here. This is the hard part, since Orders Management need to know how to use orders: if we make orders "dynamic", it will mean a lot of new code to orders management also.
About what should be hookable etc
I think that this is little bit hard since this is still so early and lots of moving parts. After we are more ready with very basic requirements, I think it will be much easier to see what are the pain points that many people would like to customize. Some things we already know (like what information to ask from customers) etc.
#53
Posted 15 February 2012 - 04:08 PM
Thanks for the feedback Soma.
Shopping Cart
I think we need to wait for repeater to ship and see how it works with variations. I have a feeling that it will be the best way to implement variations. Shipping costs: are you thinking about per product shipping or per shipping method chosen? Or both? I think shipping stuff is something I need to focus soon.
Yes, that's certainly a good new way to do variations. Then it would be a little different dealing with the product id, as with child pages it's easy. So the id in the cart saved will match that variation.
Checkout
All those checkout stuff like having only fullname, email, address are just for quick developing, nothing final thereI am currently doing bunch of fields and having settings to set those as visible / hidden / required etc. After that I will build custom validation for those... I am also thinking about possibility to extend those with some custom fields.
I think I'll add payment_id, and if other stuff is needed to save from payment service, all those will go to one textarea field. I don't think we need anything custom here. This is the hard part, since Orders Management need to know how to use orders: if we make orders "dynamic", it will mean a lot of new code to orders management also.
That sounds great! Yes the dependency of the orders management module on certain fields will make it a little harder to make it flexible, but it may could be handled as "custom-fields". Then those are only informational and there could be some sort of standard output of those on order detail page.
Also what I have implemented is a little search field to search for a payment,order id. Just as an simple process function. I think it also would be cool to have a per year or month, day filter in the overview. Just as example.
About what should be hookable etc
I think that this is little bit hard since this is still so early and lots of moving parts. After we are more ready with very basic requirements, I think it will be much easier to see what are the pain points that many people would like to customize. Some things we already know (like what information to ask from customers) etc.
You're right. We should wait until things are more settled. It's also easier to see as you move along. I'm sure it will be great! I don't want to bother or interupt. I think once you got the most basic version finished, it will be a lot easier for me or others to help coding and extending if needed.
@somartist | modules created | support me, flattr my work flattr.com
#54
Posted 16 February 2012 - 03:55 PM
Oliver: I created another example payment method so if you want to take a look how I did the module implementation. Super simple really, but works nicely.
There are two parts. First:
$paymentModules = $this->modules->find('className^=Payment');
That snippet finds my installed Payment modules. I use that to render dropdown to choose a Payment method.Then the other part is like this:
$paymentmethod = $this->modules->get("{$order->sc_paymentmethod}");
return $paymentmethod->processPayment($order);
ProcessPayment(Page $order) is required from every payment method (I am using abstract class instead of interface, since I wanted them to have $this->completedUrl automatically.
#55
Posted 17 February 2012 - 08:33 AM
I got a little snippet you might find useful, and consider implement it.
public function ___executeSearch() {
$this->fuel->breadcrumbs->add(new Breadcrumb('../', 'Orders'));
$this->setFuel('processHeadline', $this->_("Order search result"));
$id = (int) $this->input->post->searchquery;
$result = new PageArray();
$result = $this->pages->find("template=sc-order, id=$id, include=all");
$result->import($this->pages->find("template=sc-order, sc_payid=$id, include=all"));
$out = '';
if(count($result) > 0) {
$out .= "<h2>" . sprintf( _n("found %d order", "found %d orders", count($result)), count($result) ) . "</h2>";
$out .= "<ul>";
foreach($result as $order) {
$date = date($this->config->mydateFormat,$order->created);
$out .= "<li><a href='../edit/?id={$order->id}'>#$order->id, #$order->sc_payid, $order->title, $date</a></li>";
}
$out .= "</ul>";
} else {
$out .= '<p>'.$this->_("No orders found").'</p>';
}
return $out;
}
// i didn't use PW field style, but simple form markup on top of order overview
$out .= "<form action='./search/' method='post'>";
$out .= "<label>Payment ID: </label><input type='text' name='searchquery'/> ";
$out .= "<input type='submit' name='submit' value='suchen'/>";
$out .= "</form>";
@somartist | modules created | support me, flattr my work flattr.com
#56
Posted 17 February 2012 - 08:59 AM
BTW: if you are interested (and have time), ShoppingReports would be nice independent module that is needed. Something to get overview on your sales weekly / monthly / yearly and maybe by product etc.
#57
Posted 17 February 2012 - 09:18 AM
Yes, that would be a great addition and fun to do module. I don't know when I will have time, but would like to participate. I would also first have to try and look at the current shop module and maybe start with something simple first and extend further step by step.
@somartist | modules created | support me, flattr my work flattr.com
#58
Posted 17 February 2012 - 07:11 PM
#59
Posted 18 February 2012 - 05:05 AM
#60
Posted 18 February 2012 - 08:08 AM
Also, haven't really focused on security yet, so that is something that I hope everyone takes a very critical look.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users













