I just kind of quickly hacked something together as a suggestion. Here’s lines 633-648 of wp_shopping_cart.php
$replacement .= '<form method="post" class="wp-cart-button-form" action="" style="display:inline" onsubmit="return ReadForm(this, true);"' . apply_filters('wp_cart_form_attr_filter', "") . '>';
if (!empty($var_output)) {//Show variation
$replacement .= '<div class="wp_cart_variation_section">' . $var_output . '</div>';
}
if (isset($atts['button_image']) && !empty($atts['button_image'])) {
//Use the custom button image for this shortcode
$replacement .= '<input type="image" src="' . $atts['button_image'] . '" class="wp_cart_button" alt="' . (__("Add to Cart", "WSPSC")) . '"/>';
} else {
//Use the button text or image value from the settings
if (preg_match("/http:/", $addcart) || preg_match("/https:/", $addcart)) { // Use the image as the 'add to cart' button
$replacement .= '<input type="image" src="' . $addcart . '" class="wp_cart_button" alt="' . (__("Add to Cart", "WSPSC")) . '"/>';
} else {
$replacement .= '<input type="submit" value="' . apply_filters('wp_cart_button_filter', $addcart, $price) . '" />';
}
}
And then I can do something like:
add_filter('wp_cart_form_attr_filter', 'add_parent_action_to_iframe_forms', 10, 2);
function add_parent_action_to_iframe_forms($content) {
return 'target="_parent"';
}
add_filter('wp_cart_button_filter', 'form_button_text', 10, 2);
function form_button_text($addcart, $price) {
return $addcart . " for $" . $price;
}
Whaddaya think? Do you think something like this could be incorporated?