function edd_wallet_process_incentive()
{
    if ($_REQUEST['gateway'] == 'wallet') {
        EDD()->session->set('wallet_has_incentives', '1');
    } else {
        EDD()->session->set('wallet_has_incentives', null);
    }
    // Refresh the cart
    if (empty($_POST['billing_country'])) {
        $_POST['billing_country'] = edd_get_shop_country();
    }
    ob_start();
    edd_checkout_cart();
    $cart = ob_get_clean();
    $response = array('html' => $cart, 'tax_raw' => edd_get_cart_tax(), 'tax' => html_entity_decode(edd_cart_tax(false), ENT_COMPAT, 'UTF-8'), 'tax_rate_raw' => edd_get_tax_rate(), 'tax_rate' => html_entity_decode(edd_get_formatted_tax_rate(), ENT_COMPAT, 'UTF-8'), 'total' => html_entity_decode(edd_cart_total(false), ENT_COMPAT, 'UTF-8'), 'total_raw' => edd_get_cart_total());
    echo json_encode($response);
    edd_die();
}
 /**
  * Update the shipping costs via ajax
  *
  * This fires when the customer changes the country they are shipping to
  *
  * @since 1.0
  *
  * @access private
  * @return void
  */
 public function ajax_shipping_rate()
 {
     // Calculate new shipping
     $shipping = $this->apply_shipping_fees();
     ob_start();
     edd_checkout_cart();
     $cart = ob_get_clean();
     $response = array('html' => $cart, 'total' => html_entity_decode(edd_cart_total(false), ENT_COMPAT, 'UTF-8'));
     echo json_encode($response);
     die;
 }
示例#3
0
		<?php 
}
?>

		<tr class="edd_cart_footer_row">
			<?php 
do_action('edd_checkout_table_footer_first');
?>
			<th colspan="<?php 
echo edd_checkout_cart_columns();
?>
" class="edd_cart_total"><?php 
esc_html_e('Total', 'helium');
?>
: <span class="edd_cart_amount" data-subtotal="<?php 
echo edd_get_cart_total();
?>
" data-total="<?php 
echo edd_get_cart_total();
?>
"><?php 
edd_cart_total();
?>
</span></th>
			<?php 
do_action('edd_checkout_table_footer_last');
?>
		</tr>
	</tfoot>
</table>
/**
 * Shows the final purchase total at the bottom of the checkout page
 *
 * @since 1.5
 * @return void
 */
function edd_checkout_final_total()
{
    ?>
<p id="edd_final_total_wrap">
	<strong><?php 
    _e('Purchase Total:', 'edd');
    ?>
</strong>
	<span class="edd_cart_amount" data-subtotal="<?php 
    echo edd_get_cart_subtotal();
    ?>
" data-total="<?php 
    echo edd_get_cart_subtotal();
    ?>
"><?php 
    edd_cart_total();
    ?>
</span>
</p>
<?php 
}
/**
 * Recalculate cart taxes
 *
 * @since 1.6
 * @return void
 */
function edd_ajax_recalculate_taxes()
{
    if (!edd_get_cart_contents()) {
        return false;
    }
    if (empty($_POST['billing_country'])) {
        $_POST['billing_country'] = edd_get_shop_country();
    }
    ob_start();
    edd_checkout_cart();
    $cart = ob_get_clean();
    $response = array('html' => $cart, 'tax_raw' => edd_get_cart_tax(), 'tax' => html_entity_decode(edd_cart_tax(false), ENT_COMPAT, 'UTF-8'), 'tax_rate_raw' => edd_get_tax_rate(), 'tax_rate' => html_entity_decode(edd_get_formatted_tax_rate(), ENT_COMPAT, 'UTF-8'), 'total' => html_entity_decode(edd_cart_total(false), ENT_COMPAT, 'UTF-8'), 'total_raw' => edd_get_cart_total());
    echo json_encode($response);
    edd_die();
}
				<?php do_action( 'edd_checkout_table_subtotal_last' ); ?>
			</tr>
		<?php endif; ?>

		<tr class="edd_cart_footer_row edd_cart_discount_row" <?php if( ! edd_cart_has_discounts() )  echo ' style="display:none;"'; ?>>
			<?php do_action( 'edd_checkout_table_discount_first' ); ?>
			<th colspan="<?php echo edd_checkout_cart_columns(); ?>" class="edd_cart_discount">
				<?php edd_cart_discounts_html(); ?>
			</th>
			<?php do_action( 'edd_checkout_table_discount_last' ); ?>
		</tr>

		<?php if( edd_use_taxes() ) : ?>
			<tr class="edd_cart_footer_row edd_cart_tax_row"<?php if( ! edd_is_cart_taxed() ) echo ' style="display:none;"'; ?>>
				<?php do_action( 'edd_checkout_table_tax_first' ); ?>
				<th colspan="<?php echo edd_checkout_cart_columns(); ?>" class="edd_cart_tax">
					<?php _e( 'Tax', 'edd' ); ?>:&nbsp;<span class="edd_cart_tax_amount" data-tax="<?php echo edd_get_cart_tax( false ); ?>"><?php echo esc_html( edd_cart_tax() ); ?></span>
				</th>
				<?php do_action( 'edd_checkout_table_tax_last' ); ?>
			</tr>

		<?php endif; ?>

		<tr class="edd_cart_footer_row">
			<?php do_action( 'edd_checkout_table_footer_first' ); ?>
			<th colspan="<?php echo edd_checkout_cart_columns(); ?>" class="edd_cart_total"><?php _e( 'Total', 'edd' ); ?>: <span class="edd_cart_amount" data-subtotal="<?php echo edd_get_cart_total(); ?>" data-total="<?php echo edd_get_cart_total(); ?>"><?php edd_cart_total(); ?></span></th>
			<?php do_action( 'edd_checkout_table_footer_last' ); ?>
		</tr>
	</tfoot>
</table>
/**
 * Opt out of local taxes via AJAX
 *
 * @since 1.4.1
 * @return void
 */
function edd_ajax_opt_out_local_taxes()
{
    if (!check_ajax_referer('edd_checkout_nonce', 'nonce')) {
        return false;
    }
    edd_opt_out_local_taxes();
    ob_start();
    edd_checkout_cart();
    $cart = ob_get_contents();
    ob_end_clean();
    $response = array('html' => $cart, 'total' => html_entity_decode(edd_cart_total(false), ENT_COMPAT, 'UTF-8'));
    echo json_encode($response);
    edd_die();
}
示例#8
0
 /**
  * Return woocommerce cart total (e.g. $5.99)
  *
  * @since 1.3.3
  * @return string
  */
 public function shortcode_edd_cart_total()
 {
     if (function_exists('edd_cart_total')) {
         return "<span class='mega-menu-edd-cart-total'>" . edd_cart_total(false) . "</span>";
     }
 }
/**
 * Shows the final purchase total at the bottom of the checkout page
 *
 * @since 1.5
 * @return void
 */
function edd_checkout_final_total()
{
    ?>
	<fieldset id="edd_purchase_final_total">
		<p id="edd_final_total_wrap">
			<strong><?php 
    _e('Purchase Total:', 'edd');
    ?>
</strong>
			<span class="edd_cart_amount" data-subtotal="<?php 
    echo edd_get_cart_amount(false);
    ?>
" data-total="<?php 
    echo edd_get_cart_amount(true, true);
    ?>
"><?php 
    edd_cart_total();
    ?>
</span>
		</p>
	</fieldset>
<?php 
}
			<th class="edd_cart_tax">
				<?php 
_e('VAT', 'yoastcom');
?>
				(<span id="yst_secondary_tax_rate"><?php 
echo esc_html(edd_get_tax_rate());
?>
</span>%)
			</th>
			<th class="edd_cart_item_price">
				<span class="edd_cart_tax_amount" id="yst_secondary_tax"><?php 
echo esc_html(edd_cart_tax());
?>
</span>
			</th>
		</tr>
		<tr>
			<th><?php 
_e('Total', 'yoastcom');
?>
:</th>
			<th class="edd_cart_amount"><?php 
echo esc_html(edd_cart_total(false));
?>
</th>
		</tr>
	</table>
</div>
<div class="clear"></div>
<br />
<?php 
function download_checkout_total_function($atts, $content)
{
    return edd_cart_total(false);
}