Posts by Byron Fitzgerald
-
-
-
Hi Glen,
Had a lovely break thanks, hope you did to.
I think it might be because the comments app is a bit outdated and doesn't have the full available options when rendering the templates. I'm pretty sure the each option doesn't exists for perch_comments. You'll need to return all the comments, then loop through them, then pass to perch_template. Something like below should work
Code- // Skip the template and return the comments
- $comments = perch_comments('South Prom', [
- 'skip-template' => true,
- 'sort' => 'commentDateTime',
- 'sort-order' => 'DESC',
- 'data' => [
- 'commentsTotal' => $commentsTotal,
- ],
- ]);
- // Map the array like we do in the previously used each property
- array_map( function($post) {
- $post['postAgo'] = get_time_ago(strtotime($post['commentDateTime']));
- return $post;
- }, $comments);
- // As we are using perch_template the namespace for the template will be <perch:content and not <perch:blog
- perch_template('webcam_comments.html');
-
I think when the date is stored it's set in the standard format of 'Y-m-d H:i:s'. The formatting of field happens during runtime in the template handler, instead of the save/edit process.
If that still doesn't work you can check the database, or use the <perch:showall/> to see the unformatted value
-
Had a look around for you. The listing page uses the following $Statuses->get_status_and_above('paid') to fetch the orders.
In the shop admin area you can view all the statuses. In the list of statuses there is an index column. Anything above that has a higher index than the paid status will be shown, anything lower will only be shown in the export.
You can edit the indexes as you need to show which orders you'd like to see. I'd take a backup before hand as well though as I'm not sure where else the index value is used.
-
You have to pass the styles through the elements.create function. You can also style the container with regular css.
Here's an example from the stripe docs
Code- // Create a Stripe client.
- var stripe = Stripe('pk_test_xxxxxxx');
- // Create an instance of Elements.
- var elements = stripe.elements();
- // Custom styling can be passed to options when creating an Element.
- // (Note that this demo uses a wider set of styles than the guide below.)
- var style = {
- base: {
- color: '#32325d',
- fontFamily: '"Helvetica Neue", Helvetica, sans-serif',
- fontSmoothing: 'antialiased',
- fontSize: '16px',
- '::placeholder': {
- color: '#aab7c4'
- }
- },
- invalid: {
- color: '#fa755a',
- iconColor: '#fa755a'
- }
- };
- // Create an instance of the card Element.
- var card = elements.create('card', {style: style});
- // Add an instance of the card Element into the `card-element` <div>.
- card.mount('#card-element');
If you want more customisation over the layout you can create individual elements separately (card, expiry, cvc, paymentRequest bytton). You can read more about it here
-
Something like webpack or rollup. If you're development setup doesn't use a bundler thats fine, there's an example here from one of the issues listed on the repo
-
The new intents gateway uses Stripe Elements to process the card info and supplies a token in return, so nothing should popup.
The JS example in the repo might need a bundler for it to work properly, but the code inside the init() function should work without a bundler.
-
The issue seems to be based on the attributes templates. Perch will find any files in the perch/templates/pages/attributes folder and list them in the `Edit page` page. The label is a human readable format of the file names in the folder.
What files are present in your perch/templates/pages/attributes, and what version of perch are you running?
-
I've got one site running my solution on production right now, with a second waiting client approval. ellimondo has done some testing and managed to get it to work I believe, but not sure if he is running it in production yet.
If anyone does try it and has any issues you can throw them up on the Github page. I'll try get back to you as soon as I can, as I know the deadline is shortly approaching
-
These are just warnings, so I doubt this would be causing a 500 error. Most likely it's a server/php configuration issue. Might need to increase some limits in your php.ini or could be down to incorrect URL rewrites.
Is there a specific page it's happening on?
-
You can see all the possible ways of filtering in the docs here. All the fields defined in your post.html template can be used to filter
-
The order of the results is determined by how close they match the search term. If you want to add custom sorting you'd need to do that on the returned array instead.
How are are you filtering so that you only get 9? The pagination is based on the initial set of returned results from the search function, filter after the function call will not effect the pagination
-
To get the post date rather than using the data option you can use the each option like below.
-
Carbon is a date library for PHP which offers a way to format 'human readable'dates like you want.
You can either use it how you've suggested setting it as a global perch variable, or you can add a custom filter to use in your template files
-
The error is coming up because the importer can't find any tags in the template. Double check the path for the template and verify that the template is in fact loaded.
-
I'm more than happy for Drew (or anyone) to use my solution and adapt it as he sees fit.
The main issue is testing the other gateways as Omnipay needed to be bumped up to v3, along with all the Gateway drivers. Whilst probably not too difficult I can imaging it would be extremely time consuming. As I haven't had any experience with using the other gateways, my change didn't take into consideration them.
-
Just seen it and added the missing files, turned my notifications on so won't miss any more!
-
As it looks like some people missed my original post, I'll stick it here as well.
I've created an initial release for an update to Perch Shop to let stripe take 3DS2 payments. You can find the repo here. Everything you need should be there, and the README provides an overview of the changes and what you need to do to get it up and running.
I've tested this locally but have yet to use this live, so I'd hold off on production use for now, though I have yet to experience any problems. If I could get any feedback on whether you guys can get it working that would be great. I've got some more tests myself to do and once everything is looking good I'll create a production ready release.
You can also just grab the download here.
-
If you are using perch_content instead of perch_content_custom in your page files the content will be cached, so you just need to republish the pages. You can do this individually or there is a republish button on the pages page.