2011-12-09 20:16:34 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* External Add to Cart
|
|
|
|
*/
|
|
|
|
|
2011-12-11 14:40:25 +00:00
|
|
|
global $woocommerce, $product;
|
2011-12-09 22:44:03 +00:00
|
|
|
|
2011-12-24 16:57:36 +00:00
|
|
|
$product_url = get_post_meta( $product->id, '_product_url', true );
|
2012-02-24 16:05:17 +00:00
|
|
|
$button_text = get_post_meta( $product->id, '_button_text', true );
|
2011-12-09 22:44:03 +00:00
|
|
|
|
|
|
|
if (!$product_url) return;
|
2012-02-24 16:05:17 +00:00
|
|
|
if (!$button_text) $button_text = __('Buy product', 'woocommerce');
|
2011-12-09 20:16:34 +00:00
|
|
|
?>
|
|
|
|
|
|
|
|
<?php do_action('woocommerce_before_add_to_cart_button'); ?>
|
|
|
|
|
2012-02-24 16:05:17 +00:00
|
|
|
<p class="cart"><a href="<?php echo $product_url; ?>" rel="nofollow" class="button alt"><?php echo apply_filters('single_add_to_cart_text', $button_text, $product->product_type); ?></a></p>
|
2011-12-09 20:16:34 +00:00
|
|
|
|
|
|
|
<?php do_action('woocommerce_after_add_to_cart_button'); ?>
|