Jump to content

kongondo

PW-Moderators
  • Posts

    7,355
  • Joined

  • Last visited

  • Days Won

    139

kongondo last won the day on May 16

kongondo had the most liked content!

Profile Information

  • Gender
    Not Telling
  • Location
    UK

Recent Profile Visitors

33,466 profile views

kongondo's Achievements

Hero Member

Hero Member (6/6)

8.2k

Reputation

78

Community Answers

  1. Floating Windows Long standing open request https://github.com/microsoft/vscode/issues/10121 Workarounds: Duplicate Workspace WARNING: CAREFUL WITH THIS ONE! CAN EASILY WIPE YOUR CHANGES IF YOU ARE EDITING ON BOTH WINDOWS! Autosave onFocusChange
  2. Hi @thibaultvdb, Thanks for your interest in Padloper 2. I have moved your question to its own topic. Yes, it should be possible to do this with Padloper 2, although the feature is not available out of the box. There are at least two approaches I can think off. Let me sleep on it. I'll give you a better response tomorrow. Thanks.
  3. Hi @ank, Apologies for the late response. Below are examples of 'add to cart' buttons without page reload. Ajax is used to submit the request and handle the response from the server. There are two examples: jQuery ajax Vanilla JavaScript ajax In both cases, the server (Padloper) returns a JSON response. This is unlike in htmx in which case the server will return markup as the response. Hence, in the examples below, we need to handle the response ourselves. I have given some examples but you can choose to handle the response however you wish. The most important thing is the submission aspect of the code, i.e. what form inputs you send to the server. I'll explain these below before I get to the examples. In future, I will add the examples below to the demos repository. I will also be adding the explanations below to the docs. Add to Cart Endpoint You need to send a POST request to the address /padloper/add/. Padloper listens to requests sent there using URL Hooks. INPUTS Required Product ID (integer) Your request must contain the ID of the product you want to add to the cart. Please note that this applies to both a product without variants or a variant. I.e., in case of a variant, you only need to send its ID. Its ID will be its product ID. The input name must be: product_id Optional Quantity (integer) This tells Padloper how many of the given product/product variant to add to the cart. If this is not specified, it defaults to 1 item. The input name must be: padloper_cart_add_product_quantity Redirect Page (string | integer) This is only applicable for non-ajax requests! This tells Padloper where to redirect the user to after they add an item to the cart. It is useful in cases such as 'add to cart and checkout'. The value can be a string representing the URL to redirect to or a page ID whose URL to redirect to. The input name must be: padloper_cart_redirect EXAMPLES Notes These examples assume you are using a delayed output template strategy. Otherwise, if using a direct output you just need to echo $content. Please also note that form markup can be added to any page. You don't need a special page to add an item to the cart. Padloper products pages live under the admin hence cannot be accessed directly from the frontend. One way to show a product in the frontend is to access it via a URL Segment, e.g. /products/my-nice-product/ OR /products/1234/ where 1234 is the ID of the product. You can then use $padloper->get("id=1234") OR $padloper->get("name=my-nice-product, template=product"). We are using Tailwind CSS in our examples. For the jQuery example, you will need to link to jQuery script somewhere in your <head> or <body>. In this examples, we don't show how to use the values in the JSON in the server response. They are self-explanatory though. If not, let me know. The JavaScript handlers code was not thoroughly tested. They are intended as a quick illustration. jQuery Example Template File (PHP) JavaScript Vanilla JavaScript Example Template File (PHP) JavaScript Server Response { "productId": 1895, "variationId": 0, "productTitle": "Printed Ghanain Skirt", "quantity": 1, "totalQty": 85, "numberOfTitles": 5, "totalAmount": "\u00a313,425.45" } Please note that the variationId is a legacy response value that is no longer needed in Padloper. It will be removed in the next release. Screenshots Please note that in my testing, I combined the code for jQuery and Vanilla JavaScript into one template file. Demo Product Page Dev Console: Ajax Request Dev Console: Ajax Response Hope this helps. Otherwise, give us a shout. Cheers
  4. Hi @Stefanowitsch, I totally agree with your sentiments. The state of Padloper documentation is not good at all. I don't want to make excuses. Written documentation was at the top of my list but other things came up. I then decided to instead create video documentation. I started on those but again was sidetracked. Great! Happy to help you with this. This doesn't mean I won't be working on the video documentation; I'll still work on that. Technically, this is incorrect. Although there are a lot of new features and a new API, some aspects of Padloper 1 remain, e.g. 'padloper templates' to customise markup, e.g. summary of order line items in the basket, etc. Actually, you can. For instance, stuff like 'add to cart', 'checkout form', etc. are near identical. I am entirely to blame for this. As stated, the docs are not nearly good enough. They are actually still in an interim location. The plan has been to move them to the padloper domain. True. Again, I am to blame for this state. I will be covering this in the video docs. It is quite easy to create categories and products. Meanwhile, I can grant you backend access to the demo site to visualise how things work. Zero fields are required 😀. Padloper ships with its own custom fields in many cases. It also utilises a few in-built ProcessWire fields such as title and rich text area (for product descriptions). Padloper creates all fields for you during installation. At installation, you choose the features you want. For instance, if you don't want the feature 'category', Padloper will not install its related template(s) and fields. If you installed the feature 'tags' and later changed your mind, Padloper will remove this cleanly for you. Most features are optional. The core features include order and product. This is how I have planned the video docs. I.e., several short videos covering installation, setting up the backend, creating your first product, displaying products in the frontend, checkout, extending Padloper, etc. I understand your frustration. I agree, the docs need to provide this information. The video docs will do this. Meanwhile, I need to update the demo repos to indicate their incompleteness. This is a great suggestion, thanks! Somebody else mentioned this recently. My plan now is to include an option during installation to install a demo shop. This would match the features that you have selected for install. I also plan (not sure about the timeline for this) an integrated JavaScript driven backend demo of how things work in the backend, basically a click-through thing. Apologies the docs are not clear. Now that you point this out I see how they can be misleading and how they are incomplete. The above instructions are only for the demos. You don't need those templates for Padloper to work. You don't need to create any fields. For frontend use, the only thing that is required is a checkout page. Using the Padloper API ($padloper), you can access and display any Padloper items in the frontend wherever you like. You don't need a products page or a categories page, etc. For instance, you could display all your products on the homepage, etc. You could add items to your cart in a modal, or in a dedicated page, or however you want. At the end of the day, things are just ProcessWire pages. Technically, you can access things using ProcessWire API but $padloper saves you a few steps. I hope I have addressed all your queries. The above responses are not a substitute for good, quality documentation. Video documentation and better demo repos are still a high priority for me. Thanks for honestly pointing out the current shortcomings and your frustrations. Whether or not you decide to use Padloper, I genuinely value your opinion 🙂. Thanks!
  5. Tailwind Connect 2023: Recap of our first in-person event https://tailwindcss.com/blog/2023-07-18-tailwind-connect-2023-recap
  6. Hi @ank, Padloper can handle both ajax (no page reload) and non-ajax (page reload) requests. Please see the example projects in this repo: https://github.com/kongondo/Padloper2Starter With respect to ajax, Vanilla JS and jQuery examples are not complete. However, the htmx (Demo 1, etc.) examples are complete. Please have a look and let me know how you get on. I am planning to add some simpler examples some time soon. Thanks.
  7. What the others have said. Just noting here that the Web APIs have a Screen Capture API. Here's a CodePen.
  8. Hi @csaggo.com, I was looking forward to a showcase 😄 . Excellent! Congrats! Thanks for reporting. Yes, I noticed these a few weeks ago and fixed the code. The fixes will be available in the next release. I have something similar in the code fix, i.e. $configs=[]. True. All already have the fix per your description. Thanks!
  9. Hey @David Karich. No, nothing new I am afraid. A few unrelated stuff came up that I have had to focus on. This should be over in the next 2-3 weeks after which I'll resume the work on MM.
  10. Hi @Roadwolf, Just saying hello and welcome to ProcessWire and the forums 🙂.
  11. I see. I'll have a think about how devs can pass configs to the Stripe payment element. I think you should also confirm with Stripe/authorities that removing those fields will not go against the regulations for your country (including your customers' countries).
  12. Hi @Spinbox, This seems to be something injected by Stripe based on your settings in your Stripe dashboard. I don't see name inputs in my tests. Below is a screenshot of my Stripe payment fields: Could you check your dashboard settings please and let me know? Thanks.
  13. Aha! Thanks @bernhard. I wasn't aware you'd found a non-blocking solution. Thanks!
  14. Code GPT Visual Studio Code extension that lets you generate code from plain text within the editor using the official OpenAI API or other AI providers such as Google PaLM 2. https://marketplace.visualstudio.com/items?itemName=DanielSanMedium.dscodegpt https://codegpt.co/
  15. Thanks for this @Robin S. Maybe this technique can be used to achieve a non-blocking SSE? @bernhard, what do you think? I haven't thought it through; just wondering ATM. For reference:
×
×
  • Create New...