Zubi Cloud hướng dẫn người dùng thiết kế wordpress chuyên nghiệp 1 thủ thuật khá hay, Code get link affilate sản phẩm của Shopee vào website WordPress.
Chèn đoạn code sau vào file functions.php của theme wordpress bạn đang dùng
add_action( 'woocommerce_after_add_to_cart_button', 'add_custom_button', 10, 0 ); function add_custom_button() { $string1 = 'https://shopee.vn'; $string2 = '?sp_atk=74c75d3f-bcb8-4739-aa6d-f441ebc07ea4'; $input = get_field('link_shopee'); $output1 = str_replace($string1,'https://shopee.vn/universal-link',$input); if(strpos($string2,$input)){ $output2 = str_replace($string2,'?af_click_lookback=7d&af_reengagement_window=7d&af_siteid=an_17171860000&af_sub_siteid=sellervn-640850272&af_viewthrough_lookback=1d&c=-&is_retargeting=true&pid=affiliates&utm_campaign=-&utm_content=sellervn-640850272&utm_medium=affiliates&utm_source=an_17171860000 ',$input);}else { $output2 = '?af_click_lookback=7d&af_reengagement_window=7d&af_siteid=an_17171860000&af_sub_siteid=sellervn-640850272&af_viewthrough_lookback=1d&c=-&is_retargeting=true&pid=affiliates&utm_campaign=-&utm_content=sellervn-640850272&utm_medium=affiliates&utm_source=an_17171860000 '; } $output = $output1.$output2; if($input){ echo "<a class='butonshoope' href='".$output1.$output2."' target='_blank'>Mua trên Shopee</a>"; } }
I blog often and I truly thank you for your information. This article has really peaked my interest.
I’m going to book mark your website and keep checking for new information about
once a week. I opted in for your RSS feed as well.
whoah this weblog is great i love studying your posts.
Stay up the good work! You already know, many individuals
are searching round for this info, you can help them greatly.
Wonderful website. Plenty of helpful info here. I am sending
it to a few friends ans additionally sharing in delicious.
And of course, thanks on your sweat!
Fantastic site A lot of helpful info here Im sending it to some buddies ans additionally sharing in delicious And naturally thanks on your sweat
I very delighted to find this internet site on bing, just what I was searching for as well saved to fav