Skip to content
This repository
Browse code

Various Bugfixes

Added compatibility for latest version of Jigoshop.
  • Loading branch information...
commit fc99fb558ec7f22f0a27e159ef452e8b1d8dc8db 1 parent 74681e4
Casey authored March 08, 2012
4  .gitignore
... ...
@@ -0,0 +1,4 @@
  1
+
  2
+.DS_Store
  3
+
  4
+skeleton/error_log
45  skeleton/checkout/form.php
... ...
@@ -1,25 +1,44 @@
1  
-<?php do_action('before_checkout_form'); ?>
  1
+<?php
  2
+/**
  3
+ * Checkout form template
  4
+ *
  5
+ * DISCLAIMER
  6
+ *
  7
+ * Do not edit or add directly to this file if you wish to upgrade Jigoshop to newer
  8
+ * versions in the future. If you wish to customise Jigoshop core for your needs,
  9
+ * please use our GitHub repository to publish essential changes for consideration.
  10
+ *
  11
+ * @package		Jigoshop
  12
+ * @category	Checkout
  13
+ * @author		Jigowatt
  14
+ * @copyright	Copyright (c) 2011-2012 Jigowatt Ltd.
  15
+ * @license		http://jigoshop.com/license/commercial-edition
  16
+ */
  17
+?>
  18
+
  19
+<?php do_action('before_checkout_form');
  20
+// filter hook for include new pages inside the payment method
  21
+$get_checkout_url = apply_filters( 'jigoshop_get_checkout_url', jigoshop_cart::get_checkout_url() ); ?>
  22
+
  23
+<form name="checkout" method="post" class="checkout" action="<?php echo esc_url( $get_checkout_url ); ?>">
2 24
 
3  
-<form name="checkout" method="post" class="checkout" action="<?php echo jigoshop_cart::get_checkout_url(); ?>">
4  
-	
5 25
 	<div class="col2-set" id="customer_details">
6  
-		<div class="one_half">
  26
+		<div class="col-1">
7 27
 
8 28
 			<?php do_action('jigoshop_checkout_billing'); ?>
9  
-						
  29
+
10 30
 		</div>
11  
-		<div class="one_half last">
12  
-		
  31
+		<div class="col-2">
  32
+
13 33
 			<?php do_action('jigoshop_checkout_shipping'); ?>
14  
-					
  34
+
15 35
 		</div>
16 36
 	</div>
17  
-	
18  
-	<div class="clear"></div>
  37
+
19 38
 	<h3 id="order_review_heading"><?php _e('Your order', 'jigoshop'); ?></h3>
20  
-	
21  
-	<?php jigoshop_get_template('checkout/review_order.php'); ?>
22  
-	
  39
+
  40
+	<?php do_action('jigoshop_checkout_order_review'); ?>
  41
+
23 42
 </form>
24 43
 
25 44
 <?php do_action('after_checkout_form'); ?>
0  skeleton/checkout/index.php
No changes.
234  skeleton/checkout/pay_for_order.php
... ...
@@ -1,90 +1,160 @@
  1
+<?php
  2
+/**
  3
+ * Pay for order form template
  4
+ *
  5
+ * DISCLAIMER
  6
+ *
  7
+ * Do not edit or add directly to this file if you wish to upgrade Jigoshop to newer
  8
+ * versions in the future. If you wish to customise Jigoshop core for your needs,
  9
+ * please use our GitHub repository to publish essential changes for consideration.
  10
+ *
  11
+ * @package		Jigoshop
  12
+ * @category	Checkout
  13
+ * @author		Jigowatt
  14
+ * @copyright	Copyright (c) 2011-2012 Jigowatt Ltd.
  15
+ * @license		http://jigoshop.com/license/commercial-edition
  16
+ */
  17
+?>
  18
+
1 19
 <?php global $order; ?>
2 20
 <form id="order_review" method="post">
3  
-	
4  
-	<table class="shop_table">
5  
-		<thead>
6  
-			<tr>
7  
-				<th><?php _e('Product', 'jigoshop'); ?></th>
8  
-				<th><?php _e('Qty', 'jigoshop'); ?></th>
9  
-				<th><?php _e('Totals', 'jigoshop'); ?></th>
10  
-			</tr>
11  
-		</thead>
12  
-		<tfoot>
13  
-			<tr>
14  
-				<td colspan="2"><?php _e('Subtotal', 'jigoshop'); ?></td>
15  
-				<td><?php echo $order->get_subtotal_to_display(); ?></td>
16  
-			</tr>
17  
-			<?php if ($order->order_shipping>0) : ?><tr>
18  
-				<td colspan="2"><?php _e('Shipping', 'jigoshop'); ?></td>
19  
-				<td><?php echo $order->get_shipping_to_display(); ?></small></td>
20  
-			</tr><?php endif; ?>
21  
-			<?php if ($order->get_total_tax()>0) : ?><tr>
22  
-				<td colspan="2"><?php _e('Tax', 'jigoshop'); ?></td>
23  
-				<td><?php echo jigoshop_price($order->get_total_tax()); ?></td>
24  
-			</tr><?php endif; ?>
25  
-			<?php if ($order->order_discount>0) : ?><tr class="discount">
26  
-				<td colspan="2"><?php _e('Discount', 'jigoshop'); ?></td>
27  
-				<td>-<?php echo jigoshop_price($order->order_discount); ?></td>
28  
-			</tr><?php endif; ?>
29  
-			<tr>
30  
-				<td colspan="2"><strong><?php _e('Grand Total', 'jigoshop'); ?></strong></td>
31  
-				<td><strong><?php echo jigoshop_price($order->order_total); ?></strong></td>
32  
-			</tr>
33  
-		</tfoot>
34  
-		<tbody>
35  
-			<?php
36  
-			if (sizeof($order->items)>0) : 
37  
-				foreach ($order->items as $item) :
38  
-					echo '
  21
+
  22
+    <table class="shop_table">
  23
+        <thead>
  24
+            <tr>
  25
+                <th><?php _e('Product', 'jigoshop'); ?></th>
  26
+                <th><?php _e('Qty', 'jigoshop'); ?></th>
  27
+                <th><?php _e('Totals', 'jigoshop'); ?></th>
  28
+            </tr>
  29
+        </thead>
  30
+        <tfoot>
  31
+            <tr>
  32
+                <?php if (get_option('jigoshop_calc_taxes') == 'yes' && $order->order_subtotal_inc_tax) : ?>
  33
+                    <td colspan="2"><?php _e('Retail Price', 'jigoshop'); ?></td>
  34
+                <?php else : ?>
  35
+                    <td colspan="2"><?php _e('Subtotal', 'jigoshop'); ?></td>
  36
+                <?php endif; ?>
  37
+                <td><?php echo $order->get_subtotal_to_display(); ?></td>
  38
+            </tr>
  39
+            <?php
  40
+            if (get_option('jigoshop_calc_taxes') == 'yes' && $order->order_subtotal_inc_tax) :
  41
+                if ($order->order_shipping > 0) :
  42
+                    ?><tr>
  43
+                        <td colspan="2"><?php _e('Shipping', 'jigoshop'); ?></td>
  44
+                        <td><?php echo $order->get_shipping_to_display(); ?></small></td>
  45
+                    </tr><?php
  46
+                endif;
  47
+                foreach ($order->get_tax_classes() as $tax_class) :
  48
+                    if ($order->tax_class_is_not_compound($tax_class)) :
  49
+                        ?>
  50
+                        <tr>
  51
+                            <td colspan="2"><?php echo $order->get_tax_class_for_display($tax_class) . ' (' . (float) $order->get_tax_rate($tax_class) . '%):'; ?></td>
  52
+                            <td><?php echo $order->get_tax_amount($tax_class) ?></td>
  53
+                        </tr>
  54
+                        <?php
  55
+                    endif;
  56
+                endforeach;
  57
+                ?><tr>
  58
+                    <td colspan="2"><?php _e('Subtotal', 'jigoshop'); ?></td>
  59
+                    <td><?php echo jigoshop_price($order->order_subtotal_inc_tax); ?></td>
  60
+                </tr>
  61
+                <?php
  62
+            else :
  63
+                if ($order->order_shipping > 0) :
  64
+                    ?><tr>
  65
+                        <td colspan="2"><?php _e('Shipping', 'jigoshop'); ?></td>
  66
+                        <td><?php echo $order->get_shipping_to_display(); ?></small></td>
  67
+                    </tr><?php
  68
+                endif;
  69
+            endif;
  70
+            if (get_option('jigoshop_calc_taxes') == 'yes') :
  71
+                if ($order->order_subtotal_inc_tax) :
  72
+                    foreach ($order->get_tax_classes() as $tax_class) :
  73
+                        if (!$order->tax_class_is_not_compound($tax_class)) :
  74
+                            ?>
  75
+
  76
+                            <tr>
  77
+                                <td colspan="2"><?php echo $order->get_tax_class_for_display($tax_class) . ' (' . (float) $order->get_tax_rate($tax_class) . '%):'; ?></td>
  78
+                                <td><?php echo $order->get_tax_amount($tax_class) ?></td>
  79
+                            </tr>
  80
+                            <?php
  81
+                        endif;
  82
+                    endforeach;
  83
+                else :
  84
+                    foreach ($order->get_tax_classes() as $tax_class) :
  85
+                        ?>
  86
+                        <tr>
  87
+                            <td colspan="2"><?php echo $order->get_tax_class_for_display($tax_class) . ' (' . (float) $order->get_tax_rate($tax_class) . '%):'; ?></td>
  88
+                            <td><?php echo $order->get_tax_amount($tax_class) ?></td>
  89
+                        </tr>
  90
+                    <?php endforeach;
  91
+                endif;
  92
+            endif;
  93
+            if ($order->order_discount > 0) : ?><tr class="discount">
  94
+                    <td colspan="2"><?php _e('Discount', 'jigoshop'); ?></td>
  95
+                    <td>-<?php echo jigoshop_price($order->order_discount); ?></td>
  96
+                </tr><?php endif; ?>
  97
+            <tr>
  98
+                <td colspan="2"><strong><?php _e('Grand Total', 'jigoshop'); ?></strong></td>
  99
+                <td><strong><?php echo jigoshop_price($order->order_total); ?></strong></td>
  100
+            </tr>
  101
+        </tfoot>
  102
+        <tbody>
  103
+            <?php
  104
+            if (sizeof($order->items) > 0) :
  105
+                foreach ($order->items as $item) :
  106
+                    echo '
39 107
 						<tr>
40  
-							<td>'.$item['name'].'</td>
41  
-							<td>'.$item['qty'].'</td>
42  
-							<td>'.jigoshop_price( $item['cost']*$item['qty'] ).'</td>
  108
+							<td>' . $item['name'] . '</td>
  109
+							<td>' . $item['qty'] . '</td>
  110
+							<td>' . jigoshop_price($item['cost'] * $item['qty']) . '</td>
43 111
 						</tr>';
44  
-				endforeach; 
45  
-			endif;
46  
-			?>
47  
-		</tbody>
48  
-	</table>
49  
-	
50  
-	<div id="payment">
51  
-		<?php if ($order->order_total > 0) : ?>
52  
-		<ul class="payment_methods methods">
53  
-			<?php 
54  
-				$available_gateways = jigoshop_payment_gateways::get_available_payment_gateways();
55  
-				if ($available_gateways) : 
56  
-					// Chosen Method
57  
-					if (sizeof($available_gateways)) current($available_gateways)->set_current();
58  
-					foreach ($available_gateways as $gateway ) :
59  
-						?>
60  
-						<li>
61  
-							<input type="radio" id="payment_method_<?php echo $gateway->id; ?>" class="input-radio" name="payment_method" value="<?php echo $gateway->id; ?>" <?php if ($gateway->chosen) echo 'checked="checked"'; ?> />
62  
-							<label for="payment_method_<?php echo $gateway->id; ?>"><?php echo $gateway->title; ?> <?php echo $gateway->icon(); ?></label> 
63  
-							<?php
64  
-								if ($gateway->has_fields || $gateway->description) : 
65  
-									echo '<div class="payment_box payment_method_'.$gateway->id.'" style="display:none;">';
66  
-									$gateway->payment_fields();
67  
-									echo '</div>';
68  
-								endif;
69  
-							?>
70  
-						</li>
71  
-						<?php
72  
-					endforeach;
73  
-				else :
74  
-				
75  
-					echo '<p>'.__('Sorry, it seems that there are no available payment methods for your location. Please contact us if you require assistance or wish to make alternate arrangements.', 'jigoshop').'</p>';
76  
-					
77  
-				endif;
78  
-			?>
79  
-		</ul>
80  
-		<?php endif; ?>
  112
+                endforeach;
  113
+            endif;
  114
+            ?>
  115
+        </tbody>
  116
+    </table>
  117
+
  118
+    <div id="payment">
  119
+        <?php if ($order->order_total > 0) : ?>
  120
+            <ul class="payment_methods methods">
  121
+                <?php
  122
+                $available_gateways = jigoshop_payment_gateways::get_available_payment_gateways();
  123
+                if ($available_gateways) :
  124
+                    // Chosen Method
  125
+                    if (sizeof($available_gateways))
  126
+                        current($available_gateways)->set_current();
  127
+                    foreach ($available_gateways as $gateway) :
  128
+                        ?>
  129
+                        <li>
  130
+                            <input type="radio" id="payment_method_<?php echo $gateway->id; ?>" class="input-radio" name="payment_method" value="<?php echo esc_attr( $gateway->id ); ?>" <?php if ($gateway->chosen)
  131
+                echo 'checked="checked"'; ?> />
  132
+                            <label for="payment_method_<?php echo $gateway->id; ?>"><?php echo $gateway->title; ?> <?php echo $gateway->icon(); ?></label>
  133
+                            <?php
  134
+                            if ($gateway->has_fields || $gateway->description) :
  135
+                                echo '<div class="payment_box payment_method_' . esc_attr( $gateway->id  ) . '" style="display:none;">';
  136
+                                $gateway->payment_fields();
  137
+                                echo '</div>';
  138
+                            endif;
  139
+                            ?>
  140
+                        </li>
  141
+                        <?php
  142
+                    endforeach;
  143
+                else :
  144
+
  145
+                    echo '<p>' . __('Sorry, it seems that there are no available payment methods for your location. Please contact us if you require assistance or wish to make alternate arrangements.', 'jigoshop') . '</p>';
  146
+
  147
+                endif;
  148
+                ?>
  149
+            </ul>
  150
+        <?php endif; ?>
  151
+
  152
+        <div class="form-row">
  153
+            <?php jigoshop::nonce_field('pay') ?>
  154
+            <input type="submit" class="button-alt" name="pay" id="place_order" value="<?php _e('Pay for order', 'jigoshop'); ?>" />
81 155
 
82  
-		<div class="form-row">
83  
-			<?php jigoshop::nonce_field('pay')?>
84  
-			<input type="submit" class="button" name="pay" id="place_order" value="<?php _e('Pay for order', 'jigoshop'); ?>" />
  156
+        </div>
85 157
 
86  
-		</div>
  158
+    </div>
87 159
 
88  
-	</div>
89  
-	
90 160
 </form>
274  skeleton/checkout/review_order.php
... ...
@@ -1,148 +1,142 @@
1 1
 <?php
2  
-	if (!defined('JIGOSHOP_CHECKOUT')) define('JIGOSHOP_CHECKOUT', true);
3  
-	
4  
-	if (!defined('ABSPATH')) :
5  
-		define('DOING_AJAX', true);
6  
-		
7  
-		
8  
-		$wp_include = "../wp-load.php";
9  
-		$i = 0;
10  
-		while (!file_exists($wp_include) && $i++ < 10) {
11  
-		  $wp_include = "../$wp_include";
12  
-		}
13  
-		// let's load WordPress
14  
-		require($wp_include);
15  
-		
16  
-	endif;
17  
-	
18  
-	if (sizeof(jigoshop_cart::$cart_contents)==0) :
19  
-		echo '<p class="error">'.__('Sorry, your session has expired.', 'jigoshop').' <a href="'.home_url().'">'.__('Return to homepage &rarr;', 'jigoshop').'</a></p>';
20  
-		exit;
21  
-	endif;
22  
-	
23  
-	if (isset($_POST['shipping_method'])) $_SESSION['_chosen_method_id'] = $_POST['shipping_method'];
24  
-	
25  
-	if (isset($_POST['country'])) jigoshop_customer::set_country( $_POST['country'] );
26  
-	if (isset($_POST['state'])) jigoshop_customer::set_state( $_POST['state'] );
27  
-	if (isset($_POST['postcode'])) jigoshop_customer::set_postcode( $_POST['postcode'] );
28  
-	
29  
-	if (isset($_POST['s_country'])) jigoshop_customer::set_shipping_country( $_POST['s_country'] );
30  
-	if (isset($_POST['s_state'])) jigoshop_customer::set_shipping_state( $_POST['s_state'] );
31  
-	if (isset($_POST['s_postcode'])) jigoshop_customer::set_shipping_postcode( $_POST['s_postcode'] );
32  
-	
33  
-	jigoshop_cart::calculate_totals();
  2
+/**
  3
+ * Review order form template
  4
+ *
  5
+ * DISCLAIMER
  6
+ *
  7
+ * Do not edit or add directly to this file if you wish to upgrade Jigoshop to newer
  8
+ * versions in the future. If you wish to customise Jigoshop core for your needs,
  9
+ * please use our GitHub repository to publish essential changes for consideration.
  10
+ *
  11
+ * @package		Jigoshop
  12
+ * @category	Checkout
  13
+ * @author		Jigowatt
  14
+ * @copyright	Copyright (c) 2011-2012 Jigowatt Ltd.
  15
+ * @license		http://jigoshop.com/license/commercial-edition
  16
+ */
34 17
 ?>
35 18
 <div id="order_review">
36  
-	
37  
-	<table class="shop_table">
38  
-		<thead>
39  
-			<tr>
40  
-				<th><?php _e('Product', 'jigoshop'); ?></th>
41  
-				<th><?php _e('Qty', 'jigoshop'); ?></th>
42  
-				<th><?php _e('Totals', 'jigoshop'); ?></th>
43  
-			</tr>
44  
-		</thead>
45  
-		<tfoot>
46  
-			<tr>
47  
-				<td colspan="2"><?php _e('Subtotal', 'jigoshop'); ?></td>
48  
-				<td><?php echo jigoshop_cart::get_cart_subtotal(); ?></td>
49  
-			</tr>
50  
-			
51  
-			<?php  if (jigoshop_cart::needs_shipping()) : ?>
52  
-				<td colspan="2"><?php _e('Shipping', 'jigoshop'); ?></td>
53  
-				<td>
54  
-				<?php
55  
-				
56  
-					$available_methods = jigoshop_shipping::get_available_shipping_methods();
57  
-					
58  
-					if (sizeof($available_methods)>0) :
59  
-						
60  
-						echo '<select name="shipping_method" id="shipping_method">';
61  
-						
62  
-						foreach ($available_methods as $method ) :
63  
-							
64  
-							echo '<option value="'.$method->id.'" ';
65  
-							
66  
-							if ($method->chosen) echo 'selected="selected"';
67  
-							
68  
-							echo '>'.$method->title.' &ndash; ';
69  
-							
70  
-							if ($method->shipping_total>0) :
71  
-								echo jigoshop_price($method->shipping_total);
72  
-								if ($method->shipping_tax>0) : __(' (ex. tax)', 'jigoshop'); endif;
73  
-							else :
74  
-								echo __('Free', 'jigoshop');
75  
-							endif;
76  
-							
77  
-							echo '</option>';
78  
-
79  
-						endforeach;
80  
-						
81  
-						echo '</select>';
82  
-						
83  
-					else :
84  
-						
85  
-						if ( !jigoshop_customer::get_country() ) :
86  
-							echo '<p>'.__('Please fill in your details above to see available shipping methods.', 'jigoshop').'</p>';
87  
-						else :
88  
-							echo '<p>'.__('Sorry, it seems that there are no available shipping methods for your state. Please contact us if you require assistance or wish to make alternate arrangements.', 'jigoshop').'</p>';
89  
-						endif;
90  
-						
91  
-					endif;
92  
-			
93  
-				?></td>
94 19
 
95  
-			<?php endif; ?>
96  
-			
97  
-			<?php if (jigoshop_cart::get_cart_tax()) : ?><tr>
98  
-				<td colspan="2"><?php _e('Tax', 'jigoshop'); ?></td>
99  
-				<td><?php echo jigoshop_cart::get_cart_tax(); ?></td>
100  
-			</tr><?php endif; ?>
101  
-
102  
-			<?php if (jigoshop_cart::get_total_discount()) : ?><tr class="discount">
103  
-				<td colspan="2"><?php _e('Discount', 'jigoshop'); ?></td>
104  
-				<td>-<?php echo jigoshop_cart::get_total_discount(); ?></td>
105  
-			</tr><?php endif; ?>
106  
-			<tr>
107  
-				<td colspan="2"><strong><?php _e('Grand Total', 'jigoshop'); ?></strong></td>
108  
-				<td><strong><?php echo jigoshop_cart::get_total(); ?></strong></td>
109  
-			</tr>
110  
-		</tfoot>
111  
-		<tbody>
112  
-			<?php
113  
-			if (sizeof(jigoshop_cart::$cart_contents)>0) : 
114  
-				foreach (jigoshop_cart::$cart_contents as $item_id => $values) :
115  
-					$_product = $values['data'];
116  
-					if ($_product->exists() && $values['quantity']>0) :
117  
-						echo '
118  
-							<tr>
119  
-								<td>'.$_product->get_title().'</td>
120  
-								<td>'.$values['quantity'].'</td>
121  
-								<td>'.jigoshop_price($_product->get_price_excluding_tax()*$values['quantity'], array('ex_tax_label' => 1)).'</td>
  20
+    <table class="shop_table">
  21
+        <thead>
  22
+            <tr>
  23
+                <th><?php _e('Product', 'jigoshop'); ?></th>
  24
+                <th><?php _e('Qty', 'jigoshop'); ?></th>
  25
+                <th><?php _e('Totals', 'jigoshop'); ?></th>
  26
+            </tr>
  27
+        </thead>
  28
+        <tfoot>
  29
+            <tr>
  30
+                <?php if (get_option('jigoshop_calc_taxes') == 'yes' && jigoshop_cart::get_subtotal_inc_tax()) : ?>
  31
+                    <td colspan="2"><?php _e('Retail Price', 'jigoshop'); ?></td>
  32
+                <?php else : ?>
  33
+                    <td colspan="2"><?php _e('Subtotal', 'jigoshop'); ?></td>
  34
+                <?php endif; ?>
  35
+                <td><?php echo jigoshop_cart::get_cart_subtotal(); ?></td>
  36
+            </tr>
  37
+
  38
+            <?php
  39
+            if (get_option('jigoshop_calc_taxes') == 'yes' && jigoshop_cart::get_subtotal_inc_tax()) :
  40
+                jigoshop_checkout::get_shipping_dropdown();
  41
+                foreach (jigoshop_cart::get_applied_tax_classes() as $tax_class) :
  42
+                    if (jigoshop_cart::is_not_compounded_tax($tax_class)) :
  43
+                        ?>
  44
+                        <tr>
  45
+                            <td colspan="2"><?php echo jigoshop_cart::get_tax_for_display($tax_class); ?></td>
  46
+                            <td><?php echo jigoshop_cart::get_tax_amount($tax_class) ?></td>
  47
+                        </tr>
  48
+                        <?php
  49
+                    endif;
  50
+                endforeach;
  51
+                ?><tr>
  52
+                    <td colspan="2"><?php _e('Subtotal', 'jigoshop'); ?></td>
  53
+                    <td><?php echo jigoshop_cart::get_subtotal_inc_tax(); ?></td>
  54
+                </tr>
  55
+                <?php
  56
+            else :
  57
+                jigoshop_checkout::get_shipping_dropdown();
  58
+            endif;
  59
+            if (get_option('jigoshop_calc_taxes') == 'yes') :
  60
+                if (jigoshop_cart::get_subtotal_inc_tax()) :
  61
+                    foreach (jigoshop_cart::get_applied_tax_classes() as $tax_class) :
  62
+                        if (!jigoshop_cart::is_not_compounded_tax($tax_class)) :
  63
+                                    ?>
  64
+
  65
+                            <tr>
  66
+                                <td colspan="2"><?php echo jigoshop_cart::get_tax_for_display($tax_class); ?></th>
  67
+                                <td><?php echo jigoshop_cart::get_tax_amount($tax_class) ?></td>
  68
+                            </tr>
  69
+                            <?php
  70
+                        endif;
  71
+                    endforeach;
  72
+                else :
  73
+                    foreach (jigoshop_cart::get_applied_tax_classes() as $tax_class) :
  74
+                        ?>
  75
+                        <tr>
  76
+                            <td colspan="2"><?php echo jigoshop_cart::get_tax_for_display($tax_class); ?></td>
  77
+                            <td><?php echo jigoshop_cart::get_tax_amount($tax_class) ?></td>
  78
+                        </tr>
  79
+                        <?php
  80
+                    endforeach;
  81
+                endif;
  82
+            endif;
  83
+            ?>
  84
+
  85
+            <?php do_action('jigoshop_after_review_order_items'); ?>
  86
+            <?php if (jigoshop_cart::get_total_discount()) : ?><tr class="discount">
  87
+                    <td colspan="2"><?php _e('Discount', 'jigoshop'); ?></td>
  88
+                    <td>-<?php echo jigoshop_cart::get_total_discount(); ?></td>
  89
+                </tr><?php endif; ?>
  90
+            <tr>
  91
+                <td colspan="2"><strong><?php _e('Grand Total', 'jigoshop'); ?></strong></td>
  92
+                <td><strong><?php echo jigoshop_cart::get_total(); ?></strong></td>
  93
+            </tr>
  94
+        </tfoot>
  95
+        <tbody>
  96
+            <?php
  97
+            if (sizeof(jigoshop_cart::$cart_contents) > 0) :
  98
+                foreach (jigoshop_cart::$cart_contents as $item_id => $values) :
  99
+                    $_product = $values['data'];
  100
+                    if ($_product->exists() && $values['quantity'] > 0) :
  101
+						$variation = '';
  102
+                        if ($_product instanceof jigoshop_product_variation && is_array($values['variation'])) {
  103
+                            $variation = jigoshop_get_formatted_variation($values['variation']);
  104
+                        }
  105
+                        echo '
  106
+                            <tr>
  107
+                                <td class="product-name">' . $_product->get_title() . $variation . '</td>
  108
+								<td>' . $values['quantity'] . '</td>
  109
+								<td>' . jigoshop_price($_product->get_price_excluding_tax() * $values['quantity'], array('ex_tax_label' => 1)) . '</td>
122 110
 							</tr>';
123 111
 					endif;
124  
-				endforeach; 
  112
+				endforeach;
125 113
 			endif;
126 114
 			?>
127 115
 		</tbody>
128 116
 	</table>
129  
-	
  117
+
130 118
 	<div id="payment">
131 119
 		<?php if (jigoshop_cart::needs_payment()) : ?>
132 120
 		<ul class="payment_methods methods">
133  
-			<?php 
  121
+			<?php
134 122
 				$available_gateways = jigoshop_payment_gateways::get_available_payment_gateways();
135  
-				if ($available_gateways) : 
  123
+				if ($available_gateways) :
136 124
 					// Chosen Method
137  
-					if (sizeof($available_gateways)) current($available_gateways)->set_current();
  125
+					if (sizeof($available_gateways)) {
  126
+						if( isset( $_POST[ 'payment_method' ] ) && isset( $available_gateways[ $_POST['payment_method'] ] ) ) {
  127
+							$available_gateways[ $_POST[ 'payment_method' ] ]->set_current();
  128
+						} else {
  129
+							current($available_gateways)->set_current();
  130
+						}
  131
+					}
138 132
 					foreach ($available_gateways as $gateway ) :
139 133
 						?>
140 134
 						<li>
141  
-						<input type="radio" id="payment_method_<?php echo $gateway->id; ?>" class="input-radio" name="payment_method" value="<?php echo $gateway->id; ?>" <?php if ($gateway->chosen) echo 'checked="checked"'; ?> />
142  
-						<label for="payment_method_<?php echo $gateway->id; ?>"><?php echo $gateway->title; ?> <?php echo apply_filters('gateway_icon', $gateway->icon(), $gateway->id); ?></label> 
  135
+						<input type="radio" id="payment_method_<?php echo $gateway->id; ?>" class="input-radio" name="payment_method" value="<?php echo esc_attr( $gateway->id ); ?>" <?php if ($gateway->chosen) echo 'checked="checked"'; ?> />
  136
+						<label for="payment_method_<?php echo $gateway->id; ?>"><?php echo $gateway->title; ?> <?php echo apply_filters('gateway_icon', $gateway->icon(), $gateway->id); ?></label>
143 137
 							<?php
144  
-								if ($gateway->has_fields || $gateway->description) : 
145  
-									echo '<div class="payment_box payment_method_'.$gateway->id.'" style="display:none;">';
  138
+								if ($gateway->has_fields || $gateway->description) :
  139
+									echo '<div class="payment_box payment_method_' . esc_attr( $gateway->id ) . '" style="display:none;">';
146 140
 									$gateway->payment_fields();
147 141
 									echo '</div>';
148 142
 								endif;
@@ -151,34 +145,42 @@
151 145
 						<?php
152 146
 					endforeach;
153 147
 				else :
154  
-				
  148
+
155 149
 					if ( !jigoshop_customer::get_country() ) :
156 150
 						echo '<p>'.__('Please fill in your details above to see available payment methods.', 'jigoshop').'</p>';
157 151
 					else :
158 152
 						echo '<p>'.__('Sorry, it seems that there are no available payment methods for your state. Please contact us if you require assistance or wish to make alternate arrangements.', 'jigoshop').'</p>';
159 153
 					endif;
160  
-					
  154
+
161 155
 				endif;
162 156
 			?>
163 157
 		</ul>
164 158
 		<?php endif; ?>
165 159
 
166 160
 		<div class="form-row">
167  
-		
168  
-			<noscript><?php _e('Since your browser does not support JavaScript, or it is disabled, please ensure you click the <em>Update Totals</em> button before placing your order. You may be charged more than the amount stated above if you fail to do so.', 'jigoshop'); ?><br/><input type="submit" class="button" name="update_totals" value="<?php _e('Update totals', 'jigoshop'); ?>" /></noscript>
169  
-		
  161
+
  162
+			<noscript><?php _e('Since your browser does not support JavaScript, or it is disabled, please ensure you click the <em>Update Totals</em> button before placing your order. You may be charged more than the amount stated above if you fail to do so.', 'jigoshop'); ?><br/><input type="submit" class="button-alt" name="update_totals" value="<?php _e('Update totals', 'jigoshop'); ?>" /></noscript>
  163
+
170 164
 			<?php jigoshop::nonce_field('process_checkout')?>
171  
-			<input type="submit" class="button" name="place_order" id="place_order" value="<?php _e('Place order', 'jigoshop'); ?>" />
172  
-			
173  
-			<?php if (get_option('jigoshop_terms_page_id')>0) : ?>
  165
+
  166
+			<?php do_action( 'jigoshop_review_order_before_submit' ); ?>
  167
+
  168
+			<?php if (jigoshop_get_page_id('terms')>0) : ?>
174 169
 			<p class="form-row terms">
175  
-				<label for="terms" class="checkbox"><?php _e('I accept the', 'jigoshop'); ?> <a href="<?php echo get_permalink(get_option('jigoshop_terms_page_id')); ?>" target="_blank"><?php _e('terms &amp; conditions', 'jigoshop'); ?></a></label>
  170
+				<label for="terms" class="checkbox"><?php _e('I accept the', 'jigoshop'); ?> <a href="<?php echo esc_url( get_permalink(jigoshop_get_page_id('terms')) ); ?>" target="_blank"><?php _e('terms &amp; conditions', 'jigoshop'); ?></a></label>
176 171
 				<input type="checkbox" class="input-checkbox" name="terms" <?php if (isset($_POST['terms'])) echo 'checked="checked"'; ?> id="terms" />
177 172
 			</p>
178 173
 			<?php endif; ?>
179 174
 
  175
+            <a href="<?php echo home_url(); ?>" class="button cancel"><?php echo apply_filters( 'jigoshop_order_cancel_button_text', __( 'Cancel', 'jigoshop') ) ?></a>
  176
+
  177
+			<?php $order_button_text = apply_filters( 'jigoshop_order_button_text', __( 'Place order', 'jigoshop') ); ?>
  178
+			<input type="submit" class="button-alt" name="place_order" id="place_order" value="<?php echo esc_attr( $order_button_text ); ?>" />
  179
+
  180
+			<?php do_action( 'jigoshop_review_order_after_submit' ); ?>
  181
+
180 182
 		</div>
181 183
 
182 184
 	</div>
183  
-	
  185
+
184 186
 </div>
13  skeleton/jigoshop.css
@@ -444,15 +444,6 @@ p.buttons a.button:hover {
444 444
 }
445 445
 
446 446
 .button-alt {
447  
-  color: #fff !important;
448  
-  padding: 4px 16px;
449  
-  width: auto !important;
450  
-  text-decoration: none;
451  
-  cursor: pointer;
452  
-  -webkit-border-radius: 3px;
453  
-  -moz-border-radius: 3px;
454  
-  border-radius: 3px;
455  
-  line-height: 1.6em;
456 447
   position: relative;
457 448
   top: -1px;
458 449
 }
@@ -552,7 +543,6 @@ p.buttons a.button:hover {
552 543
 
553 544
 }
554 545
 #review_form label {
555  
-	display: inline;
556 546
 }
557 547
 
558 548
 #review_form #respond p {
@@ -802,7 +792,7 @@ td.quantity {
802 792
 }
803 793
 .cart-collaterals .cart_totals {
804 794
   float: right;
805  
-  width: 225px;
  795
+  width: 100%;
806 796
   text-align: right;
807 797
   
808 798
 }
@@ -943,6 +933,7 @@ form.login {
943 933
 #payment #place_order {
944 934
   float: right;
945 935
   margin: 0;
  936
+  font-size: 18px;
946 937
 }
947 938
 #payment .terms {
948 939
   padding: 0 1em 0 !important;
2  skeleton/jigoshop_functions.php
@@ -477,7 +477,7 @@ function jigoshop_related_products( $posts_per_page = 4, $post_columns = 4, $ord
477 477
  **/
478 478
 if (!function_exists('jigoshop_shipping_calculator')) {
479 479
 	function jigoshop_shipping_calculator() {
480  
-		if (jigoshop_shipping::$enabled && get_option('jigoshop_enable_shipping_calc')=='yes' && jigoshop_cart::needs_shipping()) : 
  480
+		if (jigoshop_cart::needs_shipping()) : 
481 481
 		?>
482 482
 		<form class="shipping_calculator" action="<?php echo jigoshop_cart::get_cart_url(); ?>" method="post">
483 483
 			<h4><a href="#" class="shipping-calculator-button"><?php _e('Calculate Shipping', 'jigoshop'); ?> <span>&darr;</span></a></h4>
54  skeleton/loop-shop.php
... ...
@@ -0,0 +1,54 @@
  1
+<?php
  2
+
  3
+global $columns, $post, $per_page, $wp_query;
  4
+
  5
+do_action('jigoshop_before_shop_loop');
  6
+
  7
+$loop = 0;
  8
+
  9
+if (!isset($columns) || !$columns) $columns = apply_filters('loop_shop_columns', 3);
  10
+if (!isset($per_page) || !$per_page) $per_page = apply_filters('loop_shop_per_page', get_option('posts_per_page'));
  11
+
  12
+if ($per_page > get_option('posts_per_page')) query_posts( array_merge( $wp_query->query, array( 'posts_per_page' => $per_page ) ) );
  13
+
  14
+ob_start();
  15
+
  16
+if (have_posts()) : while (have_posts()) : the_post(); $_product = &new jigoshop_product( $post->ID ); $loop++;
  17
+	
  18
+	?>
  19
+	<li class="product <?php if ($loop%$columns==0) echo 'last'; if (($loop-1)%$columns==0) echo 'first'; ?>">
  20
+		
  21
+		<?php do_action('jigoshop_before_shop_loop_item'); ?>
  22
+		
  23
+		<a href="<?php the_permalink(); ?>">
  24
+			
  25
+			<strong><?php the_title(); ?></strong>
  26
+			
  27
+			<?php do_action('jigoshop_before_shop_loop_item_title', $post, $_product); ?>
  28
+			
  29
+			
  30
+			<?php do_action('jigoshop_after_shop_loop_item_title', $post, $_product); ?>
  31
+		
  32
+		</a>
  33
+
  34
+		<?php do_action('jigoshop_after_shop_loop_item', $post, $_product); ?>
  35
+		
  36
+	</li><?php 
  37
+	
  38
+	if ($loop==$per_page) break;
  39
+	
  40
+endwhile; endif;
  41
+
  42
+if ($loop==0) :
  43
+
  44
+	echo '<p class="info">'.__('No products found which match your selection.', 'jigoshop').'</p>'; 
  45
+	
  46
+else :
  47
+	
  48
+	$found_posts = ob_get_clean();
  49
+	
  50
+	echo '<ul class="products">' . $found_posts . '</ul><div class="clear"></div>';
  51
+	
  52
+endif;
  53
+
  54
+do_action('jigoshop_after_shop_loop');
6  skeleton/style.css
@@ -405,7 +405,7 @@ a.themeauthor {
405 405
 	-moz-box-shadow:1px 1px 6px #ddd;
406 406
 	box-shadow:1px 1px 6px #ddd;
407 407
 	position: relative;
408  
-	behavior: url('../wp-content/themes/presstige/css/PIE.php');
  408
+	behavior: url('../wp-content/themes/skeleton/css/PIE.php');
409 409
 }
410 410
 
411 411
 .wp-caption img {
@@ -1842,12 +1842,10 @@ img.scale-with-grid {
1842 1842
 /* #Forms (see formalize.css)
1843 1843
 ================================================== */
1844 1844
 
1845  
-	label,legend { font-weight: bold;font-size: 13px;font-weight: bold;font-size: 13px;
1846  
-	display: block;}
1847 1845
 
1848 1846
 	label,legend {
1849 1847
 	font-weight: bold;font-size: 13px;
1850  
-	display: block;
  1848
+	display: inline-block;
1851 1849
 	}
1852 1850
 	
1853 1851
 	input[type="checkbox"] {display: inline; }

0 notes on commit fc99fb5

Please sign in to comment.
Something went wrong with that request. Please try again.