Code get link affilate sản phẩm của Shopee vào website Wordpress
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>"; } }By Zubi Cloud - Công ty thiết kế website uy tín tại Hà Nội, thiết kế Web HCM, cho thuê hotsing, cho thuê cloud server giá rẻ, tên miền uy tín, thiết kế wordpress, thiết kế blogspot
Đăng nhận xét
0 Nhận xét