snipt

Ctrl+h for KB shortcuts

PHP

add iva or cf to woocommerce invoices

1
2
3
4
5
<?php
global $wcdn;
$billing_cfs = $wcdn->print->get_order()->order_custom_fields['_billing_cf'];
echo(strtoupper($billing_cfs[0]));
?>
https://snipt.net/embed/ec663333031a904ee5562eea703c7e26/
https://snipt.net/raw/ec663333031a904ee5562eea703c7e26/
ec663333031a904ee5562eea703c7e26
php
PHP
5
2016-09-20T17:04:54
True
False
True
Jun 21, 2013 at 06:11 AM
/api/public/snipt/65166/
add-iva-or-cf-to-woocommerce-invoices
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a><span class="k">global</span> <span class="nv">$wcdn</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a><span class="nv">$billing_cfs</span> <span class="o">=</span> <span class="nv">$wcdn</span><span class="o">-&gt;</span><span class="na">print</span><span class="o">-&gt;</span><span class="na">get_order</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">order_custom_fields</span><span class="p">[</span><span class="s1">&#39;_billing_cf&#39;</span><span class="p">];</span> </span><span id="L-4"><a name="L-4"></a><span class="k">echo</span><span class="p">(</span><span class="nb">strtoupper</span><span class="p">(</span><span class="nv">$billing_cfs</span><span class="p">[</span><span class="mi">0</span><span class="p">]));</span> </span><span id="L-5"><a name="L-5"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
cf, codice, delivery, fiscale, invoice, iva, note, parita, woocommerce, wordpress, wp
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.