Nitrat
Forum Replies Created
-
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] Exec Custom fieldWow, this code works:
<?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) { foreach( $items as $item ) { if (isset($item['item']['item_meta']['Срок страхования, мес.'])) { $srok = $item['item']['item_meta']['Срок страхования, мес.'][0];} echo $srok; $invoice_date = get_post_meta($wpo_wcpdf->export->order->id,'_wcpdf_invoice_date',true); if ( $srok == '3') { $final = date_i18n( get_option( 'date_format' ), strtotime( $billing_ot . ' + 3 months -1 day') );} if ( $srok == '6') { $final = date_i18n( get_option( 'date_format' ), strtotime( $billing_ot . ' + 6 months -1 day') );} if ( $srok == '9') { $final = date_i18n( get_option( 'date_format' ), strtotime( $billing_ot . ' + 9 months -1 day') );} } } ?>Last question. How to format 01-04-2016 to 01.04.2016 in pdf invoice?
And how to format 01.04.2016 to 01-04-2016 in pdf invoice?Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] Exec Custom fieldThis code works:
<?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) { foreach( $items as $item ) { if (isset($item['item']['item_meta']['Срок страхования, мес.'])) { $srok = $item['item']['item_meta']['Срок страхования, мес.'][0];} echo $srok; if ( $srok == '3') { $final = date("d.m.Y", strtotime("+3 month -1 day", $billing_ot) );} if ( $srok == '6') { $final = date("d.m.Y", strtotime("+6 month -1 day", $billing_ot) );} } }?>But date set as: 31-03-2016 to 31.03.1970
Why the year 1970, and not 2016?Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] Exec Custom field$billing_ot loaded earlier (just the code not shown):
$billing_ot = get_post_meta($wpo_wcpdf->export->order->id,'_billing_field_474',true);The code below shows the value of $srok but how to use it in logical operations:
<?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) { foreach( $items as $item ) { if (isset($item['item']['item_meta']['Сумма страхования'])) { echo $item['item']['item_meta']['Сумма страхования'][0] . ' ₽'; } if (isset($item['item']['item_meta']['Name'])) { echo 'Name: ' . $item['item']['item_meta']['Name'][0] . '<br />'; } } }?>Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] Exec Custom fieldBut how to get the value of the srok (the number of months)? The code below don’t work
<?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) { foreach( $items as $item ) { $srok = $item['item']['item_meta']['Срок страхования, мес.']; if ( $srok == '12') { $final = date("d.m.Y", strtotime("+12 month -1 day", $billing_ot) );} } } ?>Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] Exec Custom fieldI found a solution whit code:
<?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) { foreach( $items as $item ) { if (isset($item['item']['item_meta']['Сумма страхования'])) { echo $item['item']['item_meta']['Сумма страхования'][0] . '<br />'; } if (isset($item['item']['item_meta']['Name'])) { echo 'Name: ' . $item['item']['item_meta']['Name'][0] . '<br />'; } } } ?>Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] Exec Custom fieldIn order items post meta this field looks like
» Сумма страхованияHow to extract in pdf invoice this field?
This code extract all fields – <?php echo $item[‘meta’];?>
But i need the oneWhen will it be feasible?
Forum: Plugins
In reply to: [MoExRate] ОшибкаЯ уже давно воспользовался другим кодом.
Forum: Plugins
In reply to: [Caldera Forms - More Than Contact Forms] VariableI create post with ID=194
How to pass the value of this post (for example, 1230) in the formula for calculating?Forum: Reviews
In reply to: [AnsPress - Question and answer] notification sidebarThis is the best of the free plugin!
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] http://ecocard.su/map/list/OK!)
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] http://ecocard.su/map/list/Thanks for the prompt help!
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] http://ecocard.su/map/list/Oh, I see
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] http://ecocard.su/map/list/How to do it?