Jump to content

Padloper 2 Documentation


kongondo
 Share

Recommended Posts

Padloper 2 documentation can be found here. This is WIP but has the very least to get your started. It is a bit rough around the edges. We'll improve it as we go along. 

At the very least, I suggest you read these sections:

  1. Getting Started
  2. API, especially the finder, cart & checkout and session order chapters.
  3. Frontend.

With respect to the API, the most important thing to know about is the $padloper global variable. It is your gateway to nearly everything (finding things, carts, checkouts, orders, etc.) in Padloper (2). 

Please do let me know if you find any errors. I am also working on the starter (demo) site repo. This and the docs should hopefully help move you along. If I get a minute, I might throw in a quick demo video. No promises though 😉.

Happy reading 🙂.

  • Like 6
  • Thanks 1
Link to comment
Share on other sites

5 hours ago, Stefanowitsch said:

I'm getting excited! When will Padloper 2 be released "officially"?

Depends on what you guys dig up when you put it through its paces in the next few weeks 😉.

  • Like 4
Link to comment
Share on other sites

On 1/3/2022 at 9:11 AM, kongondo said:

This and the docs should hopefully help move you along.

Just a quick question: I cannot see any sign of promotional coupons/discounts in the screenshots nor in the text of the docs. When do you think you might be able to start working on it in the future, the earliest?

Regarding the projects I need to work on, coupons/discounts and Stripe payment is the only major missing bits I could spot so far. It would be great to see them being implement during the beta period.

As far as coupons/discounts are concerned, first and foremost I am thinking of a developers' API (and/or hooks?) upon which we can implement virtually anything we might need to. Usually my clients do not even want to touch this area in the webshops I manage, so for me there is no need for an admin GUI at all. Sure, being able to manage coupons/discounts in the admin will be a must for many, but to start with, a versatile way to tap into the calculation of the Total price would be preferable as most of the time I am asked for promotional methods which often not pre-made in any system out there at all. And this also includes adding gift items to the cart, and sometimes such gifts are not even sold in the store, being promotional gifts only.

So I am mainly interested in an API which allows us to modify the Cart / Coupons / Subtotals / Shipping / Insurance / Total based on any custom requirement. Meaning adding any customs cost as well, when required.

I hope this makes sense :)

  • Like 3
Link to comment
Share on other sites

On 1/5/2022 at 11:54 AM, szabesz said:

Just a quick question: I cannot see any sign of promotional coupons/discounts in the screenshots nor in the text of the docs. When do you think you might be able to start working on it in the future, the earliest?

Depends on what you guys want me to prioritise. I haven't looked at it in detail but from the expression of interest form it seems that Stripe is pretty high up the list.

On 1/5/2022 at 11:54 AM, szabesz said:

As far as coupons/discounts are concerned, first and foremost I am thinking of a developers' API (and/or hooks?)

 

<?php

namespace ProcessWire;

$this->addHookAfter('PadloperCart::getProductPrice', null, 'customProductPrice');

function customProductPrice(HookEvent $event) {
    $product = $event->arguments('product');
    // get the product field with the price
    $stock = $product->padloper_product_stock;
    // grab the price
    $price = (float) $stock->price;
    if (wire('user')->name ==='my_best_friend') {
        $price = 0.01 * $price;
    }
    $event->return = $price;
}

 

On 1/5/2022 at 11:54 AM, szabesz said:

So I am mainly interested in an API which allows us to modify the Cart / Coupons / Subtotals / Shipping / Insurance / Total based on any custom requirement. Meaning adding any customs cost as well, when required.

Padloper is very versatile. You can use it as a POS using the backend only; as a full ecommerce solution with a front and backend or as a headless CMS or API only shop. :-).

  • Like 3
Link to comment
Share on other sites

Posted (edited)
15 hours ago, szabesz said:

I wonder why going to the product page leads to 404. Any ideas?

I realise the demo site README was not clear enough, apologies. Did you create the pages products and categories under /home? Have you enabled URL segments on the templates products and categories?

Edit: I notice even your /about/ page is not working. Do you have that page?

Edited by kongondo
  • Like 1
Link to comment
Share on other sites

@kongondo Thanks, yesterday I was assuming the wrong thing and just enabled URL segments on the home template. Seeing so many TBDs I have not reached the end of the read me, sorry for that.

Now I also see that you mention this topic over here too: https://docs.kongondo.com/frontend.html

As for the About page, I did not even notice that yesterday. I just created a product, wondered why the product page is 404 then went to bed.

BTW, this starter profile is really useful even though it needs more work, but quite enough to learn the basics.

  • 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

  • Recently Browsing   0 members

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