• Resolved admt2018

    (@admt2018)


    Hi, is it possible show column data as Product name, Price and total in rows and not in column order?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hello @admt2018,

    Could you tell me the use case for this?

    Thread Starter admt2018

    (@admt2018)

    I would like to display the unit price, the quantity and the subtotal in rows below the cell of the image produced as a matter of visualization as now the data is shown overlaid and therefore is illegible.
    you can see what I mean from this picture: attachment jpg

    The code of my custom tamplate that set quantity, unit price and subtotal is:
    —–start code——

    <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
    <?php do_action( 'wpo_wcpdf_before_document', $this->get_type(), $this->order ); ?>
    <table class="head container">
    	<tr>
    		<td class="header">
    		<?php
    		if( $this->has_header_logo() ) {
    			$this->header_logo();
    		} else {
    			echo $this->get_title();
    		}
    		?>
    		</td>
    		<td class="shop-info">
    			<?php do_action( 'wpo_wcpdf_before_shop_name', $this->type, $this->order ); ?>
    			<div class="shop-name"><h3><?php $this->shop_name(); ?></h3></div>
    			<?php do_action( 'wpo_wcpdf_after_shop_name', $this->type, $this->order ); ?>
    			<?php do_action( 'wpo_wcpdf_before_shop_address', $this->type, $this->order ); ?>
    			<div class="shop-address"><?php $this->shop_address(); ?></div>
    			<?php do_action( 'wpo_wcpdf_after_shop_address', $this->type, $this->order ); ?>
    		</td>
    	</tr>
    </table>
    
    <h1 class="document-type-label">
    Richiesta preventivo
    </h1>
    <?php do_action( 'wpo_wcpdf_before_order_data', $this->get_type(), $this->order ); ?>
    <p><?php _e( 'Preventivo:', 'woocommerce-pdf-invoices-packing-slips' ); ?> <?php $this->order_number(); ?> </br> <?php _e( 'Data:', 'woocommerce-pdf-invoices-packing-slips' ); ?> <?php $this->order_date(); ?></p>
    <?php do_action( 'wpo_wcpdf_after_order_data', $this->get_type(), $this->order ); ?>
    <p><span style="font-weight:600; padding-bottom:10px;">Dati cliente</span></p>
    
    <table class="order-data-addresses" style="300px;">
    	<tr>
    		<td class="address billing-address">
    			<!-- <h3><?php _e( 'Billing Address:', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3> -->
    			<?php do_action( 'wpo_wcpdf_before_billing_address', $this->type, $this->order ); ?>
    			<?php $this->billing_address(); ?>
    			<?php do_action( 'wpo_wcpdf_after_billing_address', $this->type, $this->order ); ?>
    			<?php if ( isset($this->settings['display_email']) ) { ?>
    			<div class="billing-email"><?php $this->billing_email(); ?></div>
    			<?php } ?>
    			<?php if ( isset($this->settings['display_phone']) ) { ?>
    			<div class="billing-phone"><?php $this->billing_phone(); ?></div>
    			<?php } ?>
    		</td>
    		<td class="azienda">
    		<div></div>
    		
    			<div></div>
    			<div></div>
    			<div></div>
    			<div></div>
    			<div></div>
    			<div></div>
    			<div></div>
    
    		</td>
    			<td class="azienda">
    		<div></div>
    		
    			<div></div>
    			<div></div>
    			<div></div>
    			<div></div>
    			<div></div>
    			<div></div>
    			<div></div>
    
    		</td>
    		<td class="azienda">
    		<div><span style="font-weight:600; padding-bottom:10px;">Caratteristiche Azienda</span></div>
    		<hr>
    			<div><span style="font-weight:600;">Tipo di coltura:</span> <?php $this->custom_field('billing_coltura', ''); ?></div>
    			<div><span style="font-weight:600;">Dimensioni in ettari:</span> <?php $this->custom_field('billing_dimensioni', ''); ?></div>
    			<div><span style="font-weight:600;">Coltivazione:</span> <?php $this->custom_field('billing_coltivazione', ''); ?></div>
    			<div><span style="font-weight:600;">Minima pressione di lavoro:</span> <?php $this->custom_field('billing_pres', ''); ?> BAR</div>
    			<div><span style="font-weight:600;">Massima pressione di lavoro:</span> <?php $this->custom_field('billing_maxpres', ''); ?> BAR</div>
    			<div><span style="font-weight:600;">Minima portata di lavoro:</span> <?php $this->custom_field('billing_minport', ''); ?> M<sup>3</sup>/h</div>
    			<div><span style="font-weight:600;">Massima portata di lavoro:</span> <?php $this->custom_field('billing_maxport', ''); ?> M<sup>3</sup>/h</div>
    			<div><span style="font-weight:600;">Numero di valvole da comandare:</span> <?php $this->custom_field('billing_maxvalv', ''); ?> </div>
    <div>
    		</td>
    		
    	</tr>
    </table>
    
    <?php do_action( 'wpo_wcpdf_before_order_details', $this->get_type(), $this->order ); ?>
    
    <table class="order-details">
    	
    	<tbody>
    		<?php
    		$tbody = wpo_wcpdf_templates_get_table_body( $this );
    		if( sizeof( $tbody ) > 0 ) {
    			foreach( $tbody as $item_id => $item_columns ) {
    				do_action( 'wpo_wcpdf_templates_before_order_details_row', $this, $item_id, $item_columns );
    				$row_class = apply_filters( 'wpo_wcpdf_item_row_class', $item_id, $this->get_type(), $this->order, $item_id );
    				printf('<tr class="%s">', $row_class);
    				foreach ($item_columns as $column_key => $column_data) {
    					printf('<td class="%s"><span>%s</span></td>', $column_data['class'], $column_data['data']);
    				}
    				echo '</tr>';
    				do_action( 'wpo_wcpdf_templates_after_order_details_row', $this, $item_id, $item_columns );
    			}
    		}
    		?>
    	
    	</tbody>
    </table>
    <table><tbody><tr>Test</tr></tbody></table>
    
    <table class="notes-totals">
    	<tbody>
    		<tr class="no-borders">
    			<td class="no-borders" style="width:60%">
    				<?php do_action( 'wpo_wcpdf_before_document_notes', $this->get_type(), $this->order ); ?>
    				<div class="document-notes">
    					<?php if ( is_callable( array($this, 'get_document_notes') ) && $this->get_document_notes() ) : ?>
    						<h3><?php _e( 'Notes', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3>
    						<?php $this->document_notes(); ?>
    					<?php endif; ?>
    				</div>
    				<?php do_action( 'wpo_wcpdf_after_document_notes', $this->get_type(), $this->order ); ?>
    				<?php do_action( 'wpo_wcpdf_before_customer_notes', $this->get_type(), $this->order ); ?>
    				<div class="customer-notes">
    					<?php if ( $this->get_shipping_notes() ) : ?>
    						<h3><?php _e( 'Customer Notes', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3>
    						<?php $this->shipping_notes(); ?>
    					<?php endif; ?>
    				</div>				
    				<?php do_action( 'wpo_wcpdf_after_customer_notes', $this->get_type(), $this->order ); ?>
    			</td>
    			<td class="no-borders totals-cell" style="width:40%">
    				<table class="totals">
    					<tfoot>
    						<?php
    						$totals = wpo_wcpdf_templates_get_totals( $this );
    						if( sizeof( $totals ) > 0 ) {
    							foreach( $totals as $total_key => $total_data ) {
    								?>
    								<tr class="<?php echo $total_data['class']; ?>">
    									<th class="description"><span><?php echo $total_data['label']; ?></span></th>
    									<td class="price"><span class="totals-price"><?php echo $total_data['value']; ?></span></td>
    								</tr>
    								<?php
    							}
    						}
    						?>
    					</tfoot>
    				</table>
    			</td>
    		</tr>
    	</tbody>
    </table>
    
    <?php do_action( 'wpo_wcpdf_after_order_details', $this->get_type(), $this->order ); ?>
    
    <?php if ( $this->get_footer() ): ?>
    <div id="footer">
    	<?php $this->footer(); ?>
    </div><!-- #letter-footer -->
    <?php endif; ?>
    <?php do_action( 'wpo_wcpdf_after_document', $this->get_type(), $this->order ); ?>
    Thread Starter admt2018

    (@admt2018)

    A solution is also needed that shows the data of the columns immediately under each individual order, not necessarily under the image as per the attached example

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! I see that you’re using the Premium Templates extension. WordPress doesn’t allow us to use these forums for supporting our paid extensions, but if you send us an email at support@wpovernight we’ll do our best to help (make sure to include your license key to expedite the process). Thanks!

    Thread Starter admt2018

    (@admt2018)

    Hi Ewout, thanks for your availability. I wrote to you yesterday, but I still haven’t received an answer.
    I await your news, thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Column data order in row’ is closed to new replies.