This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[options] | |
# | |
# WARNING: | |
# If you use the Odoo Database utility to change the master password be aware | |
# that the formatting of this file WILL be LOST! A copy of this file named | |
# /etc/odoo/openerp-server.conf.template has been made in case this happens | |
# Note that the copy does not have any first boot changes | |
#----------------------------------------------------------------------------- | |
# Odoo Server Config File - TurnKey Linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Hide shipping rates and methods when free shipping is available. | |
* Updated to support WooCommerce 2.6+ Shipping Zones. | |
* | |
* Author: Fabio Tielen / Code Agency | |
* URL: https://codeagency.be | |
* | |
* @param array $rates Array of rates found for the package. | |
* @return array | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_cart_no_shipping_available_html', 'ca_message_no_available_shipping_methods', 10, 1 ); | |
add_filter( 'woocommerce_no_shipping_available_html', 'ca_message_no_available_shipping_methods', 10, 1 ); | |
function ca_message_no_available_shipping_methods( $default_msg ) { | |
$custom_msg = "Unfortunately, our delivery service is available in your location"; | |
if( empty( $custom_msg ) ) { | |
return $default_msg; | |
} | |
return $custom_msg; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @snippet Custom Checkout Fee for WooCommerce | |
* @author Fabio Tielen / Code Agency / https://codeagency.be | |
* @compatible WooCommerce 3.4.5 | |
*/ | |
// Display Buttons | |
// Uses woocommerce_form_field() | |
add_action( 'woocommerce_review_order_before_payment', 'ca_checkout_radio_choice' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP PROCEDURE IF EXISTS convertToInnodb; | |
DELIMITER // | |
CREATE PROCEDURE convertToInnodb() | |
BEGIN | |
mainloop: LOOP | |
SELECT TABLE_NAME INTO @convertTable FROM information_schema.TABLES | |
WHERE `TABLE_SCHEMA` LIKE DATABASE() | |
AND `ENGINE` LIKE 'MyISAM' ORDER BY TABLE_NAME LIMIT 1; | |
IF @convertTable IS NULL THEN | |
LEAVE mainloop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @snippet Show custom information on product single page and archive page | |
* @website https://codeagency.be | |
* @author Code Agency / Fabio Tielen / [email protected] | |
* @testedwith WooCommerce 3.4.4 | |
*/ | |
// ----------------------------------------- | |
// 1. Add new text field to product edit page (General tab) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo -e "Importing products now!" | |
OLDIFS=$IFS | |
while IFS='|' read -r sku images product_title short_description cats weight regular_price stock_qty manage_stock length height width | |
do | |
DIMS=({\"length\":\"${length}\"\,\"width\":\"${width}\"\,\"height\":\"${height}\"}) | |
echo ${DIMS[@]} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description Minimum, maximum, incremental and start quantity for products | WooCommerce | |
* @author Fabio Tielen / Code Agency / https://codeagency.be | |
* @testedwith WooCommerce 3.3 | |
*/ | |
add_filter( 'woocommerce_quantity_input_args', 'ca_woocommerce_quantity_increment_changes', 10, 2 ); | |
function ca_woocommerce_quantity_increment_changes( $args, $product ) { | |
if ( is_singular( 'product' ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @snippet Automatically add a specific product to cart when cart amount is above certain amount | |
* @author Fabio Tielen // Code Agency // https://codeagency.be | |
* @testedwith Woo 3.3+ | |
*/ | |
add_action( 'template_redirect', 'codeagency_add_product_to_cart' ); | |
function codeagency_add_product_to_cart() { | |
if ( ! is_admin() ) { | |
global $woocommerce; |