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
<?php | |
/* | |
Plugin Name: WooCommerce Rearrange Product Addons | |
*/ | |
$GLOBALS['Product_Addon_Display']; // get globals | |
// if variations - remove from single variation hook | |
function remove_plugin_actions(){ | |
remove_action( 'woocommerce_single_variation', array( $GLOBALS['Product_Addon_Display'], 'display' ), 15); |
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
<?php | |
add_filter( 'woocommerce_cart_shipping_method_full_label', 'add_free_to_free_shipping_label', 10, 2); | |
function add_free_to_free_shipping_label( $label, $method ){ | |
if ( $method->cost === '0.00' ){ | |
$label = $label . ' (Free)'; | |
} | |
return $label; | |
} |
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
<?php | |
$base_rest_url = 'http://rayflores.staging.wpengine.com/wp-json/'; | |
$woo_namespace_ver = 'wc/v1/products'; | |
define( 'WC_CONSUMER_KEY', 'ck_d18285f04efdc33b160849682f40d4cf58a3540a' ); | |
define( 'WC_CONSUMER_SECRET', 'cs_75b36a35c2645c518f60916f6e5387740e37389c' ); | |
define( 'WC_BASE_REST_URL', $base_rest_url ); | |
define( 'WC_NAMESPACE_VER', $woo_namespace_ver ); | |
$params = array( | |
'consumer_key' => urlencode( WC_CONSUMER_KEY ), | |
'consumer_secret' => urlencode( WC_CONSUMER_SECRET ) |
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
# 1. GoDaddy -> login | |
# 2. Go to Domains | |
# 3. Go to Manage Hosting for that domain | |
# 4. Click on Manage for the site. | |
# You should now be in Control Panel backend of oldsite.com | |
# Either via FTP or FileManager (icon) | |
# find .htaccess file in root of domain folder | |
# open that file with a text editor (eg. Notepad or Notepad++) | |
# replace the contents of existing file with one of the following code snippets |
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
<?php | |
add_action( 'wc_pip_styles','add_custom_css' ); | |
function add_custom_css(){ | |
?> | |
.customer-details { | |
margin-left: -15px; | |
margin-right: -15px; | |
} | |
.customer-details li { | |
padding: 0 15px; |
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
<?php | |
$i=1; | |
foreach (WC()->cart->cart_contents as $item) { | |
if ( isset( $cart_item[ 'composite_data' ] ) && ! empty( $cart_item[ 'composite_parent' ] ) ) { | |
return $cart_item_class . ' item-' . $i + 10; | |
} elseif ( isset( $cart_item[ 'composite_data' ] ) && ! empty( $cart_item[ 'composite_children' ] ) ) { | |
return $cart_item_class . ' item-' . $i + 20; | |
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
;( function ( $, window, document, undefined ) { | |
$( '.composite_data' ) | |
.on( 'wc-composite-initializing', function( event, composite ) { | |
var l = composite.api; | |
var step_objects = l.get_steps(); | |
var review_step = l.get_step_by( 'id', 'review' ); | |
var result = $.grep(l, function(e){ return e.id == id; }); | |
//console.log(step_objects); |
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
<?php | |
// vars | |
$field = get_field_object('cameroon','option'); | |
$cameroon = $field['value']; | |
$label = ucfirst($field['choices'][ $cameroon ]); // if needed for id | |
?> | |
<path id="Cameroon" class="'. $cameroon . '" blah blah blah |
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
function ads_added_above_last_p($text) { | |
if( is_single() ) { | |
$ad_code5 = "<!-- /35404881/JOA_end_of_article_300x250_1 --> | |
<center><div id='div-gpt-ad-1466631079074-3' style='height:250px; width:300px;'> | |
<script type='text/javascript'> | |
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1466631079074-3'); }); | |
</script> | |
</div></center>"; | |
$last = strrpos($content, '</p>'); |