Skip to content

Instantly share code, notes, and snippets.

View BurlesonBrad's full-sized avatar
🎯
Focusing

Brad Griffin BurlesonBrad

🎯
Focusing
View GitHub Profile
@BurlesonBrad
BurlesonBrad / autocheck-tos-box-woocommerce.php
Created September 18, 2016 19:49
Automatically check Terms of Service box in WooCommerce https://bradgriffin.me/woocommerce
function bkg_autocheck_tos( $terms_is_checked ) {
return true;
}
add_filter( 'woocommerce_terms_is_checked', 'bkg_autocheck_tos', 10 );
add_filter( 'woocommerce_terms_is_checked_default', 'bkg_autocheck_tos', 10 );
@BurlesonBrad
BurlesonBrad / .htaccess
Created October 10, 2016 21:10
C to the Dils
RewriteEngine On
RewriteCond %{HTTP_HOST} ^carriedils\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://carriedils.com/$1 [R=301,L]
// First line kinda obvious //
// Second line is the old URL //
// Line 3 is techinical server hooplah //
// This one says, "Yo. All three of my dubya's are gone. And, btw Google, this is a PERMANENT change (301) //
@BurlesonBrad
BurlesonBrad / index.html
Created October 14, 2016 03:35 — forked from jazzido/index.html
Glowing text effect with CSS3
<html>
<head>
<style type="text/css">
.glow {
-webkit-animation-duration: 1s;
-webkit-animation-name: glow;
-webkit-animation-direction: alternate;
-webkit-animation-iteration-count: infinite;
animation-duration: 1s;
animation-name: glow;
@BurlesonBrad
BurlesonBrad / snippet.php
Created July 27, 2017 02:26
keep price and CTA near featured images
remove_action('woocommerce_single_product_summary','woocommerce_template_single_add_to_cart', 30);
add_action('woocommerce_single_product_summary','woocommerce_template_single_add_to_cart', 15 );
I also found this, which may be helpful: https://github.com/allan23/ep-troubleshoot - doesn't seem to be in the plugin marketplace so you'd have to install it manually, but may be helpful in generating more debug info specific to what's happening in elasticpress land.
Looking more closely at the exception being logged during indexing:
Caused by: SearchParseException[failed to parse search source [{"from":0,"size":5,"sort":[{"post__in":{"order":"desc"}}],"query":{"match_all":{"boost":1}},"post_filter":{"bool":{"must":[{"bool"
:{"must_not":[{"terms":{"terms.product_visibility.name.raw":["outofstock"]}}]}},{"bool":{"must":{"terms":{"post_id":[56662,57698,58086,10463,32389,63478,60303,60287,60277,60308,60268,15626,65731,65444,65712]}}}},{"term":{"post_type.raw":"product"}},{"term":{"post_status":"publish"}}]}}}]]; nested: SearchParseException[No mapping found for [post__in] in order to sort on];
I would guess the issue is with one of those post ids: 56662,57698,58086,10463,32389,63478,60303,60287,60277,60308,60
{
"cluster_name": "elasticsearch",
"nodes": {
"UHLSl8KCSVy1qYZE294JcA": {
"name": "dunorthdesigns.vps.pagelyhosting.com-dunorthdesigns",
"transport_address": "10.0.6.143:9300",
"host": "10.0.6.143",
"ip": "10.0.6.143",
"version": "2.3.4",
"build": "e455fd0",
@BurlesonBrad
BurlesonBrad / they call him Jason
Created August 4, 2017 19:07
EP debugging file
{
"Versions:": {
"WordPress": "4.8.1",
"ElasticPress": "2.3.2",
"Elasticsearch": "2.3.4",
"WooCommerce": "3.1.1"
},
"Active Features": [
"search",
"related_posts",
56662 = https://dunorthdesigns.com/product/but-first-wine-tank/
57698
58086
10463
32389
63478
60303
60287
60277
60308
@BurlesonBrad
BurlesonBrad / snippet.php
Created August 18, 2017 21:09
Aelia + NGINX + Cache
# Add Aelia cookies to the cache key. This will create multiple copies of each
# cached page (one for each combination of currency, country and province/state)
proxy_cache_key "$scheme$request_method$host$request_uri $cookie_aelia_cs_selected_currency$cookie_aelia_customer_country$cookie_aelia_customer_state$cookie_aelia_billing_country";
# IMPORTANT
# This is an example configuration file, and the settings apply to the entire server.
# You should probably adapt these settings to apply to a specific location, instead,
# so that they only affect your specific ecommerce site.
#
# If you are not familiar with Nginx configuration, we recommend to contact your
@BurlesonBrad
BurlesonBrad / cookie-hider.php
Created August 20, 2017 22:13
Pagely's solution instead of currency switcher's Nginx solution