WordPress.org

Ready to get started?Download WordPress

Forums

WP eCommerce
How do add additional checkout fields to packing slip? (3 posts)

  1. digitalisfun
    Member
    Posted 1 year ago #

    Hi

    Does anyone know how I could add additional checkout fields to the packing slip? e.g. I have a company field in the checkout and need to display this on the packing slip but am not sure how to do this.

    Thanks,

    Greg.

    http://wordpress.org/extend/plugins/wp-e-commerce/

  2. gmarsh
    Member
    Posted 1 year ago #

    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.

  3. gmarsh
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic