Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/25/2018 in all areas

  1. emplate Field Widths Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template. Since v0.2.0 the module also adds a similar field to the settings of Edit Field for Repeater, FieldsetPage and Repeater Matrix allowing you to quickly set the widths of inputfields within the Repeater/FieldsetPage field, or within each Repeater Matrix type. Note: widths are only saved if the edit form is submitted with the "Field widths" field in an open (non-collapsed) state. Edit template Edit Field: Repeater Edit Field: Repeater Matrix Why? When setting up a new template/repeater or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process. Config options You can set the default presentation of the "Field widths" field to collapsed or open. Widths entered into the "Field widths" field are only applied if the edit form is submitted with the field in an open (non-collapsed) state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width. https://github.com/Toutouwai/TemplateFieldWidths https://modules.processwire.com/modules/template-field-widths/
    3 points
  2. Hello, I'm very new to ProcessWire but already fell in love with this CMS/CMF! I just finished my first small project and as I saw a lot of questions and different answers in this forum on how to set up a nice language switcher for your website, I decided to write my first tutorial. ---------- Please note: I rewrote this tutorial since I was made aware and learned that flags should not be used for language selectors! There are some threads here in the forum (and from external sources) where this question is discussed: https://processwire.com/talk/topic/13196-adding-image-field-to-language/ http://daily.unitedlanguagegroup.com/stories/editorials/inside-design-language-selector-no-flags https://processwire.com/talk/topic/16524-extending-languages-template/ http://www.flagsarenotlanguages.com/blog/why-flags-do-not-represent-language/ https://processwire.com/talk/topic/14241-language-names-and-utf8-page-names/ Thanks, @ottogal @bernhard @jmartsch @kongondo an all others for your hints! ---------- TUTORIAL - Set up a nice language switcher for your website - here we go: This will be the desired result! Step 1) Setup at least 2 languages in your PW install. In my case it's German (default language) + English: Step 2) Add a custom field Type = Text Name = languagecode This will hold the ISO 639-1 two-letter language code for the respective language. The field is needed to provide a simple method for outputting the language code in your templates. Without this field, you will need to programmatically construct your two-letter language code output via PHP (at least for the default language, as ProcessWire doesn't allow to rename the default language and it will always be called default). Here is an overview for ISO 639-1 two-letter language codes: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes Step 3) Add this field to the system template: language. To achieve this, go to Setup / Templates and activate the filter Show system templates: Now you can add the previously created field languagecode to the language template. Step 4) Edit your languages and fill in the appropriate values. a) default (German) Name = default (this can't be changed and is read only) Title = Deutsch (in both language tabs! - this is important as your visitor should always see his language item ... in his language) languagecode = de b) english (English) Name = english Title = English (in both language tabs! - this is important as your visitor should always see his language item ... in his language) languagecode = en Step 5) Now we are ready to write our template output! As we already have the appropriate two-letter ISO language code (languagecode field), we can use this in our html lang property: <html lang="<?php echo $user->language->languagecode; ?>"> Also the rel alternate output in the html head is simple. Put the following code within your <head></head> area: <?php // Handle output of 'hreflang' link tags for multi-language (SEO!) foreach ($languages as $language) { if (!$page->viewable($language)) { continue; } // Get the http URL for this page in the given language $url = $page->localHttpUrl($language); // Get the language code using custom languagecode field $languagecode = $language->languagecode; echo PHP_EOL.'<link rel="alternate" hreflang="'.$languagecode.'" href="'.$url.'">'; } ?> In my sample I've used Boostrap 4 and the code below shows a complete navbar with our language switcher (BTW the language switcher will always be visible, even when the bootstrap navbar is collapsed): <nav id="mainnav" class="navbar navbar-expand-lg navbar-light px-4 px-md-5 sticky-top"> <a class="navbar-brand" href="<?php echo $config->urls->root; ?>"> <img src="<?php echo $config->urls->templates; ?>images/logo-rund-80x80.png" alt=""> Your Site Title </a> <ul class="navbar-nav ml-auto mr-3 mr-lg-0 order-lg-last d-none d-xs-custom-flex language-switcher" aria-label="<?php echo __('Sprache wechseln') ?>"> <?php echo '<li class="nav-item dropdown">'; // Construct the language prompt in the current user language $prompt = $user->language->title.' ('.strtoupper($user->language->languagecode).')'; // Current language = dropdown-toggle echo '<a class="nav-link dropdown-toggle" href="#languages" id="language-select" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">'; echo '<span class="world-icon"></span><span class="sr-only">'._x('(aktuelle Sprache)', 'navigation').': </span> '.$prompt; echo '</a>'; echo '<div id="languages" class="dropdown-menu dropdown-menu-right" aria-labelledby="language-select">'; foreach ($languages as $language) { // Get the http URL for current page in the given language $url = $page->localHttpUrl($language); // Construct the language prompt in the given language $prompt = $language->title.' ('.strtoupper($language->languagecode).')'; // Next language item (except current language) if ($user->language->id != $language->id) { if (!$page->viewable($language)) { echo '<span class="dropdown-item disabled">'.$prompt.'</span>'; } else { echo '<a class="dropdown-item" href="'.$url.'">'.$prompt.'</a>'; } } } echo '</div>'; echo '</li>'; ?> </ul> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarMainMenu" aria-controls="navbarMainMenu" aria-expanded="false" aria-label="<?php echo __('Menü einblenden / ausblenden') ?>"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse my-3 my-lg-0" id="navbarMainMenu"> <ul class="navbar-nav mr-auto"> <?php // Top navigation consists of homepage and its visible children foreach ($homepage->and($homepage->children("template=main-page|news|contact-points")) as $item) { if ($item->id == $page->rootParent->id) { echo '<li class="nav-item active">'; echo '<a class="nav-link" href="'.$item->url.'">'.$item->title.'<span class="sr-only"> '._x('(aktuelle Seite)', 'navigation').'</span></a>'; echo '</li>'; } else { echo '<li class="nav-item">'; echo '<a class="nav-link" href="'.$item->url.'">'.$item->title.'</a>'; echo '</li>'; } } ?> </ul> </div> </nav> That's it! I hope you will like my tutorial and if there are any questions, critics or improvements please let me know! Thanks, Martin
    3 points
  3. Hi @adrian I just created a PR with two new panels. 1) A hello world panel to make it easier for others to create panels and contribute to your great module: 2) A WebHook panel that should make it easier to debug and develop webhook based functionality (like GIT webhooks or webhooks from foxycart or any other 3rd party service): Settings are simple: The panel shows the latest requests to templates you selected (in this screenshot the basic-page template was also enabled): You can also retrieve the data of logged requests, so it is easier to develop scripts without having to fire webhooks over and over again: Open to feedback, as always ? https://github.com/adrianbj/TracyDebugger/pull/30
    3 points
  4. This week is the Thanksgiving holidays here in the US and it’s one of those weeks where there’s no school for the kids, so it’s a little hard to get work done. I don’t have any major core updates to report this week, so I’m not going to bump the version number up today. However, look for a new dev branch version next week. We will also release a new master version before the end of the year… sometime within the next month. Before releasing the new master version, I’m primarily interested in resolving any issues present in the current dev branch that are not present on the current master branch. Meaning, issues that have arisen due to some recent change only on the dev branch (if there are any). So if you are aware of any issues experienced on the dev version that are not on the master, please let me know. Thanks for your help in testing. Even though it’s been a vacation week, I’ve been waking up early every morning to work on the new PW website. Lots of continuing progress, and I should have another update on that next week along with a new dev branch version of the core. Thanks for all the feedback from last week’s post. Among other things, I caught that folks don’t like the skyscrapers anymore (as a visual element), so I’ve taken them out and agree it’s better without them. I’ll have some updated screenshots next week. Off topic, but was so excited I had to tell someone. I got a computer upgrade this week after 4 or so years of working off the same laptop. A few keys on my laptop keyboard recently stopped working (letters in the word “ProcessWire” — I wore them out), so I’ve been using an external keyboard plugged in. That’s been working alright, but made it hard to see the screen since I can’t sit as close with an external keyboard in front of the laptop. It was getting a little tiresome to work on, the keyboard wasn't repairable without rebuilding the whole laptop (costly), and it was basically time for an upgrade, but computers are expensive and I was resigned to waiting another year. Over these Thanksgiving holidays I found out a family member had bought an iMac a year or so ago and didn’t like it, so they were going back to a PC. I said, “hey why don’t you sell that iMac to me?” We came to an agreement. Now I've got it here and am moving my development environment over to this newer computer, and have been working off it for a couple of days and loving every minute of it. It's going to help out a lot with developing ProcessWire.
    2 points
  5. OK, thought something like that... Since I'm already in love with ProcessWire, it won't take long as I'll bombard the forum with my questions! ?
    2 points
  6. For those interested, here is a proof-of-concept Process module for parsing a module version number from a GitLab repo, public or private (if you have an access token). For demonstration there is a form for entering the module info and displaying the retrieved version, but for real usage you would send the module info to the Process page by POST and get the version number back in an AJAX response. Form... ...and with version number returned...
    2 points
  7. Good solution, but a couple of things: 1. It would be sensible to add a few restrictions about what page can be retrieved by the $pages->get(). The page ID is user input so potentially any page ID could be inserted into the URL allowing a user to see pages that they should not have access to: unpublished repeater pages, or indeed any page including admin pages could be rendered (although PW has extra checks here that would probably prevent anything sensitive from being disclosed). Something like this would be safer: $id = $sanitizer->int($input->urlSegment1); $match = $pages->get("id=$id, template=repeater_your_repeater, status!=unpublished"); 2. Calling $match->render() will only produce output if a template file exists for the repeater, which is normally not the case. It's possible to add a repeater template file but it might be easier to echo individual field values from $match.
    2 points
  8. Thanks @horst that worked. When I set sharpening to none, it was reflected on the final save window. I'm still getting a slight pixelation on the source jpg but it's probably non Module related. It's hardly noticeable but would be keen to hear if you think it could be.
    1 point
  9. Nice, thank you for working on the GitLab side of things. Would you mind if I used your code as the basis of a GitLab adaptor for the Release Notes module? PS> There is already code in ReleaseNotes for both Github and BitBucket, so adding the GitLab adaptor would give some nice closure to ReleaseNotes.
    1 point
  10. Thanks for the debugging. That actually makes sense because I have a check to not rename files with "-n" extensions because PW's automatic adding of "-n" when there is already a file of the same name. I'll have to see if I can sort out a workaround for this, but I won't be able to look until tomorrow.
    1 point
  11. Do you really need it human readable? In this case GET and urlencode() is maybe a safer option. $query = "?keywords=" . urlencode('løts of special chåracters änd'); // "?keywords=l%C3%B8ts+of+special+ch%C3%A5racters+%C3%A4nd" $keywords = urldecode($input->get->keywords); // "løts of special chåracters änd"
    1 point
  12. @adrian If I use this: [Y-m-d_H-i-s]-$page->title the filename ALWAYS renamed on save but if I use this $page->title-[Y-m-d_H-i-s] or this [Y-m-d_H-i-s] it doesn't.
    1 point
  13. Here is the GitHub link to the flag-icon-css repo: https://github.com/lipis/flag-icon-css Don't use flags for language selectors as flags do not represent languages!
    1 point
  14. seems that google stole my idea: https://github.com/GoogleChromeLabs/ProjectVisBug thx for sharing @szabesz and @Robin S
    1 point
  15. @Peter Knight, please can you try the following fix manually on your side? In the file site/modules/CroppableImage3/ProcessCroppableImage3/ProcessCroppableImage3.module on the lines 234 & 235 you must remove the wrapping isset(...) on each first checked param per line! This 233 // get quality & sharpening from post, sanitize and validate it 234 $quality = isset($this->input->post->quality) && is_numeric($this->input->post->quality) && 0<intval($this->input->post->quality) && 101>intval($this->input->post->quality) ? intval($this->input->post->quality) : $options['quality']; 235 $sharpening = isset($this->input->post->sharpening) && ImageSizer::sharpeningValueStr($this->input->post->sharpening)==$this->input->post->sharpening ? $this->input->post->sharpening : $options['sharpening']; should become this: 233 // get quality & sharpening from post, sanitize and validate it 234 $quality = $this->input->post->quality && is_numeric($this->input->post->quality) && 0 < intval($this->input->post->quality) && 101 > intval($this->input->post->quality) ? intval($this->input->post->quality) : $options['quality']; 235 $sharpening = $this->input->post->sharpening && ImageSizer::sharpeningValueStr($this->input->post->sharpening)==$this->input->post->sharpening ? $this->input->post->sharpening : $options['sharpening']; If it fixes it on your side too, I will release a new version of the module.
    1 point
  16. I'm not sure on the specifics (which @Pete or @ryan should know), but we have some restrictions on the forum for new members based on what we saw spammers (mis-)use. Iirc the limits are not that high, so maybe you just need a few more posts to be good to go.
    1 point
  17. Some people think that anyone who works in any form of IT is made of money, but sadly it's not always the case. I know the feeling about dying laptops. About a year ago, when it was just over 3 years old, the motherboard on my laptop died. Fortunately I was able to track down a replacement part on Ebay, and after carefully removing a lot of screws, swapping over the CPU and heatsink, and convincing Windows that I wasn't running a pirated copy, I managed to get up and going again. My desktop is a bit long in the tooth too, but since I upgraded the hard drive in my laptop and added an external screen and keyboard, the desktop tends to get less use now, although it was a lifesaver when I needed to get online to order the replacement motherboard for the laptop, and do some work while I waited for the part to arrive.
    1 point
  18. I'm looking forward to client-side image resizing in PW. I have clients who will upload massive 24-megapixel 10MB images without a second thought. I use the "Max width for uploaded images" option but it's not working reliably because the oversized images still get through somehow (perhaps out-of-memory issues). Anyway, I was looking for a foolproof way for non-tech-savvy clients to resize images and found this: https://bulkresizephotos.com/ Images are resized client-side so it's much faster than many of the other online tools. You can resize multiple images at once and get a ZIP file back with the results. And the best feature is that you can set the tool up how you want and then generate an embeddable drag-and-drop widget, so it's super-easy for clients to use and there are no options for them to mess up. I created a Hanna Code for the widget and added it to the online documentation I supply to clients so it's right there when they need it. Could even potentially be embedded directly in the admin theme. Until client-side resizing comes to PW this is a useful stopgap.
    1 point
  19. Great idea and implementation, even though I could live with a mouse dragging - I know it would be a tough task, so it's NOT a feature request ? I played with it and left-aligning the inputs would disable the "jump" when the width value is changed via mouse (after each click on the number input spinner you have to move the mouse a bit). Also note that the inputs and names are in one line that makes the "editor" more compact. Unfortunately the module is not compatible with aos_column_break, but I don't expect the module to support it as it would be really hard. For example, the corresponding page looks like this with the above template: In theory it would be not that hard to support the "main" tab but additional aos columns can set inside tabs which would be a nightmare to deal with ?
    1 point
  20. Thanks for your suggestion. Thanks god, I had a backup (the Duplicator saved my ass). I extracted it and installed it in a subdomain. Login was no problem. Then I replaced the old htaccess with new one and – et voilla – I'm in. I remember, that I had to deactivate some rules in the htaccess file, cause Processwire had some problems with this hoster (Host Europe). I think the reason was, that I added some rewriting stuff to the htaccess.
    1 point
  21. It is not possible. For such custom requirements, we suggest use of the method getMenuItems(). It gives you total freedom. Have a read here and see these examples. You'll need to do a bit of custom work. Shout if you need help.
    1 point
  22. When we submit the login form of your admin page, the response is a 404 error code. Also your attempt to visit the reset.php failed, you might have an issue with the .htaccess file. You could try the following : backup everything create a file - disable-procache.php - on the root web dir (along the index.php file) with this code: <?php namespace ProcessWire; require_once('./index.php'); // get the module $pc = $modules->get('ProCache'); // turn off procache $pc->cacheOn = false; visit the page at http://yourwebsite.com/disable-procache.php replace the .htaccess file with this https://github.com/processwire/processwire/blob/master/htaccess.txt (do not forget to rename it to .htaccess) try to login - result ?
    1 point
  23. @Roych Repeater items are also pages, but they are hidden under admin page, so they don't have URLs, but you can use URL segments for that. You should allow URL segments on you 'about' page template. Then you can construct URL based on team repeater item id or other fields inside repeater: <?php $summary = truncateText($team->body); echo "$summary ...";?> <a href="<?php echo $page->url($team->id); ?>">Read more</a> Then on you about page template: if ($input->urlSegment1) { $pagename = $input->urlSegment1; $match = $pages->get($sanitizer->int($pagename)); if (!$match->id) throw new Wire404Exception(); echo $match->render(); return $this->halt(); } ---------- By the way you can use $sanitizer->truncate() to truncate your summery text https://processwire.com/blog/posts/processwire-3.0.101-core-updates/
    1 point
  24. Why? It is possible using url segments, but I think it would be better to create pages. You have all the benefits that pages bring with them, like security (see RobinS post below!!), proper url handling, maybe page path history if enabled etc...
    1 point
  25. Alternative to PS and much more interesting illustrator...for those who hate montly rates...;) https://affinity.serif.com real 30% off - for beginners the workbooks are great!
    1 point
  26. I have to agree with you @diogo, we probably lost this one. But there are many more of them out there coming in here. So putting a smile on, checking if API reference tab is open and back to the keyboard to complete our mission))
    1 point
  27. @bernhard you are being very r...tst-donk-prrrrrrrr @Ivan Gretsky thanks for your...kkkkkkkkkakkakakakakakk....tststst...krrrrk I'm very interested in ProcessWordpessssssjoooooomla....krrrk...drupaodXpo3-lockherupcli-mate-change-oax...krrrrrrrrrrrrrrrrrkrrrrrrrrrrr....pf-nhec Sorry @Nvim, had to do it ?
    1 point
  28. @lenoir - I think all those old themes should be removed from the modules directory - hopefully with the imminent site rebuild they will be. I think the problem with PW's admin theming approach is that new functionality doesn't make it into 3rd party themes. I have always said that we need a skinning approach, rather than (or perhaps in addition to) theming. That said, the approach that AdminThemeBoss takes is in effect a skin, rather than a separate theme and I think this is great and is perhaps a model for others to follow.
    1 point
  29. Seriously brilliant @Robin S - this is going to be an absolutely huge timesaver! I think this deserves a screencast in the first post showing the layout change dynamically as percentages are adjusted - so cool!
    1 point
  30. Normally if you copy a core module to your /site/modules/, ProcessWire asks which of the two versions you want to use. You can the select the one in /site ..and edit it as you wish. I'm not sure if it also works with Process Modules though. I also can't remember when the feature was introduced.
    1 point
  31. ...with a not so little impact when building complex sites. I already know I'm going to use this a lot ? Thank you!
    1 point
  32. Prices (or anything else in a shop) should never be by language imho. What if I'm living in a country foreign to my native speaking language. The German living in America should always be able to visit a shop in German (if it's localized), but otherwise shall be treated like any other American.
    1 point
  33. News Update - 20 November 2018 Hi all. This update should have gone up about 3 weeks ago :-). Some of you are aware that I've been having computer issues but that's sorted (fingers crossed) for now. Before that, I'd managed to work on and mostly complete a number of things. I'll try and remember them now as I write and hopefully I don't forget anything (these posts not only help with generating discussions but they will be useful references when I get round to doing the docs). Orders First, thanks (especially @arjen and @szabesz) for the feedback on orders and customers. We now have a FieldtypeOrders and FieldtypeOrderItems which store permanent records of orders. The former stores the aggregates (total price, etc) and customer info. The latter stores data about each individual item in the order (name, price, etc). These two simplify querying orders (backend stuff). Customers FieldtypeCustomers stores registered customers' data. It is also useful for frontend customer login areas/dashboards and for returning customers in cases where customers have to login in to make purchases, e.g. retrieve their stored address. Products The products field has been updated to store product dimensions. Shipping This is by far the biggest work to date, I think. It consists of 3 modules, one each for Shipping Zones, Options and Rates. I think it is comprehensive enough to do away with the need to write custom shipping classes although we'll keep that option open. Please note that although the explanation of the underlying logic behind shipping can seem complicated, the GUI for setting up shipping will be quite simple and intuitive to use. Zones Setting up shipping zones To create a shipping zone, you will have first set up countries where you ship to. This is a global setting since it also affects taxes. Once that is sorted, you can start creating shipping zones. You can create as many shipping zones as you need. A shipping zone consists of geographical areas where you ship physical products to. A shipping zone can have as many shipping regions as needed. Regions A shipping region can be any of these: Continent (E.g. Asia) Country (Germany, Lithuania, UAE) State/Province (Kowloon, Goa, Texas, Arezzo) The selection of regions (GUI) will be inbuilt. I.e., shop admins will be able to select Quebec or Nigeria or Asia, etc. In addition, one will be able to further refine their region definitions using postal/zip codes. Postal/Zip codes Postal codes can be matched in several ways: Verbatim: in this case, you specify an exact postcode(s) to match, e.g. CD30 78GH or 18000 Range: For numerical postcodes such as US zip codes, shop admins can specify the desired range(s), e.g. 60001 - 61909 Wild cards: This will match the first n characters of the postal code, e.g. SW* or BH3* You can enter as many postal codes to match as you wish. A customer's shipping address details at checkout are used to match their order to the shipping zones defined in the system. If no match is found, the system defaults to a generic shipping zone/rate if you have one set up AND assuming the customer's delivery address is in a 'place' you ship to. If not match is found at this point, the customer will be shown an error or custom message you set up. Shipping zones examples 1. State/Province + Postcodes Say you ship only to California. It's a big place so you decide to divide up the place , into 5 shipping zones using zip codes. In this example, the first 4 shipping zones are defined by zip code ranges. The fifth zone takes care of any other areas inside California not within the zip code ranges in the first 4 zones. California zone 1: 90001 - 92999 California zone 2: 93000 - 93705 California zone 3: 94200 - 94799 California zone 4: 95000 - 95750 California zone 5: All other zip codes in California In this example, zone #5 will be matched as long as the State in the shipping address state is California and the zip code is not within the ranges described in zones 1 - 4. 2. Country + States/Provinces In this example, you ship only to Canada. You create several zones based on Canadian provinces as follows: Canada zone 1: Alberta, British Columbia Saskatchewan (multiple regions in one zone) Canada zone 2: Ontario, Quebec Canada zone 3: All other provinces In this example, zone #5 (all other provinces) will be matched as long as the shipping address country is Canada and the province is not one of those in zones 1 or 2. 3. Continent In this example, we use continents to set up shipping zones based on groups of countries. For instance, setting up zones for Africa: Africa zone 1: East Africa consisting of the countries (regions) Kenya, Uganda, Tanzania Africa zone 2: West Africa; Gambia, Cameroon, Togo, Niger Africa zone 3: North Africa: Egypt, Tunisia, Morocco Africa zone 4: South Africa: Zimbabwe, Botswana, South Africa In this case, the system will match the country to their continent. Customers do not have to enter 'continent' in their shipping address details :-). Rates Shipping zones alone are useless without rates :-). Padloper 2 allows you to create rates that you can use and reuse across different zones. Please note that rates in this case just define the applicable rates(s) for an order (or part of an order) based on certain conditions. Rates do not specify how much shipment should be paid. We will come to that later below. Rates can be based on: Flat rate: A single flat rate should be paid for this zone. For instance, using our examples above, we can set a flat rate for all shipments to California zone 1 but set a different rate for California zone 3. Price: Shipment is calculated based on price. E.g. if order is worth < $30, charge $2.50 Weight: Shipment rate calculated based on weight of items in basket Quantity: Shipment calculated based on quantity of items in basket Rate Applies To A rate 'based on' value in itself is incomplete. One also needs to specify how the shipment rate will be applied. The choices are: Order: Shipment will be charged PER ORDER (the whole order). This means apply the shipment once irrespective of number of items in the order, or their price or weight, etc. Item: Shipment will be charged PER ITEM in the order. So, if we have 10 items, shipping will be charged 10 times, etc. Item-group: Shipment will be charged once PER EACH MULTIPLES OF THE 'SAME ITEM'. By item-group is meant a product with the SAME ID and same VARIANT ID. So, if we have two shirts, that have the same product ID, but one is orange with variant ID 1 and the other is blue with variant ID 2, those are NOT the same item. If our basket contains 3 of the orange shirts, that is counted as one item-group and if we have 1 blue short, that is another item group. In this case, shipment will be charged once for each item-group - once for the orange shirts and once for the blue shirt. Product-class: This is a special rate so let's examine it more closely. Product Class Shipment is a powerful feature that allows shipment to be calculated based on a product class. A product can only belong to one class at a time. A class is a special category which you use to group similar products for the purposes of shipping. For instance, you can have the following classes: Heavy: This would be a class for heavy items Bulky: A class for bulky items Small Fragile Etc... You can create and use as many product classes as you wish. Product class shipment is used with any combination of the above Rates and Rate Applies To. With product class shipments, you can mix and match as required. For instance, for your Small items, you can use Flat Rate shipping applicable to the whole Order. You could also have a Weight-based Rate that is Applied per Item. Or, a ship your Fragile items using a Quantity Rate applying per Item-group. As you can see, using product class shipments allows for more flexibility within an order. Of course, you can set up different product class rates depending on your shipping zone. For example, you can Flat Rate shipment for Bulky items shipped locally and an Item Rate shipment for Small items shipped to your international customers. Please note that in the case of Rate Applies To Order with respect to Product Class shipment Rate Value Using a Rate Value setting, you can specify what value should be used to determined whether an order has met a shipping criteria. Consider the following examples: €2 shipment will be charged PER ITEM in the basket if the ITEM COSTS at least €15. In this case the Rate Value looks at the price of a single item (i.e, >= €15) in order to apply a €2 per item shipment Now consider a similar example but with a different Rate Value. €2 shipment to be charged PER ITEM in the basket if the TOTAL COST of the basket is at least €15. In this case, the total cost of the basket is used to determine if the threshold has been reached. The last piece of the puzzle is Shipping Methods. You might have a flat rate or a price-based rate, but in relation to time (or level of service) how do you actually deliver the product? Methods Shipping methods are straightforward. You can add as many shipping methods as you want. For instance: Collection: Buyer collects from your shop Same day delivery Standard delivery 3 - 4 Days' delivery Express delivery Etc There are no predefined methods. You set this up yourself to suit your needs. Options Shipping Options complete the shipment system. A shipping option is a combination of a shipping rate and a shipping method. Think of them as a matrix (similar to Table rate shipping in WooCommerce). Shipping options are automatically created based on selected Shipping Rates and Shipping Methods for a zone. The admin then has to enter a shipping fee/charge/cost for each combination of Rate and Method. At checkout, the customer will be presented with the shipping options available to them and how much that would cost them. Here are some examples Shipping Options (Methods X Rates): Options: a 1 x 1 combination You should could offer a Standard Delivery (Method) charging a Flat Rate £10 for all transactions. Options: a 2 x 1 combination Offer Normal and Express shipping charged at a Flat Rate £5 and £10 respectively for either Method. Options: a 1 x 2 combination Offer Standard delivery on all shipping based on Quantity of order and charging $7 if order contains less than 10 items and $4.50 if order contains more than 10 items Options: a 2 x 2 combination Delivery Methods: Collection Normal Same Day Weight-based Rates: Rate 1: Less than 10 kg Rate 2: Greater than 10 kg but less than 20 kg Rate 3: Greater than 20 kg Shipping options will be the matrix of the above methods and rates each with a shipment fee, e.g. Collection x Rate 1: Free Normal x Rate 1: £5 Same Day x Rate 1: £15 Normal x Rate 2: £8 Etc.. Options: a more complex combination: product class rates Delivery Methods Standard Express Product-class Rates + Applies To Small items: quantity-based rate charged per item-group Fragile items: flat rate charged per item Heavy goods: weight-based rate charged per item Rates Small items quantity less than 5: $0.75 Small Items quantity more than 5 but less than 15: $0.50 Heavy goods: less than 30 kg: €10 per product Shipping options will be a matrix of the above methods and rates each with its own shipment fee, e.g. Standard delivery of Small Items if less than 5: $0.75 per item-group Express delivery of Heavy Goods if item < 30 kg: €10 per product You get the idea ? Maximum shipping Cost and Handling Fee Padloper 1 included a maximum shipping cost. This is retained in version 2. In version 2, you can add a handling fee which will be applied PER EACH shipment calculation. So, if shipping applies per order, a handling fee is applied once. If shipping applies once per product class in an order, handling fee will be charged x the number of eligible product classes in the shipment (e.g. once for Small items, once for Heavy Goods, ETC). Merge Shipping This is work in progress and applies to Product Class-based shipping. It allows the shop admin to specify what shipping rates can be merged in order to use one shipping rate instead of two. For instance, a shopping cart/basket could contain 5 Small Items and 3 Medium-Sized Items. Rather than charge for and ship these separately, the items could be merged and shipped together using the Medium-Sized items rate. Shipping Package This is a planned feature that may not make it in the first release. It is useful where shop owners use delivery services like Fedex where package dimensions and weight or volumetric weight are important factors. I think that's it. I could have forgotten something or could have expressed something better. I'll edit this post if such needs arise.
    1 point
  34. I kept running into the issue of self-invalidating access tokens and wanted the site's content editors to be able to handle the generation of new access tokens themselves. The module, however, limits those functions to superusers. Could you change the module to check for the module-admin permission? It's ProcessWire's internal permission to check who can edit module configurations. It's deactivated by default and has to be created and assigned manually, so there's no additional risk or security concern. On a standard PW installation, it still only applies to superusers. However, it gives people the possibility to allow editors to generate access tokens. So instead of if ($this->user->isSuperuser()) { $href = self::API_URL_AUTHORIZE . '?' . http_build_query($request); $link = "<a href='$href'>" . __('get Access Token') . "</a>"; } it's if ($this->user->isSuperuser() || $this->user->hasPermission('module-admin')) { $href = self::API_URL_AUTHORIZE . '?' . http_build_query($request); $link = "<a href='$href'>" . __('get Access Token') . "</a>"; } (There's a second check somewhere further down). Thanks for considering this. I forked the module for now, but would much rather like this to be incorporated into master.
    1 point
×
×
  • Create New...