Skip to content

Instantly share code, notes, and snippets.

View alewolf's full-sized avatar

Aleksandar alewolf

View GitHub Profile
(function(){
try {
let observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
if (mutation.attributeName === "class") {
let attributeValue = jQuery(mutation.target).prop(mutation.attributeName);
if (attributeValue.includes('disabled')) {
jQuery('.fs-modal').find('.button-deactivate').removeClass('disabled');;
}
}
@alewolf
alewolf / gads-id-for-wc-google-listing-ads.php
Last active May 19, 2023 07:57
Enable product ID output for woopt Pixel Manager Google Ads dynamic remarketing for the WooCommerce Google Listing and Ads plugin
<?php
// Place the following code into your functions.php file in your child theme
add_filter('wooptpm_product_ids', function ($product_ids, $product) {
$product_ids['gla'] = 'gla_' . $product->get_id();
return $product_ids;
}, 10, 2);
<?php
/**
* Track custom add-to-cart conversions using the WooCommerce Pixel Manager
*
* Add this to your functions.php file
*/
add_action('wp_footer', function () {
?>
<?php
/**
* Track ViewItem events in Facebook using the WooCommerce Pixel Manager
* Add this to functions.php
*/
add_action('wp_footer', function (){
?>
<script>
<?php
/**
* If you want to fire the ViewItem event on variable products when
* no variation has been selected yet, then use the following code in
* your functions.php file.
*/
add_action('wp_footer', function () {
?>
<script>
RENAME TABLE
wp_actionscheduler_logs TO custom_prefix_actionscheduler_logs,
wp_actionscheduler_groups TO custom_prefix_actionscheduler_groups,
wp_actionscheduler_claims TO custom_prefix_actionscheduler_claims,
wp_actionscheduler_actions TO custom_prefix_actionscheduler_actions