kongondo Posted May 3, 2019 Author Share Posted May 3, 2019 (edited) News Update - 3 May 2019 - Part Two Class Padloper - Public API We have re-written the Padloper Class (Padloper.module) to server as proxy class for use as a public API for everything you need to do with Padloper (except rendering; we don't do that :-), see previous post). Think of ProcessWire $pages variable. This is something similar in that it allows you to interact with (retrieval and manipulation) with Padloper at a higher level. Rather than multiple methods from multiple classes such as $modules->get("PadCart")->someMethod() or $modules->get("PadCheckout)->anotherMethod(), you will only need to interact with one class, Padloper. This will hopefully streamline your development process. Most (maybe all) of the current modules will be "converted" to Padloper core classes (.php) and/or absorbed in other classes. This means less modules will be installed. With one class (proxy class but also with native methods) you won't need to know (but good if you did :-)), the names of the fields that Padloper will ship with. Your code could be as simple as this: // get the class $padloper = $modules->get("Padloper"); // find a limited number of products $products = $padloper->findProducts(); // find products matching a criteria $selector = "brand=toshiba,price>200"; $products = $padloper->findProducts($selector); $selector = "tags|categories~=Vane,type*=Jac,description~=Some text,images.count>3"; $products = $padloper->findProducts($selector); $selector = "inventory<=10,variant_option=size|colour,variant_option_value=red|black"; $products = $padloper->findProducts($selector); // find related products $related = $padloper->findRelatedProducts($product); // get current cart $cart = $padloper->getCart(); // add item to current cart $padloper->addCart($item); // import products $padloper->importProducts($imports);// array/json/csv // get an order $order = $padloper->getOrder($id); // export orders $padloper->exportOrders($selectedOrders); // etc for customers, discounts, downloads, categories, tags, brands, variants, reports, inventory, types, etc Note the short 'field names' in the selectors. For instance, there are no fields known as brand or tags or categories in Padloper (they have other names and/or are subfields) but Padloper will convert them into something ProcessWire will be happy with. Currently, we don't support Or:groups, sub-selector selectors and similar using the 'short-field-names-selectors' . For such, you would need to pass the the full names and subfields of the Padloper fields you want to query to findProducts(), etc. The Padloper Class is also useful for debugging your shop, producing reports using the API, etc.. We'll talk about this and more in future posts. Edited May 4, 2019 by kongondo 9 Link to comment Share on other sites More sharing options...
szabesz Posted May 4, 2019 Share Posted May 4, 2019 (edited) Thanks for the report on the progress you are making! I have a few observations and questions. I know that at this stage of development it is not top priority and hopefully things can be fine tuned later on, but I would like to mention that excessive usage of whitespace – i.e. uselessly big padding – is against good UX. The more one has to scroll up and down, the more tedious it becomes to work in the admin, especially on laptop screens. I made a quick mockup to show what I mean. I moved the action GUI bits in line with other action like features. I also marked areas where whitespace could be made smaller: Spoiler My questions: Are you planning to utilize tabs (for example) on the Product page? Variants section is a good candidate to be separated under a tab, for example. Are we going to be able to add "custom" PW fields to products? I already have sites with product catalogues waiting for Padloper 2 to be added in order to implement shop features. However, all custom data should be kept somehow. For example, I use repeaters for simple variations and each repeater – among a few other fields – has an SKU and also an EAN-13 barcode field. Also, a product itself has various other fields, such as Option Select fields and page reference fields with ASM select. In the video, Inventory management seems to apply to the product and not its individual variations. Is that correct? What fieldtype will Padloper 2 use for prices? When supporting currencies, it is quite common that a product can have a price in the 10000.00 - 100000000.00 price range, which is not something PW's FieldtypeFloat can handle (maximum is 9999.99 with FieldtypeFloat). This is why this request is so popular https://github.com/processwire/processwire-requests/issues/126 but unfortunately the is no sign of Ryan adding it to the core ? Thanks in advance and keep up the good work! Edited May 4, 2019 by szabesz typo 2 Link to comment Share on other sites More sharing options...
kongondo Posted May 4, 2019 Author Share Posted May 4, 2019 (edited) 54 minutes ago, szabesz said: I know that at this stage of development it is not top priority Actually, this is incorrect. It is top priority for me now not least because I struggle with CSS (as I've stated previously) ?. The less CSS headache I have to deal with later the better for me. 54 minutes ago, szabesz said: I also marked areas where whitespace could be made smaller: I see what you mean. Should hopefully be a simple fix...just remove the uk-margin. 54 minutes ago, szabesz said: I moved the action GUI bits in line with other action like features. Looks great! Thanks for the idea. 54 minutes ago, szabesz said: Are you planning to utilize tabs (for example) on the Product page? Variants section is a good candidate to be separated under a tab, for example. I was contemplating this question since I thought about it myself. I'm not sure though. I'll have to think a bit more about this. 54 minutes ago, szabesz said: Are we going to be able to add "custom" PW fields to products? Yes. I was going to mention this in my post but I forgot. You will then be able to access them at $product->your_repeater; $product->another_custom_field; etc. The code is already there. The only thing I haven't decided is how to add the custom fields and how to edit them. In Media Manager all you need to do is to add your field to the template and editing is done in a modal. Editing the page itself (where it lives in PW). For Padloper, it is not that straightforward. I am trying to avoid modals as best as I can. Even if you added your custom field to the products template and was to edit it in a modal or different page, some users will probably be confused since they will not be able to see variants. on that page! I purposefully left out Inputfields for the custom Fieldtypes I created for Padloper. We don't need them since nothing is edited on the page. Given, the current UI can be transferred to the Inputfields but I am not keen on that. I'll need to have a proper think about his, especially RE repeaters. Any and all ideas are welcome :-). 54 minutes ago, szabesz said: In the video, Inventory management seems to apply to the product and not its individual variations. Is that correct? No, that's not correct. The video doesn't show inventory management at all. The inventory dash will list all variants where available alongside products that do not have variants. I haven't decided how to best display the table. The current ideas are: a simple table showing all variants and 'single' products a table/list that groups variants of one product together (something like mini-panels) A table listing products with variants hidden in accordions Whichever UI we go with, filters will still be available. Thoughts? 54 minutes ago, szabesz said: What fieldtype will Padloper 2 use for prices? When supporting currencies, it is quite common that a product can have a price in the 10000.00 - 100000000.00 price range, which is not something PW's FieldtypeFloat can handle (maximum is 9999.99 with FieldtypeFloat) The only core Fieldtype Padloper 2 uses are Pagefields (2), Textarea(2, 1 of which is rich text), Title and Images. Everything else is either a custom Fieldtype or a custom table. Is below good enough for prices ?? For prices we use the type decimal(12,2). Edited May 4, 2019 by kongondo 1 Link to comment Share on other sites More sharing options...
Jozsef Posted May 4, 2019 Share Posted May 4, 2019 10 minutes ago, kongondo said: The only core Fieldtype Padloper 2 uses are Pagefields (2), Textarea(2, 1 of which is rich text), Title and Images. Does that mean that products are not going to be ProcessWire pages the same way as they were in Padloper 1? It was such a great integration and made it super easy to edit product templates. Or will they still be available in the Templates section in admin? Great progress, can't wait to test it out. 1 Link to comment Share on other sites More sharing options...
szabesz Posted May 4, 2019 Share Posted May 4, 2019 Thanks for the quick reply with clarifications. Tabs could help either with "custom" fields or with "inventory dash table" too, as you could separate them from the main products edit page. Especially for custom fields, tabs based separation would be great and that way you might be able to separate the two worlds of Padloper 2's GUI from PW's inputfield type based GUI. 1 Link to comment Share on other sites More sharing options...
kongondo Posted May 4, 2019 Author Share Posted May 4, 2019 9 minutes ago, szabesz said: Thanks for the quick reply with clarifications. Tabs could help either with "custom" fields or with "inventory dash table" too, as you could separate them from the main products edit page. Especially for custom fields, tabs based separation would be great and that way you might be able to separate the two worlds of Padloper 2's GUI from PW's inputfield type based GUI. OK. Let's arrange to have a chat, please, thanks. 1 Link to comment Share on other sites More sharing options...
kongondo Posted May 4, 2019 Author Share Posted May 4, 2019 (edited) 3 hours ago, Jozsef said: Does that mean that products are not going to be ProcessWire pages the same way as they were in Padloper 1? No; Products are still pages ? (just NOT your own pages). ProcessWire is so versatile you can throw many things at it and it handles just fine. A custom Fieldtype is just one that doesn't ship with ProcessWire core. It is still a Fieldtype like any other. An Inputfield is just for displaying and capturing edited data. A Fieldtype does not need to have an Inputfield. As for custom db tables, even Padloper 1 uses them :-). Edited May 4, 2019 by kongondo clarification 1 Link to comment Share on other sites More sharing options...
alexm Posted May 4, 2019 Share Posted May 4, 2019 This is AMAZINGGGGG! Great work. Excited to check this out is an understatement. 3 Link to comment Share on other sites More sharing options...
Marco Ro Posted May 6, 2019 Share Posted May 6, 2019 Wow super! The API system look amazing! I know you still have to tell us many things, like how works the discounts, users management, shipments, payments, etc. But I will like ask a few things ? The API system for get the $order data will change? eg: At the moment I am using the success page or the checkout page to send the order data to external platforms such as our management, Mailchimp, google analytic etc. Will it be possible to continue doing it from there? I see there is the discount page, but also will be possible to change the price in the shopping cart based on the items loaded? eg: discounts based on quantity. Will it be possible to do this as a backend or do it with a separate hook? Will it be possible to choose the type of shipment in the checkout process? eg: normal, super fast... A curiosity, are you also creating new payment module? I think that ProcessWire has the potential to become the cms with the best e-commerce system around! 2 Link to comment Share on other sites More sharing options...
chuckymendoza Posted May 10, 2019 Share Posted May 10, 2019 This looks fabulous! Saw in your screen the example for selling digital fonts. This looks great. A question: will it be possible to give a variant (let’s say: Font Italic) an option to sell it with different license types? Mostly you have something like: Licence 1 = 1-5 User, Price X License 2 = 6-20 User, Price Y And when do you think is Padloper 2 ready to take off? ? 3 Link to comment Share on other sites More sharing options...
MateThemes Posted May 11, 2019 Share Posted May 11, 2019 I am really looking forward for this ecommerce module. Are there any plans about pricing for the module for now? Thank you! 2 Link to comment Share on other sites More sharing options...
kongondo Posted May 26, 2019 Author Share Posted May 26, 2019 On 5/6/2019 at 8:26 AM, MarcoPLY said: The API system for get the $order data will change? eg: At the moment I am using the success page or the checkout page to send the order data to external platforms such as our management, Mailchimp, google analytic etc. Will it be possible to continue doing it from there? The API will change a bit. Everything goes through Padloper (the new module/class I talked about in the post above). An Order Object will contain everything about the order stored in several properties. For the curious, there are two main fields for an order (outside order ID, etc). One field is of type Order and contains the overall data about an order, e.g. total price, total quantity, total shipping, customer name, customer address, order status, etc. The second is for individual items (also called list items) in an order. This will hold data about each item (product) in an order, e.g., the price, quantity, fulfilment status, variant id, tax, etc. To send order data to your endpoints will be as simple as this: // get an order $order = $padloper->getOrder($id); /* overall order data */ // total price/cost $order->totalPrice; // total discounts applied $order->totalDiscount; // totalShipping $order->totalShipping; // order items $items = $order->items; foreach($items as $item) { $item->title; $item->price; $item->totalPrice; $item->fulfilmentStatus; } // explode $data = $order->items->explode(array('title','price','tax')); $json = json_encode($data); As you can see, you can cherry-pick what you want to send to other services. Also note that each item within an order has its own fulfilment status. This is helpful in tracking each items status. On 5/6/2019 at 8:26 AM, MarcoPLY said: I see there is the discount page, but also will be possible to change the price in the shopping cart based on the items loaded? eg: discounts based on quantity. Will it be possible to do this as a backend or do it with a separate hook? I will give an update after I finish with this post, specifically about discounts. You will still be able to hook into prices if you wish but we have 4 types of discounts in-built that cover most scenarios. On 5/6/2019 at 8:26 AM, MarcoPLY said: Will it be possible to choose the type of shipment in the checkout process? eg: normal, super fast... Yes :-). Our shipping classes and modules are all ready. I only need to implement the backend GUI. Briefly though, shipping is made up of these: Shipping Zone: Geographical, from post/zip code all the way up to continent. Shipping Rates: Light goods, heavy, 10 items, $30 order, flat, etc. Shipping Methods: Normal, Super Fast, Slow, Next Day, etc. Shipping Option: A combination of Shipping Rate and Shipping Method: e.g. Your order falls under the shipping rate 'Heavy Goods'. If you want them fast, you pay $40. If are in no hurry, you pay $10.,etc Using the GUI, you will create your shipping zones. Each zone can have its own rates, methods and options. I have spoken about shipping zone before. Please see this post. On 5/6/2019 at 8:26 AM, MarcoPLY said: A curiosity, are you also creating new payment module? Yes, but not now. Probably after the release of Padloper 2. We have two existing Payment Modules that we can work with, although they too will be polished a bit (given the various suggestions we've seen in the forums). On 5/10/2019 at 11:55 AM, chuckymendoza said: A question: will it be possible to give a variant (let’s say: Font Italic) an option to sell it with different license types? Definitely :-). In your example, Licence 1 and 2 are just variant options themselves. See the demo below. On 5/10/2019 at 11:55 AM, chuckymendoza said: And when do you think is Padloper 2 ready to take off? ? I am planning to hire a number of octopuses so we can type faster ?. Seriously though, I am working as hard as I can. Maybe after the summer. On 5/11/2019 at 7:27 AM, MateThemes said: Are there any plans about pricing for the module for now? Please see the first post in this thread, under Pricing Model. Thanks all! 2 Link to comment Share on other sites More sharing options...
kongondo Posted May 26, 2019 Author Share Posted May 26, 2019 (edited) News Update - 26 May 2019 Discounts GUI Most work since the last update has gone to the discounts GUI. I also took the opportunity to trial the Tabbed interface suggested by @szabesz. I think I like the results. There are some crazy JS/CSS issues affecting the layout though. They seem to be coming from the ProcessWire navigation. Sometimes the padding is affected. This realigns correctly when you hover your mouse over the ProcessWire navigation. The dev inspector shows some dynamic activity going on, meaning JS. I'll post this in a separate post in the forums. Please note that this is still WIP. There are 4 types of discounts, each of which can be further refined by other factors including usage limits per order, globally, per customer, minimum requirements (purchase or amount), customer eligibility, etc. Discounts can be applied to specific products or categories or to the entire order. Percentage discounts Fixed amount/value Free Shipping Buy X Get Y Currently, discounts have to be created manually by the shop staff and customers have to enter a discount code at checkout. In future, we'll consider adding automatic discounts which will kick in if certain conditions are met. Here's a short video demoing the creation of discounts. Thanks. Edited May 26, 2019 by kongondo 3 Link to comment Share on other sites More sharing options...
alexm Posted May 26, 2019 Share Posted May 26, 2019 @kongondo amazing amazing amazing as ever!! 2 Link to comment Share on other sites More sharing options...
szabesz Posted May 26, 2019 Share Posted May 26, 2019 2 hours ago, kongondo said: Percentage discounts Fixed amount/value Free Shipping Buy X Get Y First of all I really like that you are thinking big and in the long run you want to include features which are mostly paid options in other systems. I also like a lot what we can see so far, this is great work indeed! A couple of notes / questions about these work in progress discount features: Discount Type: - Free Shipping should not be in the group of mutually exclusive types, as it is common to combine it with the other three (% / fix / B.X.G.Y.) currently in the works. - Maximum of items please ? Regarding the screencap's Buy X Get Y sneak peak: How useful is a Buy 2 get 1 promotion? ? What I mean is that "Gets Quantity" implies that I need to enter 3 and not 1, doesn't it? To put it another way: we have the term "Buy X Get Y", in which term X comes first, next is Y. But you swapped them and also called them in an ambiguous way, because "Get Y" becomes "Buys Quantity" and "Buy X" becomes "Gets Quantity". This is confusing. Or am I missing something? 1 Link to comment Share on other sites More sharing options...
kongondo Posted May 26, 2019 Author Share Posted May 26, 2019 38 minutes ago, szabesz said: - Free Shipping should not be in the group of mutually exclusive types, as it is common to combine it with the other three (% / fix / B.X.G.Y.) currently in the works. Actually, some systems (e.g. Shopify) have it as an exclusive. 40 minutes ago, szabesz said: Maximum of items please ? I'm not sure I follow. Please expound. 42 minutes ago, szabesz said: This is confusing. Or am I missing something? I am confused myself ?. Is it the 'Gets Quantity' that is confusing or the demo? Thanks! 1 Link to comment Share on other sites More sharing options...
szabesz Posted May 26, 2019 Share Posted May 26, 2019 1 minute ago, kongondo said: I'm not sure I follow. Please expound. 44 minutes ago, szabesz said: I did not see the option to specify the maximum number of discounted items the customer is able to buy. 3 minutes ago, kongondo said: Is it the 'Gets Quantity' that is confusing or the demo? Without seeing the screencap and reading "Customers must add quantity of items specified to their cart", I would assume that – for example – for a Buy 1 Get 2 promo I need to put number 1 into "Buys Quantity" and number 2 into "Gets Quantity" but you did the opposite. 1 Link to comment Share on other sites More sharing options...
kongondo Posted May 26, 2019 Author Share Posted May 26, 2019 22 minutes ago, szabesz said: I would assume that – for example – for a Buy 1 Get 2 promo I need to put number 1 into "Buys Quantity" and number 2 into "Gets Quantity" but you did the opposite. Aah..I see. Hmm, let's have a think... 1 Link to comment Share on other sites More sharing options...
kongondo Posted May 28, 2019 Author Share Posted May 28, 2019 Quick follow-up to last announcement regarding Discounts. Here's a screenshot ( @szabesz look away now ? - giant padding! will work on it later) of the Discount bulk view/edit screen (WIP). Discounts bulk view/edit 1 Link to comment Share on other sites More sharing options...
creativejay Posted May 28, 2019 Share Posted May 28, 2019 @kongondo So excited to see you actively working on this (I had only been watching the private access forum, whoops!). I'm developing a shop with the current full release of PadLoper and will need to launch it without waiting for your new release. We run an annual event and backup/purge the previous years' data so I know I'll at least be able to work with PadLoper 2 eventually! When it does come out, will I be able to run the PadLoper 2 module alongside the current module or will that cause conflicts? 1 Link to comment Share on other sites More sharing options...
kongondo Posted May 28, 2019 Author Share Posted May 28, 2019 28 minutes ago, creativejay said: will I be able to run the PadLoper 2 module alongside the current module or will that cause conflicts? There will definitely be conflicts, I am afraid. For instance, the module Padloper.module in Padloper 1 vs Padloper 2 are two different things + ProcessWire/PHP won't allow two classes with identical names . Do you have a specific need to run both the old and new versions? 1 Link to comment Share on other sites More sharing options...
Mustafa-Online Posted May 29, 2019 Share Posted May 29, 2019 @kongondo .. I'm Totally Amazed (You Are Super Awesome). Just wondering about "Back-end Notifications" in the UI, I don't see it in the demo you made! where are they? ? 1 Link to comment Share on other sites More sharing options...
kongondo Posted May 29, 2019 Author Share Posted May 29, 2019 35 minutes ago, Mustafa-Online said: Just wondering about "Back-end Notifications" in the UI, If by this you mean stuff like "10 orders placed today..." or staff to staff messaging, etc, that's already planned and partly modelled. Notifications will mainly be shown on the main landing page and on orders. I haven't started on the GUI yet, that's why there is nothing to see currently :-). Most likely this is what we'll tackle last, before beta release. 1 Link to comment Share on other sites More sharing options...
Mikie Posted May 29, 2019 Share Posted May 29, 2019 Hey @kongondo, speaking of classnames, has there been any thought of rebranding to something more accessible for people outside the PW community, like eg Procommerce or Commercewire ?? Just feel like the name was always pretty random and doesn't really seem to have any particular meaning – worlds smallest turtle? – or evoke feelings of a power and capability. 2 Link to comment Share on other sites More sharing options...
Jozsef Posted May 29, 2019 Share Posted May 29, 2019 1 minute ago, Mikie said: Hey @kongondo, speaking of classnames, has there been any thought of rebranding to something more accessible for people outside the PW community, like eg Procommerce or Commercewire ?? Just feel like the name was always pretty random and doesn't really seem to have any particular meaning – worlds smallest turtle? – or evoke feelings of a power and capability. Yes, I completely agree with that and wanted to bring it up. Especially in the backend when previously we got "Padloper Orders" and "Padloper Reports" etc… It feels much more integrated when you look at something like "Craft Commerce" or "Perch Shop" 1 Link to comment Share on other sites More sharing options...
Recommended Posts