Advertisement
Guest User

wpsc_checkout_page

a guest
Apr 25th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 24.46 KB | None | 0 0
  1. <?php
  2. global $wpsc_cart, $wpdb, $wpsc_checkout, $wpsc_gateway, $wpsc_coupons, $wpsc_registration_error_messages, $wpsc_checkout_error_messages;
  3. $wpsc_checkout = new wpsc_checkout();
  4. $wpsc_gateway = new wpsc_gateways();
  5. $alt = 0;
  6. $coupon_num = wpsc_get_customer_meta( 'coupon' );
  7. if( $coupon_num )
  8.    $wpsc_coupons = new wpsc_coupons( $coupon_num );
  9.  
  10. if(wpsc_cart_item_count() < 1) :
  11.    echo 'There is nothing in your cart.';
  12.    return;
  13. endif; 
  14.  
  15. function cdl_get_cat($cdl_post_id) {
  16.     global $wp_query, $wpsc_query;
  17.     $query_data = Array();
  18.  
  19.     $categories = wp_get_object_terms( $cdl_post_id , 'wpsc_product_category' );
  20.  
  21.     $count = count($categories);
  22.  
  23.     for ($i = 0; $i < ($count); $i++) {
  24.         $query_data['category'] = $categories[$i]->name;
  25.         echo $query_data['category'];
  26.         if ($i < ($count - 1))
  27.             echo ", ";
  28.     }
  29.  
  30. }
  31. ?>
  32.  
  33. <div id="checkout_page_container">
  34.  
  35.     <h3>1. Review Basket</h3>
  36.  
  37.     <table class="basket">
  38.         <!--<thead>
  39.             <tr>
  40.             <td>
  41.                 Product
  42.             </td>
  43.             <td>
  44.                 Quantity
  45.             </td>
  46.             <td>
  47.                 Price
  48.             </td>
  49.             </tr>
  50.         </thead>-->
  51.        
  52.         <?php while (wpsc_have_cart_items()) : wpsc_the_cart_item(); ?>
  53.  
  54.             <?php do_action ( "wpsc_before_checkout_cart_row" ); ?>
  55.                 <tr class="basket-item">
  56.                     <td>
  57.                         <a href="<?php echo esc_url( wpsc_cart_item_url() ); ?>">
  58.                             <div class="product" >
  59.          
  60.                                 <?php if('' != wpsc_cart_item_image()): ?>
  61.                                     <?php do_action ( "wpsc_before_checkout_cart_item_image" ); ?>
  62.                                     <img src="<?php echo wpsc_cart_item_image(200,200); ?>" alt="<?php echo wpsc_cart_item_name(); ?>" title="<?php echo wpsc_cart_item_name(); ?>" class="product_image" />
  63.                                     <?php do_action ( "wpsc_after_checkout_cart_item_image" ); ?>
  64.                                 <?php endif; ?>
  65.                    
  66.                    
  67.                                 <?php do_action ( "wpsc_before_checkout_cart_item_name" ); ?>
  68.                                     <p><?php echo wpsc_cart_item_name(); ?></p>
  69.                                 <?php do_action ( "wpsc_after_checkout_cart_item_name" ); ?>
  70.    
  71.                             </div>
  72.                         </a>
  73.                     </td>
  74.    
  75.                     <td>
  76.                         <h5>Mimesis</h5>
  77.                         <h4><?php echo wpsc_cart_item_name(); ?></h4>
  78.                         Quantity:
  79.                         <form action="<?php echo esc_url( get_option( 'shopping_cart_url' ) ); if ($_GET['checkout']){ echo "?checkout=1";} ?>" method="post" class="adjustform qty">
  80.                             <p><input type="text" name="quantity" size="2" value="<?php echo wpsc_cart_item_quantity(); ?>" /></p>
  81.                             <input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>" />
  82.                             <input type="hidden" name="wpsc_update_quantity" value="true" />
  83.                             <input type="submit" class="button" value="<?php _e('UPDATE', 'wpsc'); ?>" name="submit" />
  84.                         </form>
  85.    
  86.    
  87.                         <form action="<?php echo esc_url( get_option( 'shopping_cart_url' ) ); if ($_GET['checkout']){ echo "?checkout=1";} ?>" method="post" class="adjustform remove">
  88.                             <input type="hidden" name="quantity" value="0" />
  89.                             <input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>" />
  90.                             <input type="hidden" name="wpsc_update_quantity" value="true" />
  91.                             <input type="submit" class="button" value="<?php _e('REMOVE', 'wpsc'); ?>" name="submit" />
  92.                         </form>
  93.                     </td>
  94.                     <td>
  95.                         <p><?php echo wpsc_cart_single_item_price(); ?></p>
  96.                     </td>
  97.                    
  98.                 </tr>
  99.                
  100.             <?php do_action ( "wpsc_after_checkout_cart_row" ); ?>
  101.  
  102.         <?php endwhile; ?>
  103.         <tr class="subtotal">
  104.             <td>
  105.                 <div style="position: absolute;margin-top: -20px;" >
  106.                     <a class="button" href="http://camography.org/gallery/">CONTINUE SHOPPING</a>
  107.                     <a class="button" target='_parent' href='<?php echo htmlentities(add_query_arg('wpsc_ajax_action', 'empty_cart', remove_query_arg('ajax')),
  108.                     ENT_QUOTES); ?>'><?php echo __('EMPTY CART', 'wpsc'); ?></a>
  109.                     <p class="button red revealme" id="reveal-checkout">CHECK OUT &rarr;</p>
  110.                 </div>
  111.             </td>
  112.             <td>
  113.                 Sub Total:
  114.             </td>
  115.             <td>
  116.                 <?php echo wpsc_cart_total_widget(false, false, false); ?>
  117.             </td>
  118.         </tr>
  119.     </table>
  120.     <?php  
  121.     $open = false;
  122.    
  123.     if ($_GET['checkout']) $open = true;
  124.     if ( !empty($wpsc_checkout_error_messages) ) $open = true; ?>
  125.     <div id="reveal-me" <?php if($open): ?> class="stayopen" <?php endif;?>>
  126.         <table class="basket" id="shipping-calc">
  127.             <tr>
  128.                 <td style="/*color:#E0325D;*/">
  129.                     <h3>2. Calculate Shipping              
  130.                         <form name='change_country' id='change_country' action='<?php echo esc_url( get_option( 'shopping_cart_url' ) ); ?>?checkout=1' value="GB" method='post'>
  131.                             <?php echo wpsc_shipping_country_list();?>
  132.                             <input type='hidden' name='wpsc_update_location' value='true' />
  133.                             <input type='submit' name='wpsc_submit_zipcode' value='<?php esc_attr_e( 'Calculate', 'wpsc' ); ?>' />
  134.                         </form>
  135.                     </h3>
  136.                 </td>
  137.                 <td>
  138.  
  139.                     <?php _e('Shipping:', 'wpsc'); ?></td>
  140.                 <td>
  141.                     <?php echo wpsc_cart_shipping(); ?>
  142.                 </td>
  143.             </tr>
  144.             <tr>
  145.                 <td style="margin-top:20px">
  146.                     Shipping as follows:
  147.                 </td>
  148.                 <td>
  149.                     Sub total:
  150.                 </td>
  151.                 <td>
  152.                     <?php echo wpsc_cart_total_widget(true, false, false); ?>
  153.                 </td>
  154.             </tr>
  155.             <tr>
  156.                 <td>
  157.                     &pound;3.50 (UK), &pound;6.50 (EU),<br />
  158.                     &pound;9.50 (rest of world).<br />
  159.                     Shipping is per item.
  160.                 </td>
  161.                 <td style="font-weight: bold;">
  162.                     <?php _e('Total Price:', 'wpsc'); ?>
  163.                 </td>
  164.                 <td style="font-weight: bold;">
  165.                     <?php echo wpsc_cart_total(); ?>
  166.                 </td>
  167.             </tr>
  168.         </table>
  169.  
  170.    
  171.    
  172.    
  173.         <div style="clear:both;"></div>
  174.   <!-- DISABLED SHIPPING CALCULATOR AS IMPLEMENTED CUSTOM FLAT RATE ONE -->
  175.     <?php /**
  176.     <?php if(wpsc_uses_shipping()): ?>
  177.         <p class="wpsc_cost_before"></p>
  178.     <?php endif; ?>
  179.     <?php  //this HTML dispalys the calculate your order HTML   ?>
  180.  
  181.     <?php if(wpsc_has_category_and_country_conflict()): ?>
  182.         <p class='validation-error'><?php echo esc_html( wpsc_get_customer_meta( 'category_shipping_conflict' ) ); ?></p>
  183.     <?php endif; ?>
  184.  
  185.     <?php if(isset($_SESSION['WpscGatewayErrorMessage']) && $_SESSION['WpscGatewayErrorMessage'] != '') :?>
  186.         <p class="validation-error"><?php echo $_SESSION['WpscGatewayErrorMessage']; ?></p>
  187.     <?php
  188.         endif;
  189.     ?>
  190.  
  191.     <?php do_action('wpsc_before_shipping_of_shopping_cart'); ?>
  192.  
  193.     <div id="wpsc_shopping_cart_container">
  194.         <?php if(wpsc_uses_shipping()) : ?>
  195.             <h2><?php _e('Calculate Shipping Price', 'wpsc'); ?></h2>
  196.             <table class="productcart">
  197.                 <tr class="wpsc_shipping_info">
  198.                     <td colspan="5">
  199.                         <?php _e('Please specify shipping location below to calculate your shipping costs', 'wpsc'); ?>
  200.                     </td>
  201.                 </tr>
  202.  
  203.                 <?php if (!wpsc_have_shipping_quote()) : // No valid shipping quotes ?>
  204.                     <?php if (wpsc_have_valid_shipping_zipcode()) : ?>
  205.                    
  206.                         <tr class='wpsc_update_location'>
  207.                             <td colspan='5' class='shipping_error' >
  208.                                 <?php _e('Please provide a Zipcode and click Calculate in order to continue.', 'wpsc'); ?>
  209.                             </td>
  210.                         </tr>
  211.                        
  212.                     <?php else: ?>
  213.                    
  214.                         <tr class='wpsc_update_location_error'>
  215.                             <td colspan='5' class='shipping_error' >
  216.                                 <?php _e('Sorry, online ordering is unavailable to this destination and/or weight. Please double check your destination details.', 'wpsc'); ?>
  217.                             </td>
  218.                         </tr>
  219.                        
  220.                     <?php endif; ?>
  221.                 <?php endif; ?>
  222.                
  223.                 <tr class='wpsc_change_country'>
  224.                     <td colspan='5'>
  225.                         <form name='change_country' id='change_country' action='' method='post'>
  226.                             <?php echo wpsc_shipping_country_list();?>
  227.                             <input type='hidden' name='wpsc_update_location' value='true' />
  228.                             <input type='submit' name='wpsc_submit_zipcode' value='<?php esc_attr_e( 'Calculate', 'wpsc' ); ?>' />
  229.                         </form>
  230.                     </td>
  231.                 </tr>
  232.  
  233.          <?php if (wpsc_have_morethanone_shipping_quote()) :?>
  234.             <?php while (wpsc_have_shipping_methods()) : wpsc_the_shipping_method(); ?>
  235.                   <?php    if (!wpsc_have_shipping_quotes()) { continue; } // Don't display shipping method if it doesn't have at least one quote ?>
  236.                   <tr class='wpsc_shipping_header'><td class='shipping_header' colspan='5'><?php echo wpsc_shipping_method_name().__(' - Choose a Shipping Rate', 'wpsc'); ?> </td></tr>
  237.                   <?php while (wpsc_have_shipping_quotes()) : wpsc_the_shipping_quote();  ?>
  238.                      <tr class='<?php echo wpsc_shipping_quote_html_id(); ?>'>
  239.                         <td class='wpsc_shipping_quote_name wpsc_shipping_quote_name_<?php echo wpsc_shipping_quote_html_id(); ?>' colspan='3'>
  240.                            <label for='<?php echo wpsc_shipping_quote_html_id(); ?>'><?php echo wpsc_shipping_quote_name(); ?></label>
  241.                         </td>
  242.                         <td class='wpsc_shipping_quote_price wpsc_shipping_quote_price_<?php echo wpsc_shipping_quote_html_id(); ?>' style='text-align:center;'>
  243.                            <label for='<?php echo wpsc_shipping_quote_html_id(); ?>'><?php echo wpsc_shipping_quote_value(); ?></label>
  244.                         </td>
  245.                         <td class='wpsc_shipping_quote_radio wpsc_shipping_quote_radio_<?php echo wpsc_shipping_quote_html_id(); ?>' style='text-align:center;'>
  246.                            <?php if(wpsc_have_morethanone_shipping_methods_and_quotes()): ?>
  247.                               <input type='radio' id='<?php echo wpsc_shipping_quote_html_id(); ?>' <?php echo wpsc_shipping_quote_selected_state(); ?>  onclick='switchmethod("<?php echo wpsc_shipping_quote_name(); ?>", "<?php echo wpsc_shipping_method_internal_name(); ?>")' value='<?php echo wpsc_shipping_quote_value(true); ?>' name='shipping_method' />
  248.                            <?php else: ?>
  249.                               <input <?php echo wpsc_shipping_quote_selected_state(); ?> disabled='disabled' type='radio' id='<?php echo wpsc_shipping_quote_html_id(); ?>'  value='<?php echo wpsc_shipping_quote_value(true); ?>' name='shipping_method' />
  250.                                  <?php wpsc_update_shipping_single_method(); ?>
  251.                            <?php endif; ?>
  252.                         </td>
  253.                      </tr>
  254.                   <?php endwhile; ?>
  255.             <?php endwhile; ?>
  256.          <?php endif; ?>
  257.  
  258.          <?php wpsc_update_shipping_multiple_methods(); ?>
  259.  
  260.  
  261.          <?php if (!wpsc_have_shipping_quote()) : // No valid shipping quotes ?>
  262.                </table>
  263.                </div>
  264.             <?php return; ?>
  265.          <?php endif; ?>
  266.    <?php endif;  ?>
  267.    <?php
  268.       $wpec_taxes_controller = new wpec_taxes_controller();
  269.       if($wpec_taxes_controller->wpec_taxes_isenabled()):
  270.    ?>
  271.       <table class="productcart">
  272.          <tr class="total_price total_tax">
  273.             <td colspan="3">
  274.                <?php echo wpsc_display_tax_label(true); ?>
  275.             </td>
  276.             <td colspan="2">
  277.                <span id="checkout_tax" class="pricedisplay checkout-tax"><?php echo wpsc_cart_tax(); ?></span>
  278.             </td>
  279.          </tr>
  280.       </table>
  281.    <?php endif; ?>
  282.    <?php do_action('wpsc_before_form_of_shopping_cart'); ?>
  283.  
  284.     <?php if( ! empty( $wpsc_registration_error_messages ) ): ?>
  285.         <p class="validation-error">
  286.         <?php
  287.         foreach( $wpsc_registration_error_messages as $user_error )
  288.          echo $user_error."<br />\n";
  289.         ?>
  290.     <?php endif; ?>
  291.  
  292.     <?php if ( wpsc_show_user_login_form() && !is_user_logged_in() ): ?>
  293.             <p><?php _e('You must sign in or register with us to continue with your purchase', 'wpsc');?></p>
  294.             <div class="wpsc_registration_form">
  295.  
  296.                 <fieldset class='wpsc_registration_form'>
  297.                     <h2><?php _e( 'Sign in', 'wpsc' ); ?></h2>
  298.                     <?php
  299.                     $args = array(
  300.                         'remember' => false,
  301.                         'redirect' => home_url( $_SERVER['REQUEST_URI'] )
  302.                     );
  303.                     wp_login_form( $args );
  304.                     ?>
  305.                     <div class="wpsc_signup_text"><?php _e('If you have bought from us before please sign in here to purchase', 'wpsc');?></div>
  306.                 </fieldset>
  307.             </div>
  308.     <?php endif; ?>
  309.    <table class='wpsc_checkout_table wpsc_checkout_table_totals'>
  310.       <?php if(wpsc_uses_shipping()) : ?>
  311.           <tr class="total_price total_shipping">
  312.              <td class='wpsc_totals'>
  313.                 <?php _e('Total Shipping:', 'wpsc'); ?>
  314.              </td>
  315.              <td class='wpsc_totals'>
  316.                 <span id="checkout_shipping" class="pricedisplay checkout-shipping"><?php echo wpsc_cart_shipping(); ?></span>
  317.              </td>
  318.           </tr>
  319.       <?php endif; ?>
  320.  
  321.      <?php if(wpsc_uses_coupons() && (wpsc_coupon_amount(false) > 0)): ?>
  322.       <tr class="total_price">
  323.          <td class='wpsc_totals'>
  324.             <?php _e('Discount:', 'wpsc'); ?>
  325.          </td>
  326.          <td class='wpsc_totals'>
  327.             <span id="coupons_amount" class="pricedisplay"><?php echo wpsc_coupon_amount(); ?></span>
  328.           </td>
  329.          </tr>
  330.      <?php endif ?>
  331.  
  332.  
  333.  
  334.    <tr class='total_price'>
  335.       <td class='wpsc_totals'>
  336.       <?php _e('Total Price:', 'wpsc'); ?>
  337.       </td>
  338.       <td class='wpsc_totals'>
  339.          <span id='checkout_total' class="pricedisplay checkout-total"><?php echo wpsc_cart_total(); ?></span>
  340.       </td>
  341.    </tr>
  342.    </table>
  343.    
  344.    
  345. **/?>
  346.  
  347.    
  348.     <form class='wpsc_checkout_forms' action='<?php echo esc_url( get_option( 'shopping_cart_url' ) ); ?>' method='post' enctype="multipart/form-data">
  349.       <?php
  350.       /**
  351.        * Both the registration forms and the checkout details forms must be in the same form element as they are submitted together, you cannot have two form elements submit together without the use of JavaScript.
  352.       */
  353.       ?>
  354.  
  355.     <?php if(wpsc_show_user_login_form()):
  356.           global $current_user;
  357.           get_currentuserinfo();   ?>
  358.  
  359.         <div class="wpsc_registration_form">
  360.  
  361.             <fieldset class='wpsc_registration_form wpsc_right_registration'>
  362.                 <h2><?php _e('Join up now', 'wpsc');?></h2>
  363.  
  364.                 <label><?php _e('Username:', 'wpsc'); ?></label>
  365.                 <input type="text" name="log" id="log" value="" size="20"/><br/>
  366.  
  367.                 <label><?php _e('Password:', 'wpsc'); ?></label>
  368.                 <input type="password" name="pwd" id="pwd" value="" size="20" /><br />
  369.  
  370.                 <label><?php _e('E-mail', 'wpsc'); ?>:</label>
  371.                 <input type="text" name="user_email" id="user_email" value="" size="20" /><br />
  372.                 <div class="wpsc_signup_text"><?php _e('Signing up is free and easy! please fill out your details your registration will happen automatically as you checkout. Don\'t forget to use your details to login with next time!', 'wpsc');?></div>
  373.             </fieldset>
  374.  
  375.         </div>
  376.         <div class="clear"></div>
  377.    <?php endif; // closes user login form
  378.       $misc_error_messages = wpsc_get_customer_meta( 'checkout_misc_error_messages' );
  379.       if( ! empty( $misc_error_messages ) ): ?>
  380.          <div class='login_error'>
  381.             <?php foreach( $misc_error_messages as $user_error ){?>
  382.                <p class='validation-error'><?php echo $user_error; ?></p>
  383.             <?php } ?>
  384.          </div>
  385.  
  386.       <?php
  387.       endif;
  388.       ?>
  389. <?php ob_start(); ?>
  390.    <table class='wpsc_checkout_table table-1'>
  391.       <?php $i = 0;
  392.       while (wpsc_have_checkout_items()) : wpsc_the_checkout_item(); ?>
  393.  
  394.         <?php if(wpsc_checkout_form_is_header() == true){
  395.                $i++;
  396.                //display headers for form fields ?>
  397.                <?php if($i > 1):?>
  398.                   </table>
  399.                   <table class='wpsc_checkout_table table-<?php echo $i; ?>'>
  400.                <?php endif; ?>
  401.  
  402.                <tr <?php echo wpsc_the_checkout_item_error_class();?>>
  403.                   <td <?php wpsc_the_checkout_details_class(); ?> colspan='2'>
  404.                      <h4><?php echo wpsc_checkout_form_name();?></h4>
  405.                   </td>
  406.                </tr>
  407.                <?php if(wpsc_is_shipping_details()):?>
  408.                <tr class='same_as_shipping_row'>
  409.                   <td colspan ='2'>
  410.                   <?php $checked = '';
  411.                   $shipping_same_as_billing = wpsc_get_customer_meta( 'shipping_same_as_billing' );
  412.                   if(isset($_POST['shippingSameBilling']) && $_POST['shippingSameBilling'])
  413.                      $shipping_same_as_billing = true;
  414.                   elseif(isset($_POST['submit']) && !isset($_POST['shippingSameBilling']))
  415.                     $shipping_same_as_billing = false;
  416.                   wpsc_update_customer_meta( 'shipping_same_as_billing', $shipping_same_as_billing );
  417.                     if( $shipping_same_as_billing )
  418.                         $checked = 'checked="checked"';
  419.                    ?>
  420.                     <label for='shippingSameBilling'><?php _e('Same as billing address:','wpsc'); ?></label>
  421.                     <input type='checkbox' value='true' name='shippingSameBilling' id='shippingSameBilling' <?php echo $checked; ?> />
  422.                     <br/><span id="shippingsameasbillingmessage"><?php _e('Your order will be shipped to the billing address', 'wpsc'); ?></span>
  423.                   </td>
  424.                </tr>
  425.                <?php endif;
  426.  
  427.             // Not a header so start display form fields
  428.             }elseif(wpsc_disregard_shipping_state_fields()){
  429.             ?>
  430.                <tr class='wpsc_hidden'>
  431.                   <td class='<?php echo wpsc_checkout_form_element_id(); ?>'>
  432.                      <label for='<?php echo wpsc_checkout_form_element_id(); ?>'>
  433.                      <?php echo wpsc_checkout_form_name();?>
  434.                      </label>
  435.                   </td>
  436.                   <td>
  437.                      <?php echo wpsc_checkout_form_field();?>
  438.                       <?php if(wpsc_the_checkout_item_error() != ''): ?>
  439.                              <p class='validation-error'><?php echo wpsc_the_checkout_item_error(); ?></p>
  440.                      <?php endif; ?>
  441.                   </td>
  442.                </tr>
  443.             <?php
  444.             }elseif(wpsc_disregard_billing_state_fields()){
  445.             ?>
  446.                <tr class='wpsc_hidden'>
  447.                   <td class='<?php echo wpsc_checkout_form_element_id(); ?>'>
  448.                      <label for='<?php echo wpsc_checkout_form_element_id(); ?>'>
  449.                      <?php echo wpsc_checkout_form_name();?>
  450.                      </label>
  451.                   </td>
  452.                   <td>
  453.                      <?php echo wpsc_checkout_form_field();?>
  454.                       <?php if(wpsc_the_checkout_item_error() != ''): ?>
  455.                              <p class='validation-error'><?php echo wpsc_the_checkout_item_error(); ?></p>
  456.                      <?php endif; ?>
  457.                   </td>
  458.                </tr>
  459.             <?php
  460.             /**}elseif( $wpsc_checkout->checkout_item->unique_name == 'billingemail'){ ?>
  461.                <?php $email_markup =
  462.                "<div class='wpsc_email_address'>
  463.                   <p class='" . wpsc_checkout_form_element_id() . "'>
  464.                      <label class='wpsc_email_address' for='" . wpsc_checkout_form_element_id() . "'>
  465.                      " . __('Enter your email address', 'wpsc') . "
  466.                      </label>
  467.                   <p class='wpsc_email_address_p'>
  468.                   " . wpsc_checkout_form_field();
  469.  
  470.                    if(wpsc_the_checkout_item_error() != '')
  471.                       $email_markup .= "<p class='validation-error'>" . wpsc_the_checkout_item_error() . "</p>";
  472.                $email_markup .= "</div>";**/
  473.             }else{ ?>  
  474.             <tr>
  475.                <td class='<?php echo wpsc_checkout_form_element_id(); ?>'>
  476.                   <label for='<?php echo wpsc_checkout_form_element_id(); ?>'>
  477.                   <?php echo wpsc_checkout_form_name();?>
  478.                   </label>
  479.                </td>
  480.                <td>
  481.                   <?php echo wpsc_checkout_form_field();?>
  482.                    <?php if(wpsc_the_checkout_item_error() != ''): ?>
  483.                           <p class='validation-error'><?php echo wpsc_the_checkout_item_error(); ?></p>
  484.                   <?php endif; ?>
  485.                </td>
  486.             </tr>
  487.  
  488.          <?php }//endif; ?>
  489.  
  490.       <?php endwhile; ?>
  491.  
  492. <?php
  493.     $buffer_contents = ob_get_contents();
  494.     ob_end_clean();
  495.     if(isset($email_markup))
  496.         echo $email_markup;
  497.     echo $buffer_contents;
  498. ?>
  499.  
  500.       <?php if (wpsc_show_find_us()) : ?>
  501.       <tr>
  502.          <td><label for='how_find_us'><?php _e('How did you find us' , 'wpsc'); ?></label></td>
  503.          <td>
  504.             <select name='how_find_us'>
  505.                <option value='Word of Mouth'><?php _e('Word of mouth' , 'wpsc'); ?></option>
  506.                <option value='Advertisement'><?php _e('Advertising' , 'wpsc'); ?></option>
  507.                <option value='Internet'><?php _e('Internet' , 'wpsc'); ?></option>
  508.                <option value='Customer'><?php _e('Existing Customer' , 'wpsc'); ?></option>
  509.             </select>
  510.          </td>
  511.       </tr>
  512.       <?php endif; ?>
  513.       <?php do_action('wpsc_inside_shopping_cart'); ?>
  514.  
  515.       <?php  //this HTML displays activated payment gateways   ?>
  516.       <?php if(wpsc_gateway_count() > 1): // if we have more than one gateway enabled, offer the user a choice ?>
  517.          <tr>
  518.          <td colspan='2' class='wpsc_gateway_container'>
  519.             <h3><?php _e('Payment Type', 'wpsc');?></h3>
  520.             <?php while (wpsc_have_gateways()) : wpsc_the_gateway(); ?>
  521.                <div class="custom_gateway">
  522.                      <label><input type="radio" value="<?php echo wpsc_gateway_internal_name();?>" <?php echo wpsc_gateway_is_checked(); ?> name="custom_gateway" class="custom_gateway"/><?php echo wpsc_gateway_name(); ?>
  523.                         <?php if( wpsc_show_gateway_image() ): ?>
  524.                         <img src="<?php echo wpsc_gateway_image_url(); ?>" alt="<?php echo wpsc_gateway_name(); ?>" style="position:relative; top:5px;" />
  525.                         <?php endif; ?>
  526.                      </label>
  527.  
  528.                   <?php if(wpsc_gateway_form_fields()): ?>
  529.                      <table class='wpsc_checkout_table <?php echo wpsc_gateway_form_field_style();?>'>
  530.                         <?php echo wpsc_gateway_form_fields();?>
  531.                      </table>
  532.                   <?php endif; ?>
  533.                </div>
  534.             <?php endwhile; ?>
  535.             </td></tr>
  536.          <?php else: // otherwise, there is no choice, stick in a hidden form ?>
  537.             <tr><td colspan="2" class='wpsc_gateway_container'>
  538.             <?php while (wpsc_have_gateways()) : wpsc_the_gateway(); ?>
  539.                <input name='custom_gateway' value='<?php echo wpsc_gateway_internal_name();?>' type='hidden' />
  540.  
  541.                   <?php if(wpsc_gateway_form_fields()): ?>
  542.                      <table class='wpsc_checkout_table <?php echo wpsc_gateway_form_field_style();?>'>
  543.                         <?php echo wpsc_gateway_form_fields();?>
  544.                      </table>
  545.                   <?php endif; ?>
  546.             <?php endwhile; ?>
  547.          </td>
  548.          </tr>
  549.          <?php endif; ?>
  550.  
  551.       <?php if(wpsc_has_tnc()) : ?>
  552.          <tr>
  553.             <td colspan='2'>
  554.                 <label for="agree"><input id="agree" type='checkbox' value='yes' name='agree' /> <?php printf(__("I agree to the <a class='thickbox' target='_blank' href='%s' class='termsandconds'>Terms and Conditions</a>", "wpsc"), esc_url( site_url( "?termsandconds=true&amp;width=360&amp;height=400" ) ) ); ?> <span class="asterix">*</span></label>
  555.                </td>
  556.          </tr>
  557.       <?php endif; ?>
  558.       </table>
  559.      <?php $checked = '';
  560.                   $shipping_same_as_billing = wpsc_get_customer_meta( 'shipping_same_as_billing' );
  561.                   if(isset($_POST['shippingSameBilling']) && $_POST['shippingSameBilling'])
  562.                      $shipping_same_as_billing = true;
  563.                   elseif(isset($_POST['submit']) && !isset($_POST['shippingSameBilling']))
  564.                     $shipping_same_as_billing = false;
  565.                   wpsc_update_customer_meta( 'shipping_same_as_billing', $shipping_same_as_billing );
  566.                     if( $shipping_same_as_billing )
  567.                         $checked = 'value="true"';
  568.                    ?>
  569.    
  570. <!-- div for make purchase button -->
  571.       <div class='wpsc_make_purchase'>
  572.      
  573.       <p id="reveal-shipping" class="button" >Ship to a different address &rarr;</p>
  574.          <span>
  575.             <?php if(!wpsc_has_tnc()) : ?>
  576.                <input type='hidden' value='yes' name='agree' />
  577.             <?php endif; ?>
  578.                <input type='hidden' value='submit_checkout' name='wpsc_action' />
  579.                <input type='submit' value='<?php _e('Purchase &rarr;', 'wpsc');?>' name='submit' class='make_purchase button red wpsc_buy_button' />
  580.          </span>
  581.       </div>
  582. </form>
  583. <div class='clear'></div>
  584. </div><!-- /reveal-me -->
  585. </div><!--close checkout_page_container-->
  586. <?php
  587. do_action('wpsc_bottom_of_shopping_cart'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement