Leaderboard
Popular Content
Showing content with the highest reputation on 04/24/2022 in all areas
-
Thanks but unfortunately I don't see that happening, and it's not about the donations. I'm working with .NET for at least about 3 years now as the backend, and Angular/Next.js/etc for the frontend, all these on a corporate laptop. My own old laptop where I have PHP is now slow as hell, I boot it up only a few times a year. This "setup" makes it very inconvenient to maintain AOS, and I'm completely out of what's happening with PW and PHP lately, which complicates things even more.2 points
-
Good Afternoon @kongondo, Hope all is good your side and you've enjoyed your weekend. I'm just pulling a LOAD of products from a stockist and I was wondering (as I believe it is not yet covered in the docs) what is the best way to create products via API. This should then help me to quickly generate products and manage stock levels. I've created the parent product with the usual method. e.g. $product = new Page(); $product->template = "padloper-product"; $product->parent = $pages->get("template=padloper-products"); $product->title = "Test"; $product->padloper_product_stock->price = 22.25; $product->padloper_type = "Trousers"; $product->padloper_categories = "Suits"; $product->save(); But then I'd like to add variants on the fly too. So I also used: $product_variant = new Page(); $product_variant->template = "padloper-product-variant"; $product_variant->parent = $product; $product_variant->title = "Test Variant"; $product_variant->padloper_product_stock->price = 22.25; $product_variant->padloper_type = "Trousers"; $product_variant->padloper_categories = "Suits"; $product_variant->save(); This does indeed add the product as a variant below the aforementioned product. So then I notice that I of course have to enable "use variants" to view them on the custom product dashboard view (they show if you view from admin pages under tree) and can also update the attribute field page reference, so it shows the selectized value. Therefore I've used: $product = $pages->get(10203); $product->of(false); $product->padloper_product_attributes = 'Size'; $product->padloper_product_settings_use_variants = 1; $product->save(); $product->padloper_product_attributes = "Size"; works perfectly, however $product->padloper_product_settings_use_variants = 1 doth not. I also tried $product->padloper_product_settings->use_variants = 1, but I assume this requires some other method to update its value? Is it ok for me to go about this bulk creation as I am so far and could you shed some light on the variant matter if you have a mo. Many Thanks, Look forward to getting this up and ready to show you ? Alex1 point
-
Thanks! TL;DR No; I will not provide a feature comparison list of Padloper 1 versus Padloper 2 for the sake of validating the price of the latter. The simple reason is that it is a futile exercise. Pricing a product takes into account so much more than a features list ?. Longer Read Pricing a product is not as simple as your post implies. If it was simply a matter of adding new / more features, pricing most things in life would be straightforward. All we'd have to do is add a new feature and subsequently increase the price. Fortunately, that is not how the real world works. For instance, at what point will the law of diminishing returns kick in? Or, at what point does the product become unaffordable to most users simply because more features were added? Assuming a product was priced at x and I add 20 new features, should I then price it at 20x?? If 20x is beyond reach for many customers, do I then stop adding features so that I can freeze the price at 20x? Should I remove features so that I can reduce the price? Your proposition also implies that all added features are equal with respect to their object and/or perceived values. So, if I add 1 feature, the price should go up commensurately. I guess you get my point by now. However, let's talk a bit more about this. Pricing a product is a delicate combination of various factors. Some of these include, in no particular order: Perceived value. Objective value. Product Features. Inflation. Customer service. Market place. Competition. Quality of product. Other market forces. The above is not an exhaustive list and some of the points could probably be merged into one. Tempted as I might to digress into an economics pricing class 101, I'll pass and just make a few more comments. With no relation whatsoever to the current pricing points for Padloper, my opinion is that Padloper 1 was under-priced. Not just my opinion, by the way, as various people have privately told me this (unsolicited comments). If you are still wondering whether you need Padloper 2 then you probably don't need Padloper 2 ?. Padloper 1 will work just fine in your case. Those who need Padloper 2 know it and know why they need it. So, in answer to your question, no; I will not provide a feature comparison list of Padloper 1 versus Padloper 2 for the sake of justifying the price point of the latter. It is pointless to do so as the intricacies of pricing any product are much more complex than your question implies. As for the features of Padloper 2, I'll add these to the new Padloper website in due course. Meanwhile, you can get a glimpse of these from my original post. Demo videos are also on the way.1 point
-
The way I've done things like this is to create a text field, use a hook to add a sort code to that field, then set each relevant parent template to sort its children using that field. The sort code would be whatever you'd normally sort by, but with a prefix that depends on whether the page has children or not. So, I'd use something like the following (not tested) in ready.php, here assuming you'd basically sort on title: $this->addHookAfter('Pages::saveReady', function($event) { $page = $event->arguments[0]; if(in_array($page->template, array('template1', 'template2', 'template3'))) { $page->of(false); if($page->numChildren() > 0) { $sortcode = "A-" . $page->title; ) else { $sortcode = "B-" . $page->title; } $page->set('sortcode', $sortcode); } }); Of course, you could use a hook in a module instead. And you can use the same basic technique to get just about any kind of sort order you want.1 point
-
Something that would be worth a try... Use a saveReady hook to put all the tags as space-separated values into a (hidden) textarea field. Then use the **= operator with the tags string of the current project. From the docs:1 point
-
v0.0.12 now available. This fixes a few bugs and also introduces interactive dependent-selects in the config. Now that both the config and the pages have dependent selects, I thought it would be helpful to demo how it all works. Firstly, the config. On the details tab, you select the quantity you want to measure and then choose what units you want to be selectable within a page (you can also choose whether to convert automatically, not at all, or to 'ask'): New field.mp4 You will realise that we ended that demo just saving with no quantity selected. That's because we can use the same field in different template contexts to measure different quantities. So, next, we are going to add our field to a template and choose 'volume' as the quantity: volume template.mp4 Similarly, we can add our field to a different template to measure mass: mass template.mp4 Finally, we can create a page using one of these templates. In this case, it is 'volume' and we have chosen to convert automatically: volume page.mp4 If we had chosen to 'ask', we would have got a confirmation box before doing the conversion. All of this is accomplished by the magic of htmx (and of course ProcessWire). The principles behind it are discussed at The actual code has moved on a bit from that post. For instance, I have used css transitions in the config. These work really nicely with htmx: #Inputfield_unit_set { opacity: 1; transition: opacity 200ms ease-in; } #Inputfield_unit_set.htmx-swapping { opacity: 0.1; transition: opacity 100ms ease-out; } #Inputfield_unit_set.htmx-settling { opacity: 0.1; } Now I'm getting the hang of htmx, I really like it ?1 point
-
This all looks very promising, I can see areas where additional common tweaks or added tools would be helpful. Integration for USPS/UPS/DHL realtime rate quotes is an obvious one. Will you be setting up a roadmap/wishlist hub someplace like uservoice or something along those lines? This project is going to have a lot more of those than any other plugin you've done I think...1 point
-
Same for Outlook, Yandex, Zoho and everything that needs either an "App password" or 2FA (2 Factor Auth). Another thing: sometimes it's necessary to use different ports (for whatever reason) so it's either 465, 587, or even 2525. Just double-check here.1 point
-
In Gmail, for example, you can set "Less secure app access" (Security > Less secure apps) so that WireMailSMTP will be able to access it. Probably it can help.1 point
-
Also if you want to preview the PDF when working on the styling. I added ob_clean(); because otherwise it only works in Firefox. <?php $pdf = $modules->get('WirePDF'); ob_clean(); $pdf->markupMain = $config->paths->templates . 'pages2pdf/custom.php'; $pdf->markupFooter = $config->paths->templates . 'pages2pdf/custom_footer.php'; $pdf->cssFile = $this->config->paths->templates . 'pages2pdf/custom_style.css'; $pdf->pageOrientation = 'P'; $pdf->pageFormat = 'A4'; $pdf->bottomMargin = 10; $pdf->download('pages2pdf/custom.pdf'); echo "<a href='{$config->urls->templates}pages2pdf/custom.pdf' download>Download PDF</a>"; ?>1 point
-
For anyone with the same problem here is my code for generating custom and multiple pdf´s on the same page with different content and styling. <?php $pdf = $modules->get('WirePDF'); $pdf->markupMain = $config->paths->templates . '/pages2pdf/custom.php'; $pdf->markupFooter = $config->paths->templates . '/pages2pdf/custom_footer.php'; $pdf->cssFile = $this->config->paths->templates . '/pages2pdf/custom_style.css'; $pdf->pageOrientation = 'P'; $pdf->pageFormat = 'A4'; $pdf->bottomMargin = 10; $pdf->save('pages2pdf/custom.pdf'); echo "<a href='{$config->urls->templates}pages2pdf/custom.pdf' download>Download PDF</a>"; ?>1 point
-
Hi @Flashmaster82 In this case you need to use the module "WirePDF" bundled in the Pages2Pdf module. You can use WirePDF to generate PDFs with custom content and styling. The readme has some examples how to do this: https://github.com/wanze/Pages2Pdf#wirepdf I suggest to also take a look at other existing ProcessWire PDF modules, as this one is really old and not maintained actively - it still works though ? Cheers1 point