But when i want to do it clickable it doesn't work.
function action_woocommerce_order_details_after_customer_details($order) {
$lamevaurl = get_post_meta( $order->id, 'wpcf-codi-qr-amb-el-carnet-de-soci-de-la-familia', true );
if(!empty($lamevaurl)){
<a href=" $lamevaurl" target="_blank" title="Descarrega QR de Soci">
Descarrega el QR del carnet de soci
</a>
}
add_action('woocommerce_order_details_after_customer_details', 'action_woocommerce_order_details_after_customer_details', 10, 1);
It would appear that you're not actually printing the text onto the page. Please try the following.
function action_woocommerce_order_details_after_customer_details($order) {
$lamevaurl = get_post_meta( $order->id, 'wpcf-codi-qr-amb-el-carnet-de-soci-de-la-familia', true );
if(!empty($lamevaurl)){
echo "<a href=".$lamevaurl." target='_blank' title='Descarrega QR de Soci'>Descarrega el QR del carnet de soci</a>;
}
add_action('woocommerce_order_details_after_customer_details', 'action_woocommerce_order_details_after_customer_details', 10, 1);
Hello again Shane. That code does not work for me. However... i made som changes in your code and now is working (thx 2 you).
This is right code:
function action_woocommerce_order_details_after_customer_details($order) {
$lamevaurl = get_post_meta( $order->id, 'wpcf-codi-qr-amb-el-carnet-de-soci-de-la-familia', true );
if(!empty($lamevaurl)){
echo "<a href='".$lamevaurl."'target='_blank' title='Descarrega QR de Soci'>Descarrega el QR del carnet de soci</a>";
}
}
add_action('woocommerce_order_details_after_customer_details', 'action_woocommerce_order_details_after_customer_details', 10, 1);