I’ve rewrite this but still the display: “You don’t have sufficient permissions to view this page”.
$fac = wpo_wcpdf_thank_you_link( "", $num_factura );
$html= '<tr>';
$html .= '<td width="4%" align="left" valign="top" bordercolor="#017dc5"><small>'. $num_compra.'</small></span></td>';
$html .= '<td width="14%" align="center" valign="top" bordercolor="#017dc5"><small>'. $fech.'</small></td>';
$html .= '<td width="60%" valign="top" bordercolor="#017dc5"><strong>Asunto</strong></br><small>'.$asunto.'</small><strong></br></br>Descripción</strong></br><small>'.$refma[0].'</small></br></br><strong>Contacto</strong></br><small> ■ <b>Nombre</b> - '.$nombre.'</br> ■ <b>Localización</b> - '.$localizacion.'</br> ■ <b>Email</b> - '.$email.'</br> ■ <b>Tel</b> - '.$tel.'</br> ■ <b>Urgencia para empezar</b> - '.$urgencia.'</br> ■ <b>Preferencia</b> - '.$preferencia.'</br> ■ <b>Horario contacto</b> - '.$horario.'</small></br></br></td>';
$html .= '<td width="12%" align="center" valign="top" bordercolor="#017dc5"><small>'.$fac.'</br><b>No.factura</b><small></br>'.$num_factura.'</small></br></br><b>No.reforma</b><small></br>'.$refr.'</small></br></small></td>';
$html .= '<td width="10%" align="center" valign="top" bordercolor="#017dc5"><small>'. $prc .' € </small></td>';
$html .= '</tr>';
$data_html .=$html;
}
$page_links = paginate_links( array(
'base' => add_query_arg( 'paged1', '%#%' ),
'format' => '?paged1=%#%',
'prev_text' => '«',
'next_text' => '»',
'total' => $num_of_pages,
'current' => $paged1 ) );
if ( $page_links ) {
$data_html.= '</table>' . '<p><div align="center">' . $page_links . '</div></p>';
}else{
$data_html.= '</table>';
}
}
// Punto de Interrupción
// $data_html .= 'Pag: ' . $_POST['paged1'] . ', s: ' . $paged1;
return $data_html;
}
add_filter('woocommerce_thankyou_order_received_text', 'wpo_wcpdf_thank_you_link', 10, 2);
function wpo_wcpdf_thank_you_link( $text, $order ) {
if ( is_user_logged_in() ) {
$pdf_url = wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $order . '&my-account'), 'generate_wpo_wcpdf' );
$text .= '<a href="'.esc_attr($pdf_url).'"><span><img border="0" alt="Factura" src="https://www.reformasyservicios.es/wp-includes/images/euro3.png" width="100" height="100"></span></a>';
}
return $text;
}
add_shortcode('registro_reformas_compradas','regrefcomp');