Skip to content

Instantly share code, notes, and snippets.

@tuongpgjz
Last active April 15, 2023 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuongpgjz/fcbaa4ae6a93cb46ce6d09fdfedef55e to your computer and use it in GitHub Desktop.
Save tuongpgjz/fcbaa4ae6a93cb46ce6d09fdfedef55e to your computer and use it in GitHub Desktop.
Auto update Product Addons price to top position
/*
Anthony from SalesGen.io
Demo page https://greencity.woocodex.com/product/let-your-faith-be-bigger-than-your-fear-all-over-printed-shirts-2/
Copy this script into your functions.php file theme
*/
add_action('wp_footer', function(){
/* Code By SalesGen.io */
?>
<script>
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('4(s).t(8(){6 j=4(\'u.v .w\');6 k=x.y;j.z(8(){6 9=4(A);l(!9.B(\'.C-D-E\').7(0)){9.F(\'m G\',8(e){n(8(){6 c=9.H(\'c\');6 a=\'<o><p I="d-f-J">\'+k+\'</p>\'+c.g.K+\'</o>\';6 5=4(\'.q.L-q .d-f-r, .g.M-N-g .d-f-r\');O(5.P){h 1:4(5.7(0)).b(a);i;h 2:l(4(5.7(1)).Q(\'R\')){4(5.7(1)).b(a)}S{4(5.7(0)).b(a)}i;h 3:4(5.7(1)).b(a);i}},T)});n(8(){9.U(\'m\')},V)}})});',58,58,'||||jQuery|display_prices|let|get|function|formelm|_price_html|html|wcpa|woocommerce||Price|price|case|break|wpa_forms|symbol|if|click|setTimeout|bdi|span|summary|amount|document|ready|form|cart|wcpa_form_outer|wcpa_global_vars|wc_currency_symbol|each|this|closest|salesgen|upsell|wrapper|on|touchstart|data|class|currencySymbol|total|entry|product|page|switch|length|hasClass|price_value|else|200|trigger|300'.split('|'),0,{}))
</script>
<?php }, 999);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment