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 | |
/*********************************************************************************************** | |
* This function will automatically resync variable product prices in case the prices don't show | |
* on the catalogue pages anymore. | |
* | |
* Simply place it in functions.php | |
***********************************************************************************************/ | |
add_filter( 'woocommerce_get_price_html', 'resync_variable_product', 100, 2 ); |
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 | |
/* | |
* Since version 1.8.2 of the plugin. | |
* | |
* This filter will add aditional conversion ID and label pairs to the output | |
* of the Google Ads pixel. | |
* | |
* It will add the output to every page with the Google Ads remarketing pixel, | |
* including the purchase confirmation page. |
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 | |
/* | |
* Keywords: freemius, readme.txt, changelog, free version, pro version | |
* | |
* Description: This code takes a readme.txt of a WordPress plugin, that has been prepared for deployment | |
* over freemius, and generates a changelog text output with the changelog for the free and one for the pro version. | |
*/ | |
$source_file = '../src/readme.txt'; |
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 | |
/** | |
* This mu plugin deactivates the Pixel Manager | |
* while the Thrive Theme editor is active. | |
* | |
* Create a file disable-pmw-on-thrive-editor.php. | |
* Place it in the /mu-plugins/ folder within the /wp-content/ folder. | |
* If the /mu-plugins/ folder doesn't exist yet, it must be manually created. | |
*/ |
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 | |
// https://stackoverflow.com/a/2031935/4688612 | |
// https://stackoverflow.com/q/67277544/4688612 | |
protected function get_visitor_ip(): string | |
{ | |
$proxy_headers = [ | |
'HTTP_CF_CONNECTING_IP', // Cloudflare | |
'HTTP_TRUE_CLIENT_IP', // Cloudflare Enterprise | |
'HTTP_INCAP_CLIENT_IP', // Incapsula |
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
/** | |
* HubSpot custom code action | |
* | |
* Capitalizes the first letter of every part of a contact's first name, last name, address and city. | |
* | |
* Can easily be configured to update any other contact property. | |
* | |
* Examples: | |
* - john -> John | |
* - DOE -> Doe |
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 | |
// The product ID must be changed and must match the specific product that you want to be removed | |
add_filter('wooptpm_order_items', function ($order_items, $order){ | |
foreach($order_items as $item_id => $item ){ | |
$product = $item->get_product(); | |
if($product->get_id() === 14 && $item->get_total() == 0) unset($order_items[$item_id]); |
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('wooptpm_ga_ua_parameters', function ($analytics_parameters, $analytics_id){ | |
$analytics_parameters['custom_map'] = [ | |
'dimension1' => 'ecomm_prodid', | |
'dimension2' => 'ecomm_pagetype', | |
'dimension3' => 'ecomm_totalvalue', | |
]; | |
return $analytics_parameters; |
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_action('wp_head', function () { | |
?> | |
<script> | |
jQuery(document).on('wooptpmAddToCart', function (event, product) { | |
gtag('event', 'add_to_cart', { | |
"send_to" : wooptpmDataLayer.pixels.google.analytics.universal.property_id, // this is important to scope it to only GA UA and not send it to other properties | |
'ecomm_prodid': product.dyn_r_ids[wooptpmDataLayer.pixels.google.analytics.id_type], // you must make sure that the same ID type is being used for GA and Google Ads | |
'ecomm_pagetype': wooptpmDataLayer.shop.page_type, |
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
// First you'll need to load the gtag.js library | |
function load_library(){ | |
echo '<script async src="https://www.googletagmanager.com/gtag/js?id=GA_UA_PROPERTY_ID"></script>'; | |
} | |
// Then output the conversion tracking scripts | |
// The Google Ads conversion ID must include the "AW-" in front of the number | |
function (response) |