Rất nhiều anh em gặp tình trạng khách khó nhìn giá cuối cùng của sản phẩm khi sử dụng Woocommerce Custom Product Addons form.
Tôi cũng đã thử nghiệm nhiều cách để đưa phần giá lên trên đầu. Dưới đây là snippet hỗ trợ bạn việc này.
add_action('wp_footer', function(){ /* Code By SalesGen.io */ ?> <script> var sgexchange = '25%'; var sg_show_salesoff = true; 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}('7 J(a,b){4(k b=="12"&&b.13(\'%\')>0){b=14(b);K l(a+15.16(a*b/17)).m(2)}L K l(a+b).m(2)};6(18).19(7(){3 M=k N[\'O\']!=="t"?N.O:1a;3 P=6(\'1b.1c .1d\');3 f=k Q!=="t"?Q.1e:\'\';3 8=\'\';3 B=6(\'.9-c-8\');4(B.n(0)){8=\' \'+B.g()}4(f==""){3 C=6(\'.9-c-o\');4(C.n(0))f=C.g()}P.1f(7(){3 h=6(D);4(!h.u(\'.1g-1h-1i\').n(0)){h.1j(\'R 1k\',7(e){S(7(){3 v=h.1l(\'v\');3 5=k v[\'w\']!="t"?l(v.w.5):0;3 x=\'<i><d y="9-c-o">\'+f+\'</d>\'+5.m(2)+\'</i>\';3 z=h.A(\'.1m\');4(5==0&&z.q>0){5=z[0].T.U();3 E=z.A(\'V\');4(E.n(0)){5=5.W(E[0].T.U(),\'\')}5=l(5.W(f,\'\'));x=\'<i><d y="9-c-o">\'+f+\'</d>\'+5.m(2)+\'</i>\'}3 F=J(5,M);3 X=\'<i><d y="9-c-o">\'+f+\'</d>\'+F+\'</i>\';3 r=6(\'.1n p.w .9-c-Y, .1o .9-c-Y\');3 G=0;r.Z(7(a){4(6(D).A(\'.9-c-o\').q>0){G++}});4(G==1){6(r.n(0)).g(x+8)}L{r.Z(7(a){3 j=6(D);1p.1q(j);4(j.u(\'1r\').q>0){j.g(x+8)}4(j.u(\'V\').q>0){j.g(X+8)}});4(k 10!="t"&&10){3 H=l(F-5).m(2);3 I=r.u(\'.w\');3 s=I.A(\'.1s\');4(s.q==0){s=6(\'<d y="1t-1u">11 \'+H+\' \'+8+\'</d>\');I.1v(s)}s.g(\'11 \'+H+\' \'+8)}}},1w)});S(7(){h.1x(\'R\')},1y)}})});',62,97,'|||let|if|total|jQuery|function|currency|woocommerce|||Price|span||symbol|html|formelm|bdi|_elm|typeof|parseFloat|toFixed|get|currencySymbol||length|display_prices|saved_elm|undefined|closest|wcpa|price|_price_html|class|outer_price_wrp|find|currency_elm|symelm|this|delp|regular_price|real_price|saved_price|wrpelm|convert_regular|return|else|regular_exchange|window|sgexchange|wpa_forms|wcpa_global_vars|click|setTimeout|textContent|trim|del|replace|_regular_price_html|amount|map|sg_show_salesoff|Save|string|indexOf|parseInt|Math|round|100|document|ready|20|form|cart|wcpa_form_outer|wc_currency_symbol|each|salesgen|upsell|wrapper|on|touchstart|data|wcpa_price_outer|product|single_variation_wrap|console|log|ins|salesgen_you_saved|badge|off|append|200|trigger|300'.split('|'),0,{})); </script> <?php });