Example PHP code for cursor-based pagination using the phpclassic/php-shopify package. …
Author: Ryan Oun
Random post, I wanted to write this down in case this issue happens again. My Whirlpool top loading washer (Model #WTW4950XW2) wasn’t spinning or agitating properly. To fix this I replaced the Washer Motor Run Capacitor. The whole process took about 5 minutes to complete. I ran about 10 loads since I replaced the capacitor and it seems to be working perfectly so far. Here’s a link to the Washer Motor Run Capacitor for those who have the same washer. …
I accidentally created too many photo albums with the same name, I needed a solution to delete it all without manually deleting it. There’s probably an easier way to do this if you know it let me know. NSString *albumName = @"SOME ALBUM"; __block PHAssetCollection *albumCollection = [[PHAssetCollection alloc] init]; PHFetchOptions *albumOptions = [[PHFetchOptions alloc] init]; [albumOptions setPredicate:[NSPredicate predicateWithFormat:@"estimatedAssetCount >= 0"]]; PHFetchResult *userAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAny options:albumOptions]; dispatch_async(dispatch_get_main_queue(), ^{ [userAlbums enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) …
Solution for detecting if a user has already used a certain coupon code in shopify's abandon email template. …
I didn’t use the mailjet wrapper, instead I used curl to call the request. Here’s an example code to send a pdf attachment file with mailjet. I believe its similar to the code in their documentation. function sendMailjetAttachment($email = '', $name = '', $subject = '', $message = '', $file = '') { $mailjetApiKey = ''; $mailjetApiSecret = ''; $pdfBase64 = base64_encode(file_get_contents($file)); $data = [ 'Messages' => [ [ 'From' => [ 'Email' => "[email protected]", 'Name' => "From Email" ], …
I have this issue with selectWoo and WooCommerce where if you change the country the states select field doesn’t hide. I didn’t have time to debug it or find a solution so I just removed it completely by de-registering the selectWoo scripts and styles. The quick fix (place this in your themes functions.php): add_action( 'wp_enqueue_scripts', function () { if ( class_exists( 'woocommerce' ) ) { wp_dequeue_style( 'selectWoo' ); wp_deregister_style( 'selectWoo' ); wp_dequeue_script( 'selectWoo' ); wp_deregister_script( 'selectWoo' ); } } ); …
This probably isn’t useful for anyone but I’m currently using WooCommerce with WordPress and I needed a solution where a product item would automatically be added to cart on page load. The code below is what I came up with, this code will also force the user to have only 1 quantity of the item. To use, fill in the $product_id variable with your product id and paste the code in your child themes functions.php file. add_action( 'wp_loaded', function() { …
Check out the St. Johns Bridge in Portland if you’re ever in the area! Shot with the Canon 6D …
WIth access to WordPress files you can force login using wp_set_current_user and wp_set_auth_cookie without knowing the password. …
We decided to stay in a cabin for two nights before Christmas in the Woodland/Cougar area in Washington. These photos were taken with the Lumix GX85 and Canon FD 28mm/50mm lens. …