Skip to content

Instantly share code, notes, and snippets.

View mommaroodles's full-sized avatar

Melanie Shepherd mommaroodles

View GitHub Profile
@mommaroodles
mommaroodles / functions.php
Created May 17, 2019 11:25 — forked from BFTrick/functions.php
Remove Add to Cart Buttons
<?php
function patricks_remove_loop_button(){
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); // removes the add to cart button on the shop page
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); //removes the add to cart button on the single product page
}
add_action('init','patricks_remove_loop_button');
@mommaroodles
mommaroodles / functions.php
Created May 17, 2019 11:21 — forked from chrdesigner/functions.php
Custom Add To Cart Messages
<?php
add_filter( 'wc_add_to_cart_message', 'custom_add_to_cart_message' );
function custom_add_to_cart_message( $product_id ) {
$product_id = $_REQUEST[ 'product_id' ];
if ( is_array( $product_id ) ) {
$titles = array();
// Change add to cart text on archives depending on product type
add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' );
function custom_woocommerce_product_add_to_cart_text() {
global $product;
$product_type = $product->product_type;
switch ( $product_type ) {
case 'external':
return __( 'Take me to their site!', 'woocommerce' );
@mommaroodles
mommaroodles / woocommerce-single-product-functions.php
Created May 17, 2019 11:05 — forked from ohsoren/woocommerce-single-product-functions.php
Reorder the single product page product information
<?php
/**
* woocommerce_single_product_summary hook
*
* @hooked woocommerce_template_single_title - 5
* @hooked woocommerce_template_single_rating - 10
* @hooked woocommerce_template_single_price - 10
* @hooked woocommerce_template_single_excerpt - 20
* @hooked woocommerce_template_single_add_to_cart - 30
* @hooked woocommerce_template_single_meta - 40
@mommaroodles
mommaroodles / functions.php
Created May 17, 2019 11:03 — forked from ChromeOrange/functions.php
Managing WooCommerce Product Tabs
<?php
/**
* Standard Tab Code from woocommerce-hooks.php
*/
/* Product page tabs */
add_action( 'woocommerce_product_tabs', 'woocommerce_product_description_tab', 10 );
add_action( 'woocommerce_product_tabs', 'woocommerce_product_attributes_tab', 20 );
add_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30 );
add_action( 'woocommerce_product_tab_panels', 'woocommerce_product_description_panel', 10 );
@mommaroodles
mommaroodles / functions.php
Last active May 23, 2019 17:43
Remove Add to Cart, Add View Product Button @ WooCommerce Loop
//shop page - remove avada add to cart and view
// First, remove Add to Cart Button
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
// Second, add View Product Button
add_action( 'woocommerce_after_shop_loop_item', 'archive_view_product_button', 10 );
function archive_view_product_button() {
global $product;
@mommaroodles
mommaroodles / custom-snippet.php
Last active May 1, 2019 13:32
Snippet for Custom Subscribe page
$current_currency = get_woocommerce_currency();
if ($current_currency == 'USD') {
// set to USD
echo do_shortcode('[rpt name="subscribe-usd"]');
} elseif ($current_currency == 'EUR') {
// set to EUR
echo do_shortcode('[rpt name="subscribe-eur"]');
}
<IfModule ssl_module>
SSLEngine on
SSLCipherSuite ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1 ##just until cPanel eventually decides to support TLSv1.3
SSLHonorCipherOrder On
SSLCompression off
SSLUseStapling on
SSLSessionTickets Off
</IfModule>
@mommaroodles
mommaroodles / docker-swarm-ports.md
Created April 27, 2019 10:50 — forked from BretFisher/docker-swarm-ports.md
Docker Swarm Port Requirements, both Swarm Mode 1.12+ and Swarm Classic, plus AWS Security Group Style Tables

Docker Swarm Mode Ports

Starting with 1.12 in July 2016, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.

Inbound Traffic for Swarm Management

  • TCP port 2377 for cluster management & raft sync communications
  • TCP and UDP port 7946 for "control plane" gossip discovery communication between all nodes
  • UDP port 4789 for "data plane" VXLAN overlay network traffic
  • IP Protocol 50 (ESP) if you plan on using overlay network with the encryption option

AWS Security Group Example

@mommaroodles
mommaroodles / audit.rules
Created November 23, 2018 23:13 — forked from Neo23x0/audit.rules
Linux Auditd Best Practice Configuration
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/