woocommerce/templates/single-product/add-to-cart/external.php

19 lines
620 B
PHP
Raw Normal View History

2011-12-09 20:16:34 +00:00
<?php
/**
* External Add to Cart
*/
global $woocommerce, $product;
2011-12-09 22:44:03 +00:00
$product_url = get_post_meta( $product->id, '_product_url', true );
$button_text = get_post_meta( $product->id, '_button_text', true );
2011-12-09 22:44:03 +00:00
if (!$product_url) return;
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'); ?>
<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'); ?>