Jump to content

kongondo

PW-Moderators
  • Posts

    7,529
  • Joined

  • Last visited

  • Days Won

    160

Everything posted by kongondo

  1. I have something nearly ready for this as well as similar methods I worked on in the past but never got a chance to commit. I hope to conclude these by the end of this week. I'll post here when done.
  2. Not an answer, just curious what the use case is?
  3. Great find buddy! Thanks. Wow! This is massive!
  4. 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 :-).
  5. OK. Let's arrange to have a chat, please, thanks.
  6. 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. I see what you mean. Should hopefully be a simple fix...just remove the uk-margin. Looks great! Thanks for the idea. 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. 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 :-). 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? 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).
  7. 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.
  8. News Update - 3 May 2019 - Part One The little speckled fella has been very busy on the trail. Despite being the smallest of its kind, she has lofty dreams. We've been working on the API and the Products GUI. In the next post, I'll tell you more about the API. Products Features and GUI Though there are a few issues still pending (aren't there always? sigh), I am relatively pleased with the results. Of course, during beta testing we'll received and incorporate feedback as best as we can. Only UI-Kit theme will be officially supported. Multilingual fields if site is multilingual Ajax powered inputs for fast and convenient editing Four types of products Physical product requiring shipping Physical product not requiring shipping (for collection) Digital product Service/Event (etc) products - e.g. Swimming lessons, Consultancy services, Hotel booking, etc Product Classification (ajax powered) by: Type: e.g. Belt, trousers, etc Brand: Puma, Sanyo, whatever (editors can type in or import brand names + planning to support logos) Categories (aka Collections): Multiple categories, e.g. Men, Girls, Hospitality Tags: Multiple tags can be entered, e.g. sale, amazing, etc Product Variants (consists of an Option (e.g. Colour) and an Option Value (e.g. Red) Add zero or n variants as you wish Live preview as you build variants Each created product variant can be enabled/disabled. Devs can then decide to either show that variant as unavailable or not show them at all. That's up to you :-). Apart from classifications, shipping class, inventory policy, weight and dimensions units, title and description (and this latter one may change), almost all product properties will vary by variant if variants are used Product properties include: Images Colour (more on this below) Downloads (centralised and reusable) Price and Compare Price (aka former price) Inventory policy (whether to track or not) Charge taxes SKU (stock keeping unit) Inventory (quantity) Allow back orders (aka overselling) - @note: this can be set per variant. This is useful if one variant can be restocked faster than others Weight Length Width Height Weight Unit (mg, g, kg, oz, lb, t) Dimensions Unit (mm, cm, m, in, ft ) Shipping Class - can be used for product-based shipping if needed (e.g. bulky goods, light, fragile, small items, perishable, etc) Images (more on this below) Downloads (more on this below) Images Multiple images can be added to both a product and its variants (in case its has some). Images add to the product itself can be used with all variants Images added to a variant are tracked/tagged as belonging to only that variant In some cases, it may not make much sense to add different images for similar variants. For instance, a small red hat and a large red hat could probably share the same images. Although we do not currently support specifying an already uploaded image as belonging to a group of variants, this may change in the future Colour Similar to images, can be set at both product and its variants level Colour saved in RGBA format Downloads Also similar to images, can be populated for both both product and/or its variants Multiple files can be added to a product A file designated for 'whole' product will be available to download irrespective which variant of the product was purchased Conversely, a file or files saved for a variant will only be available to the buyer if they buy that variant of the product The above is useful if you want buyers to be able to download different files of the same product. For instance, recently someone needed to sell two versions of a font as part of one product. This is a solution for such cases. TODO List Lots! e.g. default settings for some properties, e.g. weight unit, shop currency, etc. For the frontend, we are creating a rich language-aware API that you can use to build your shop however you want. There will be no rendering of markup (but see first post in this thread about a separate fully functional frontend shop). In the next post, we talk a bit about the API. Before that, here are some screenshots and a video demo (if you can spare some 20 minutes away from watching, er..., cat videos? ?) Screenshots Video Demo Thanks ?
  9. How are you setting up your featured image? Blog will first attempt to check for a featured image by getting the first image with the tag 'featured' or whatever tag you passed to it in the option 'post_image_tag'. If no image is found and the rendered Blog Post is a 'small one', i.e. summarised, it will try to get the first embedded image in blog_body if blog_body is not blank. Assuming you are using the former approach (meaning you tag your featured images), you can just use ProcessWire API directly to get the featured image using getTag(). Here are some examples: # retrieve first image with the tag 'featured' or user-specified 'tag' # // assuming you are on a blog-post page $image = $page->blog_images->getTag('featured'); $image = $page->blog_images->getTag($options['post_image_tag']); $image = $page->blog_images->getTag('some-tag'); // getting the blog page(s) from another page $p = $pages->get(1234); $image = $p->blog_images->getTag('my-tag'); // we got an image if($image) { // go wild }
  10. Maybe the issue needs to be sorted from intelephense side? If it is provided file associations, it should, theoretically, work. ?
  11. Maybe if you could explain your use case a bit more. What do you do with the uploaded file? If you are adding it to a ProcessWire Page, ProcessWire will not allow you to have your 'human-friendly' file name ?. It will be sanitised. I am guessing that is why you wanted to save the original file name in the description? Secondly, who is uploading the files? The general public? Registered users? Site editors?
  12. I don't quite understand. Do you mean you want to save the non-sanitised file name as a description rather than adding a description to the file later yourself?
  13. Great. Give me a few days please to update the dev branch to include a few changes first, including the recent suggestions by @adrian. This way, we can work on one clean (dev) base. I'll also namespace it. Moving forward, we only support PW 3. I missed the memo it seems. Which ones are these?
  14. I wouldn't call it a bug. That's the sanitizer at work. For custom things like that, I suggest you use getMenuItems() method to create your menus. See the examples in that link.
  15. Hi all, Sorry, I'm late to the party! Interesting conversation here. I am not a fan of duplicating modules, if what they offer are very similar. I would prefer to try a PR in the first instance :-). Interestingly, the other day when @adrian was reporting some issues with the module and suggesting changes, I had a rethink about your suggestions and decided it was worthwhile going with your suggestions, especially the auto include. I didn't mention it since I didn't have the time then to work on the module. So, my take is, we can improve the existing module, with new features and/or hooks. All PRs will be duly credited. I suggest we try that first. That's my opinion :-).
  16. Sorry I wasn't clear. I did not wish to dual boot ?.
  17. Thanks for this Adrian. I have used the extension before but to run Python code. Thanks for the example code!
  18. I like the productivity of this lazy man who is in a hurry ?! You are on fire mate! ?.
  19. I followed the instructions to the letter, except for using my home directory, I used a different drive. At first I was getting 403s (maybe because disk had to be mounted first?). Now am getting this site cannot be reached.
  20. Excellent! Thanks much!
  21. Yes, I do, thanks! That would be awesome! If I can skip setting these up manually, even better :-).
  22. So I tried Midori and it rendered ProcessWire website all funny. The Firefox that shipped with BunsenLabs (BL) seemed to be fast enough so I thought, what the heck, maybe Chrome will run just fine as well? We'll, what do you know! Of course it's eating up RAM like it's Google's Birthday but I reckon @OrganizedFellow was right about Solus being 'slow' on my machine due to the visuals. Since BunsenLab has a very light footprint, Chrome still has enough to chew on. I then tried Sublime Text. I've always loved Sublime but after using VSC, going back was difficult. I decided to install VSC to see if it would run OK in BL. Surprise! So far, it seems to run just fine. I haven't opened multiple files (and I don't need to in this machine). I'm just happy I am able to use the tools I am used to without hiccups. One other thing I liked about BL (yes, we are on first names now ;-)) is that it has a post-install script that runs and asks you if you want to install useful tools like a LAMP stack, etc. I let it install the LAMP stack and here I am, up and running. Apache2, PHP 7 with many useful extensions, phpMyAdmin, etc. ps: @OrganizedFellow, was that you who made the request to BL to port the CB welcome script to BL? :-). If it was, thanks!
  23. I tried it when the machine still had Windows 10 and it didn't fare much better than chrome (memory) Worked! Thanks. I've had a quick look. Will investigate more, thanks.
  24. Thanks all. I installed lubuntu and didn't like it at all. My mouse didn't work, which actually turned out its batteries had just died :-)! With hindsight, it was a good thing since it lead me to Debian Crunchband++ and eventually BunsenLabs which I am liking...(I think). Thanks! Went with a derivative, BunsenLabs Thanks. I have now installed Sublime Text. I don't know where to find out though ;-). It's not showing up in the menus. run programme cannot find it as well. Any thing else I should do? Google is taking me down all sorts of rabbit holes...
×
×
  • Create New...