Support » Plugin: WP eCommerce » How do add additional checkout fields to packing slip?

Viewing 2 replies - 1 through 2 (of 2 total)
  • gmarsh

    (@gmarsh)

    You will need to edit
    wp-content/plugins/wp-e-commerce/wpsc-admin/includes/purchase-logs-page/packing-slip.php

    The following code should do it.

    $purchlogitem = new wpsc_purchaselogs_items( $this->log_id );
          if ( ! empty($purchlogitem->additional_fields ) ) {
    		  foreach( (array) $purchlogitem->additional_fields as $value ) {
    			 $value['value'] = maybe_unserialize ($value['value'] );
    			 if( is_array( $value['value'] ) ) {
    			 ?>
    				<p><strong><?php echo $value['name']; ?>:</strong><br /> <?php echo nl2br(implode( stripslashes( $value['value'] ), ',' )); ?></p>
    			 <?php
    			 }else{
    			 ?>
    				<p><strong><?php echo $value['name']; ?>:</strong><br /> <?php echo nl2br(stripslashes( $value['value'] )); ?></p>
    			 <?php
    			 }
    		  }
          }

    You may need to tweak it a bit. I added the line breaks and nl2br function because it fit my needs.

    gmarsh

    (@gmarsh)

    Also, remember that if you edit that core WP E-Commerce file, it will get wiped out whenever you do an update, so keep a backup.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do add additional checkout fields to packing slip?’ is closed to new replies.