Beispiel #1
0
 /**
  * Is shipping information calculated and ready to use
  *
  * @since 3.8.14
  * @return boolean true if a recalc is necessary
  */
 function needs_shipping_recalc()
 {
     global $wpsc_shipping_modules;
     if (!wpsc_is_shipping_enabled()) {
         return false;
     }
     if ($this->shipping_info_empty() && $this->uses_shipping()) {
         return true;
     }
     $needs_shipping_recalc = false;
     $what_changed = _wpsc_visitor_location_what_changed();
     // TODO: this is where we will check the available shipping methods and see if
     // the parameters used to create the quotes have changes since the quotes where
     // created.  A function of the future shipping component
     if (array_key_exists('shippingpostcode', $what_changed)) {
         $custom_shipping = get_option('custom_shipping_options');
         foreach ((array) $custom_shipping as $shipping) {
             if (isset($wpsc_shipping_modules[$shipping]->needs_zipcode) && $wpsc_shipping_modules[$shipping]->needs_zipcode == true) {
                 $needs_shipping_recalc = true;
                 break;
             }
         }
     }
     // recalculate shipping if country changes
     if (array_key_exists('shippingcountry', $what_changed)) {
         $needs_shipping_recalc = true;
     }
     // recalculate shipping if region changes
     if (array_key_exists('shippingregion', $what_changed)) {
         $needs_shipping_recalc = true;
     }
     // recalculate shipping if state
     if (array_key_exists('shippingstate', $what_changed)) {
         $needs_shipping_recalc = true;
     }
     /*
      * filter: wpsc_needs_shipping_recalc
      *
      * If more processing is needed to determine if shipping really needs to
      * be recalculated it should be hooked on here.
      */
     return apply_filters('wpsc_needs_shipping_recalc', $needs_shipping_recalc, $this);
 }
/**
 * @param array $localizations
 *
 * @since 3.8.14.1
 *
 * @return array   localizations array with checkout information added
 */
function _wpsc_localize_checkout_related_options($localizations)
{
    $localizations['store_uses_shipping'] = wpsc_is_shipping_enabled();
    return $localizations;
}
Beispiel #3
0
echo count($this->columns) - 1;
?>
">
				<?php 
esc_html_e('Subtotal:', 'wpsc');
?>
<br />
			</th>
			<td><?php 
echo wpsc_format_currency($this->get_subtotal());
?>
</td>
		</tr>

<?php 
if (wpsc_is_shipping_enabled()) {
    ?>
		<tr <?php 
    $this->show_shipping_style();
    ?>
 class="wpsc-cart-aggregate wpsc-cart-shipping-row">
			<th scope="row" colspan="<?php 
    echo count($this->columns) - 1;
    ?>
">
				<?php 
    esc_html_e('Shipping:', 'wpsc');
    ?>
<br />
			</th>
			<td>