예제 #1
0
파일: sm38.php 프로젝트: bulats/chef
function get_packing_slip($purchase_ids, $purchase_id_arr)
{
    global $purchlogitem;
    if (!empty($purchase_ids) && !empty($purchase_id_arr)) {
        ?>
                    <style type="text/css">
                            body {
                                    font-family:"Helvetica Neue", Helvetica, Arial, Verdana, sans-serif;
                            }

                            h1 span {
                                    font-size:0.75em;
                            }

                            h2 {
                                    color: #333;
                            }

                            #wrapper {
                                    margin:0 auto;
                                    width:95%;
                                    page-break-after: always;
                            }

                            #header {
                            }

                            #customer {
                                    overflow:hidden;
                            }

                            #customer .shipping, #customer .billing {
                                    float: left;
                                    width: 50%;
                            }

                            table {
                                    border:1px solid #000;
                                    border-collapse:collapse;
                                    margin-top:1em;
                                    width:100%;
                            }

                            th {
                                    background-color:#efefef;
                                    text-align:center;
                            }

                            th, td {
                                    padding:5px;
                            }

                            td {
                                    text-align:center;
                            }

                            #cart-items td.amount {
                                    text-align:right;
                            }

                            td, tbody th {
                                    border-top:1px solid #ccc;
                            }
                            th.column-total {
                                    width:90px;
                            }
                            th.column-shipping {
                                    width:120px;
                            }
                            th.column-price {
                                    width:100px;
                            }
                    </style>
                <?php 
        if (!class_exists('wpsc_purchaselogs_items')) {
            require_once WP_PLUGIN_DIR . '/wp-e-commerce/wpsc-includes/purchaselogs.class.php';
        }
        foreach ($purchase_id_arr as $purchase_id_value) {
            $purchlogitem = new wpsc_purchaselogs_items((int) $purchase_id_value);
            ?>
                        <div id="wrapper">
                              <?php 
            echo smart_manager_print_logo();
            ?>
                            <div id="header" style="margin-top:-0.8em;">
                                    <h1>
                                        
                                            <?php 
            echo get_bloginfo('name');
            ?>
<br />
                                            <span><?php 
            printf(esc_html__('Packing Slip for Order #%s', 'wpsc'), $purchase_id_value);
            ?>
</span>
                                    </h1>
                            </div>
                            <div id="customer">
                                    <div class="shipping">
                                            <h2><?php 
            echo esc_html_x('Ship To:', 'packing slip', 'wpsc');
            ?>
</h2>
                                            <strong><?php 
            echo wpsc_display_purchlog_shipping_name();
            ?>
</strong><br />
                                            <?php 
            echo wpsc_display_purchlog_shipping_address();
            ?>
<br />
                                            <?php 
            echo wpsc_display_purchlog_shipping_city();
            ?>
<br />
                                            <?php 
            echo wpsc_display_purchlog_shipping_state_and_postcode();
            ?>
<br />
                                            <?php 
            echo wpsc_display_purchlog_shipping_country();
            ?>
<br />
                                    </div>
                                    <div class="billing">
                                            <h2><?php 
            echo esc_html_x('Bill To:', 'packing slip', 'wpsc');
            ?>
</h2>
                                            <strong><?php 
            echo wpsc_display_purchlog_buyers_name();
            ?>
</strong><br />
                                            <?php 
            echo wpsc_display_purchlog_buyers_address();
            ?>
<br />
                                            <?php 
            echo wpsc_display_purchlog_buyers_city();
            ?>
<br />
                                            <?php 
            echo wpsc_display_purchlog_buyers_state_and_postcode();
            ?>
<br />
                                            <?php 
            echo wpsc_display_purchlog_buyers_country();
            ?>
<br />
                                    </div>
                            </div>
                            <table id="order">
                                    <thead>
                                            <tr>
                                                    <th><?php 
            echo esc_html_x('Order Date', 'packing slip', 'wpsc');
            ?>
</th>
                                                    <th><?php 
            echo esc_html_x('Order ID', 'packing slip', 'wpsc');
            ?>
</th>
                                                    <th><?php 
            echo esc_html_x('Shipping Method', 'packing slip', 'wpsc');
            ?>
</th>
                                                    <th><?php 
            echo esc_html_x('Payment Method', 'packing slip', 'wpsc');
            ?>
</th>
                                            </tr>
                                    </thead>
                                    <tbody>
                                            <tr>
                                                    <td><?php 
            echo wpsc_purchaselog_details_date();
            ?>
</td>
                                                    <td><?php 
            echo wpsc_purchaselog_details_purchnumber();
            ?>
</td>
                                                    <td><?php 
            echo wpsc_display_purchlog_shipping_method();
            ?>
</td>
                                                    <td><?php 
            echo wpsc_display_purchlog_paymentmethod();
            ?>
</td>
                                            </tr>
                                    </tbody>
                            </table>
                            <table id="cart-items" class="widefat" cellspacing="0">
                                    <thead>
                                            <tr>
                                                    <th scope='col' id='title' class='manage-column column-title'  style=""><?php 
            _e('Item Name', 'wpsc');
            ?>
</th>
                                                    <th scope='col' id='sku' class='manage-column column-sku'  style=""><?php 
            _e('SKU', 'wpsc');
            ?>
</th>
                                                    <th scope='col' id='quantity' class='manage-column column-quantity'  style=""><?php 
            _e('Quantity', 'wpsc');
            ?>
</th>
                                                    <th scope='col' id='price' class='manage-column column-price'  style=""><?php 
            _e('Price', 'wpsc');
            ?>
</th>
                                                    <th scope='col' id='shipping' class='manage-column column-shipping'  style=""><?php 
            _e('Item Shipping', 'wpsc');
            ?>
</th>
                                                    <th scope='col' id='tax' class='manage-column column-tax'  style=""><?php 
            _e('Item Tax', 'wpsc');
            ?>
</th>
                                                    <th scope='col' id='total' class='manage-column column-total'  style=""><?php 
            _e('Item Total', 'wpsc');
            ?>
</th>

                                                    <?php 
            $cols = 5;
            // this is counted as ( count of th - 2 )
            ?>
                                            </tr>
                                    </thead>

                                    <tbody>
                                            <?php 
            while (wpsc_have_purchaselog_details()) {
                wpsc_the_purchaselog_item();
                ?>
                                                  <tr>
                                                     <td><?php 
                echo wpsc_purchaselog_details_name();
                ?>
</td> <!-- NAME! -->
                                                     <td><?php 
                echo wpsc_purchaselog_details_SKU();
                ?>
</td> <!-- SKU! -->
                                                     <td><?php 
                echo wpsc_purchaselog_details_quantity();
                ?>
</td> <!-- QUANTITY! -->
                                                     <td>
                                                        <?php 
                echo wpsc_currency_display(wpsc_purchaselog_details_price());
                do_action('wpsc_additional_sales_amount_info', wpsc_purchaselog_details_id());
                ?>
                                                     </td> <!-- PRICE! -->
                                                     <td><?php 
                echo wpsc_currency_display(wpsc_purchaselog_details_shipping());
                ?>
</td> <!-- SHIPPING! -->
                                                     <?php 
                if (wpec_display_product_tax()) {
                    ?>
                                                        <td><?php 
                    echo wpsc_currency_display(wpsc_purchaselog_details_tax());
                    ?>
</td> <!-- TAX! -->
                                                     <?php 
                }
                ?>
                                                     <!-- <td><?php 
                echo wpsc_currency_display(wpsc_purchaselog_details_discount());
                ?>
</td> --> <!-- DISCOUNT! -->
                                                     <td class="amount"><?php 
                echo wpsc_currency_display(wpsc_purchaselog_details_total());
                ?>
</td> <!-- TOTAL! -->
                                                  </tr>
                                                  <?php 
            }
            ?>

                                            <tr class="wpsc_purchaselog_start_totals">
                                                    <td colspan="<?php 
            echo $cols;
            ?>
">
                                                            <?php 
            if (wpsc_purchlog_has_discount_data()) {
                ?>
                                                                    <?php 
                esc_html_e('Coupon Code', 'wpsc');
                ?>
: <?php 
                echo wpsc_display_purchlog_discount_data();
                ?>
                                                            <?php 
            }
            ?>
                                                    </td>
                                                    <th><?php 
            esc_html_e('Discount', 'wpsc');
            ?>
 </th>
                                                    <td class="amount"><?php 
            echo wpsc_display_purchlog_discount();
            ?>
</td>
                                            </tr>

                                            <?php 
            if (!wpec_display_product_tax()) {
                ?>
                                                    <tr>
                                                            <td colspan='<?php 
                echo $cols;
                ?>
'></td>
                                                            <th><?php 
                esc_html_e('Taxes', 'wpsc');
                ?>
 </th>
                                                            <td class="amount"><?php 
                echo wpsc_display_purchlog_taxes();
                ?>
</td>
                                                    </tr>
                                            <?php 
            }
            ?>

                                            <tr>
                                                    <td colspan='<?php 
            echo $cols;
            ?>
'></td>
                                                    <th><?php 
            esc_html_e('Shipping', 'wpsc');
            ?>
 </th>
                                                    <td class="amount"><?php 
            echo wpsc_display_purchlog_shipping();
            ?>
</td>
                                            </tr>
                                            <tr>
                                                    <td colspan='<?php 
            echo $cols;
            ?>
'></td>
                                                    <th><?php 
            esc_html_e('Total', 'wpsc');
            ?>
 </th>
                                                    <td class="amount"><?php 
            echo wpsc_display_purchlog_totalprice();
            ?>
</td>
                                            </tr>
                                    </tbody>
                            </table>
                        </div>

                    <?php 
        }
        exit;
    }
}
예제 #2
0
    private function purchase_log_cart_items()
    {
        while (wpsc_have_purchaselog_details()) {
            wpsc_the_purchaselog_item();
            ?>
      <tr>
         <td><?php 
            echo wpsc_purchaselog_details_name();
            ?>
</td> <!-- NAME! -->
         <td><?php 
            echo wpsc_purchaselog_details_SKU();
            ?>
</td> <!-- SKU! -->
         <td><?php 
            echo wpsc_purchaselog_details_quantity();
            ?>
</td> <!-- QUANTITY! -->
         <td>
	    <?php 
            echo wpsc_currency_display(wpsc_purchaselog_details_price());
            do_action('wpsc_additional_sales_amount_info', wpsc_purchaselog_details_id());
            ?>
	 </td> <!-- PRICE! -->
         <td><?php 
            echo wpsc_currency_display(wpsc_purchaselog_details_shipping());
            ?>
</td> <!-- SHIPPING! -->
         <?php 
            if (wpec_display_product_tax()) {
                ?>
            <td><?php 
                echo wpsc_currency_display(wpsc_purchaselog_details_tax());
                ?>
</td> <!-- TAX! -->
         <?php 
            }
            ?>
         <!-- <td><?php 
            echo wpsc_currency_display(wpsc_purchaselog_details_discount());
            ?>
</td> --> <!-- DISCOUNT! -->
         <td class="amount"><?php 
            echo wpsc_currency_display(wpsc_purchaselog_details_total());
            ?>
</td> <!-- TOTAL! -->
      </tr>
      <?php 
        }
    }
function get_purchaselogs_content()
{
    while (wpsc_have_purch_items()) {
        wpsc_the_purch_item();
        ?>
   <tr>
      <th class="check-column" scope="row"><input type='checkbox' name='purchlogids[]' class='editcheckbox' value='<?php 
        echo wpsc_the_purch_item_id();
        ?>
' /></th>
      <td><?php 
        echo wpsc_the_purch_item_id();
        ?>
</td><!-- purchase ID -->
      <td><?php 
        echo wpsc_the_purch_item_date();
        ?>
</td> <!--Date -->
      <td><?php 
        echo wpsc_the_purch_item_name();
        ?>
</td> <!--Name/email -->
      <td>
	<?php 
        echo wpsc_currency_display(wpsc_the_purch_item_price());
        do_action('wpsc_additional_sales_amount_info', wpsc_purchaselog_details_id());
        ?>
      </td><!-- Amount -->
      <td><a href='<?php 
        echo htmlentities(add_query_arg('purchaselog_id', wpsc_the_purch_item_id()), ENT_QUOTES, 'UTF-8');
        ?>
'><?php 
        $number_of_items = wpsc_the_purch_item_details();
        printf(_n('%s Item', '%s Items', $number_of_items, 'wpsc'), $number_of_items);
        ?>
</a></td><!-- Details -->
      <td>
      <?php 
        if (!wpsc_purchlogs_is_google_checkout()) {
            ?>
		 <img src="<?php 
            echo admin_url('images/wpspin_light.gif');
            ?>
" class="ajax-loading" alt="" style="position:relative; top:3px;" />
         <select class='selector' name='<?php 
            echo wpsc_the_purch_item_id();
            ?>
' title='<?php 
            echo wpsc_the_purch_item_id();
            ?>
' >
         <?php 
            while (wpsc_have_purch_items_statuses()) {
                wpsc_the_purch_status();
                ?>
            <option value='<?php 
                echo wpsc_the_purch_status_id();
                ?>
' <?php 
                echo wpsc_is_checked_status();
                ?>
 ><?php 
                echo wpsc_the_purch_status_name();
                ?>
 </option>
         <?php 
            }
            ?>
         </select>
      <?php 
        } else {
            ?>
         <a href='http://checkout.google.com/' rel=''><img class='google_checkout_logo' src='<?php 
            echo WPSC_CORE_IMAGES_URL . "/checkout_logo.jpg";
            ?>
' alt='google checkout' /></a>
      <?php 
        }
        ?>
      </td><!-- Status -->
      <td><a class='submitdelete' title='<?php 
        echo esc_attr(__('Delete this log', 'wpsc'));
        ?>
' href='<?php 
        echo wp_nonce_url("admin.php?wpsc_admin_action=delete_purchlog&amp;purchlog_id=" . wpsc_the_purch_item_id(), 'delete_purchlog_' . wpsc_the_purch_item_id());
        ?>
' onclick="if ( confirm(' <?php 
        echo esc_js(sprintf(__("You are about to delete this log '%s'\n 'Cancel' to stop, 'OK' to delete.", 'wpsc'), wpsc_the_purch_item_date()));
        ?>
') ) { return true;}return false;"><img class='wpsc_pushdown_img' src='<?php 
        echo WPSC_CORE_IMAGES_URL . "/cross.png";
        ?>
' alt='delete icon' /></a></td><!-- Delete -->
      <td>
         <a class='wpsc_show_trackingid' title='<?php 
        echo wpsc_the_purch_item_id();
        ?>
' href=''><?php 
        echo wpsc_display_tracking_id();
        ?>
</a>
      </td>
   </tr>
   <tr class='log<?php 
        echo wpsc_the_purch_item_id();
        ?>
 wpsc_trackingid_row'>
      <td class='wpsc_trackingid_row' colspan='2'>

         <label for='wpsc_trackingid<?php 
        echo wpsc_the_purch_item_id();
        ?>
'><?php 
        _e('Tracking ID', 'wpsc');
        ?>
 :</label>
      </td>
      <td class='wpsc_trackingid_row' colspan='2'>
         <input type='text' name='wpsc_trackingid<?php 
        echo wpsc_the_purch_item_id();
        ?>
' value='<?php 
        echo wpsc_trackingid_value();
        ?>
' size='20' />
         <input type='submit' name='submit' class='button' value='Add Tracking ID' />
      </td>
      <td colspan='4'>
         <img src="<?php 
        echo admin_url('images/wpspin_light.gif');
        ?>
" class="ajax-loading" alt="" style="position:relative; top:3px;" />
         <a href='' title='<?php 
        echo wpsc_the_purch_item_id();
        ?>
' class='sendTrackingEmail'><?php 
        _e('Send Custom Message', 'wpsc');
        ?>
</a>
      </td>
   </tr>

   <?php 
    }
}