Skip to content

Instantly share code, notes, and snippets.

View codeagencybe's full-sized avatar
🏠
Working from home

Fabio Tielen codeagencybe

🏠
Working from home
View GitHub Profile
@slaFFik
slaFFik / wpforms-add-bcc-to-emails.php
Created October 16, 2017 15:49
WPForms: add BCC email header to notification emails
<?php
add_filter( 'wpforms_email_headers', function ( $headers, $emails ) {
// APPLY THE BCC TO THIS FORM ID ONLY.
// CHANGE THE ID TO THE FORM YOU NEED. OR REMOVE THE WHOLE IF BLOCK IF NEEDED FOR ALL FORMS.
if ( 384 !== $emails->form_data['id'] ) {
return $headers;
}
// CHANGE THIS EMAIL ADDRESS TO YOURS:
@xlplugins
xlplugins / customize_wc_product_addons_option_price.php
Created September 20, 2017 12:59
Customizing 'woocommerce_product_addons_option_price' filter hook for Fabio Tielen
<?php
/**
* Add below function in theme functions.php file
*/
add_filter('woocommerce_product_addons_option_price', 'theme_name_product_addons_show_msrp', 20, 4);
function theme_name_product_addons_show_msrp($html, $option, $idx, $type) {
// User has chosen not to show MSRP, don't show it
@soldier99
soldier99 / CSS
Last active July 14, 2018 11:35
Woocommerce sale flash badges: New, Featured and save percentage
/* Woocommerce regular Sale badge */
.woocommerce span.onsale {
left: 0;
top: -10;
font-weight: 600 !important;
min-width: 100px !important;
text-align: center;
}
.woocommerce ul.products li.product .onsale {
@butlerblog
butlerblog / functions.php
Last active September 24, 2024 21:50
SMTP using wp-config.php for settings #smtp #wp_mail
<?php // Don't use this line.
/*
* Add the script below to wherever you store custom code snippets
* in your site, whether that's your child theme's functions.php,
* a custom plugin file, or through a code snippet plugin.
*/
/**
* This function will connect wp_mail to your authenticated
@codingawayy
codingawayy / excel-download-images-from-url
Last active July 16, 2023 00:22
Excel macro (VBA script) to download images based on the URL specified in the cells
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
Public Sub GURoL(url As String, FileName As String)
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, url, FileName, 0, 0)
@bobbiejwilson
bobbiejwilson / functions_wc_dropdown.php
Last active March 13, 2018 16:00
Woocommerce variation dropdown with stock qty.
function wc_dropdown_variation_attribute_options( $args = array() ) {
global $product;
$variations = $product->get_available_variations();
$args = wp_parse_args( apply_filters( 'woocommerce_dropdown_variation_attribute_options_args', $args ), array(
'options' => false,
'attribute' => false,
'product' => false,
'selected' => false,
'name' => '',
<?php
/**
* Modified from https://www.skyverge.com/blog/add-woocommerce-email-recipients-conditionally/
*
* Add another email recipient for admin New Order emails if a product from a specific category or with a specific tag is ordered
*
* @param string $recipient a comma-separated string of email recipients (will turn into an array after this filter!)
* @param \WC_Order $order the order object for which the email is sent
* @return string $recipient the updated list of email recipients
*/
@lukecav
lukecav / custom-register-fields.php
Last active October 9, 2024 00:34
Custom Registered FIelds Plugin
<?php
/*
Plugin Name: Custom Register Fields
Plugin URI: http://www.lcavanagh.bluehoststaff.com/
Description: Add first name, last name and job title.
Author: Luke Cavanagh
Version: 1.0
Author URI: http://www.lcavanagh.bluehoststaff.com/
GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
*/
@bassn
bassn / install-odoo-saas.sh
Last active January 7, 2025 13:29 — forked from yelizariev/install-odoo.sh
install odoo from source
#!/bin/bash
################################################################################################
# Fully automated script to install Odoo and Odoo SaaS Tool (tested on a fresh Ubuntu 14.04 LTS)
# * Install & configure last stable version of nginx
# * Install & configure last stable version of postgresql
# * Install & configure Odoo
# * Configure automated backup of Odoo databases
# * Optional: Install & configure Odoo SaaS Tool
# * Optional: Background installation: $ nohup ./odoo_install.sh > nohup.log 2>&1 </dev/null &
################################################################################################
@bentasm1
bentasm1 / functions.php
Last active July 10, 2016 16:28
WC Vendors - Notify anyone registering in WooCommerce on Checkout or My Account Page about strong password requirement.
OPTION 1 - Add a warning that you need a stronger password.
/* WC Vendors - Add a "Need a strong password" notice to the My Account Page */
add_action( 'woocommerce_register_form', 'wcvendors_notify_password_myaccount' );
function wcvendors_notify_password_myaccount() {
echo '<strong>Important</strong> -- This site respects your security. We require all new members to use a strong password. If you can not click the Register button, <strong>you need a stronger password</strong>.<br><br>';
}
/* WC Vendors - Add a "Need a strong password" notice to the Checkout Page */
add_action( 'woocommerce_after_checkout_registration_form', 'wcvendors_notify_password_checkout' );
function wcvendors_notify_password_checkout() {