How to add product url to woocommerce from a metadata
I’m using Woocommerce for products. All products are imported automatically by a plugin.
now i input product url for affilliate shop and change in the source product link
affilliate link format is:
product url= affilliate user code + website address + metadata
affilliate user code: affuser/kjhygdfdh
website address: https://www.affsite.com
metadata: get_post_meta($post->ID, 'affmeta',true)
product url woocommerce meta data: _product_url
i need in function get meta key and add to affilliate user code + website address then input in product url in woocommerce
Note: I have all of the above and it is a fixed link
A friend said I should use the following functions (save_post,get_post_meta,update_post_meta)
But I don’t know where and how to do it
Leave an answer