Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $ppurl = ($this -> get_option('pp_sandbox') == "Y") ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr'; ?>
- <?php $buynow = (!empty($params['buynow']) && $params['buynow'] == true) ? "Y" : "N"; ?>
- <?php $custom = urlencode(serialize(array('order_id' => $order -> id, 'buynow' => $buynow, 'user' => $order -> user, 'user_id' => $user -> ID))); ?>
- <?php $tax_cart = $Order -> tax_total($order -> id); ?>
- <p><img src="<?php echo $this -> url(); ?>/images/gateways/pp.jpg" alt="paypal" /></p>
- <form action="<?php echo $ppurl; ?>" method="post" id="pp-form">
- <input type="hidden" name="upload" value="1" />
- <input type="hidden" name="cmd" value="_ext-enter" />
- <input type="hidden" name="redirect_cmd" value="_cart" />
- <input type="hidden" name="business" value="<?php echo $this -> get_option('pp_email'); ?>" />
- <input type="hidden" name="receiver_email" value="<?php echo $this -> get_option('pp_email'); ?>" />
- <?php $amount = number_format($Order -> total($order -> id, false, true, true, true, false), 2, '.', ''); ?>
- <?php $discount = $Discount -> total($order_id); ?>
- <?php $total_price = $Order -> total($order -> id, true, true, true, true, false); ?>
- <?php if ($this -> get_option('enablecoupons') == "Y" && !empty($discount)) : ?>
- <?php
- if ($this -> get_option('pp_surcharge') == "Y") {
- $surcharge = $Order -> surcharge("pp", $total_price);
- $amount += $surcharge;
- $amount = number_format($amount, 2, '.', '');
- $surcharge_text = $wpcoHtml -> surcharge_text("pp");
- }
- ?>
- <input type="hidden" name="item_name_1" value="<?php bloginfo('name'); ?> <?php _e('Shopping Cart', $this -> plugin_name); ?>" />
- <input type="hidden" name="item_number_1" value="<?php echo $order -> id; ?>" />
- <input type="hidden" name="amount_1" value="<?php echo esc_attr(stripslashes($amount)); ?>" />
- <input type="hidden" name="quantity_1" value="1" />
- <?php else : ?>
- <?php $i = 1; ?>
- <?php foreach ($items as $item) : ?>
- <input type="hidden" name="item_name_<?php echo $i; ?>" value="<?php echo esc_attr($item -> product -> title); ?>" />
- <input type="hidden" name="item_number_<?php echo $i; ?>" value="<?php echo $item -> id; ?>" />
- <input type="hidden" name="amount_<?php echo $i; ?>" value="<?php echo number_format(($Product -> unit_price($item -> product -> id, $item -> count, $item -> id, false, true)), 2, '.', ''); ?>" />
- <input type="hidden" name="quantity_<?php echo $i; ?>" value="<?php echo $item -> count; ?>" />
- <input type="hidden" name="num_cart_items" value="<?php echo $Item -> item_count($order -> id); ?>" />
- <?php $i++; ?>
- <?php endforeach; ?>
- <?php
- if ($this -> get_option('pp_surcharge') == "Y") {
- $surcharge = $Order -> surcharge("pp", $total_price);
- $surcharge_text = $wpcoHtml -> surcharge_text("pp");
- }
- ?>
- <?php if ($this -> get_option('pp_surcharge') == "Y" && !empty($surcharge)) : ?>
- <input type="hidden" name="item_name_<?php echo $i; ?>" value="<?php _e('Surcharge', $this -> plugin_name); ?> (<?php echo $surcharge_text; ?>)" />
- <?php /*<input type="hidden" name="item_number_<?php echo $i; ?>" value="<?php echo $order -> id; ?>" />*/ ?>
- <input type="hidden" name="amount_<?php echo $i; ?>" value="<?php echo $surcharge; ?>" />
- <input type="hidden" name="quantity_<?php echo $i; ?>" value="1" />
- <?php endif; ?>
- <?php endif; ?>
- <!-- shipping -->
- <?php if ($this -> get_option('shippingcalc') == "Y") : ?>
- <input type="hidden" name="handling_cart" value="<?php echo number_format($Order -> shipping_total($amount, $order -> id), 2, '.', ''); ?>" />
- <?php endif; ?>
- <!-- tax -->
- <?php if ($this -> get_option('tax_calculate') == "Y" && !empty($tax_cart)) : ?>
- <input type="hidden" name="tax" value="<?php echo number_format($tax_cart, 2, '.', ''); ?>" />
- <input type="hidden" name="tax_rate" value="<?php echo $wpcoTax -> get_tax_percentage(); ?>" />
- <input type="hidden" name="tax_cart" value="<?php echo number_format($tax_cart, 2, '.', ''); ?>" />
- <?php endif; ?>
- <input type="hidden" name="no_note" value="1" />
- <input type="hidden" name="currency_code" value="<?php echo $this -> get_option('currency'); ?>" />
- <input type="hidden" name="notify_url" value="<?php echo $wpcoHtml -> return_url(); ?>&type=pp" />
- <?php if ($this -> get_option('pp_sandbox') == "Y") : ?>
- <input type="hidden" name="notify_url" value="<?php echo $wpcoHtml -> return_url(); ?>&type=pp" />
- <?php else : ?>
- <input type="hidden" name="return" value="<?php echo $wpcoHtml -> success_url(); ?>" />
- <?php endif; ?>
- <input type="hidden" name="cbt" value="<?php _e('CLICK HERE TO COMPLETE YOUR ORDER NOW', $this -> plugin_name); ?>" />
- <input type="hidden" name="rm" value="2" />
- <input type="hidden" name="custom" value="<?php echo $custom; ?>" />
- <input type="hidden" name="invoice" value="<?php echo $this -> get_option('pp_invoiceprefix'); ?><?php echo $order -> id; ?>" />
- <input type="hidden" name="first_name" value="<?php echo $user -> bill_fname; ?>" />
- <input type="hidden" name="last_name" value="<?php echo $user -> bill_lname; ?>" />
- <input type="hidden" name="address1" value="<?php echo $user -> bill_address; ?>" />
- <input type="hidden" name="city" value="<?php echo $user -> bill_city; ?>" />
- <input type="hidden" name="state" value="<?php echo $user -> bill_state; ?>" />
- <input type="hidden" name="zip" value="<?php echo $user -> bill_zipcode; ?>" />
- <?php $wpcoDb -> model = $Country -> model; ?>
- <?php $country = $wpcoDb -> field('value', array('id' => $user -> bill_country)); ?>
- <input type="hidden" name="country" value="<?php echo $country; ?>" />
- <a href="<?php echo $wpcoHtml -> bill_url(); ?>" class="button"><?php _e('« Back', $this -> plugin_name); ?></a>
- <input class="button" style="cursor:pointer;" type="submit" name="payment" value="<?php _e('Continue »', $this -> plugin_name); ?>" />
- </form>
- <script type="text/javascript">
- var form = document.getElementById('pp-form');
- form.submit();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment