Now I am really confused. It seemed to me I applied the method properly in this code
PHP Code:
add_action('wpsc_before_form_of_shopping_cart', 'add_my_totals');
function add_my_totals() {
$my_new_totals = '<table class="wpsc_checkout_table table-10">
<tr class="total_price my-totals">
<td class="wpsc_totals my-totals-pad">' .
_e('Total Price including Shipping and Tax:', 'wpsc') .
'</td>
<td class="wpsc_totals">
<span id="checkout_total" class="pricedisplay checkout-total">' . wpsc_cart_total(); '</span>
</td>
</tr>
</table>';
echo $my_new_totals;
}
But the resulting HTML from the page source is this with the text outside the table completely!
HTML Code:
Total Price including Shipping and Tax:
<table class="wpsc_checkout_table table-10">
<tbody>
<tr class="total_price my-totals">
<td class="wpsc_totals my-totals-pad"></td>
<td class="wpsc_totals"><span class="pricedisplay checkout-total" id="checkout_total"><span class="pricedisplay">$32.48</span></span></td>
</tr>
</tbody>
</table>
I did get it to work using felgall's method
PHP Code:
add_action('wpsc_before_form_of_shopping_cart', 'add_my_totals');
function add_my_totals() {
?><table class="wpsc_checkout_table table-10">
<tr class="total_price my-totals">
<td class="wpsc_totals my-totals-pad">
<?php _e("Total Price including Shipping and Tax", "wpsc") ?>
</td>
<td class="wpsc_totals">
<span id="checkout_total" class="pricedisplay checkout-total"><?php wpsc_cart_total(); ?></span>
</td>
</tr>
</table>
<?php echo $my_new_totals;
}
?>
Bookmarks