2012-11-21 18:07:45 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* External Product Class
|
|
|
|
*
|
2012-11-29 16:48:40 +00:00
|
|
|
* External products cannot be bought; they link offsite. Extends simple products.
|
2012-11-21 18:07:45 +00:00
|
|
|
*
|
2012-11-22 10:22:18 +00:00
|
|
|
* @class WC_Product_External
|
2012-12-03 19:19:58 +00:00
|
|
|
* @version 2.0.0
|
2012-11-21 18:07:45 +00:00
|
|
|
* @package WooCommerce/Classes/Products
|
|
|
|
* @author WooThemes
|
|
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
|
|
|
2013-02-13 09:29:00 +00:00
|
|
|
class WC_Product_External extends WC_Product {
|
2012-11-29 16:48:40 +00:00
|
|
|
|
2012-11-21 18:07:45 +00:00
|
|
|
/**
|
|
|
|
* __construct function.
|
2012-11-27 16:22:47 +00:00
|
|
|
*
|
2012-11-21 18:07:45 +00:00
|
|
|
* @access public
|
|
|
|
* @param mixed $product
|
|
|
|
*/
|
2012-12-19 23:04:25 +00:00
|
|
|
public function __construct( $product ) {
|
2012-12-20 11:54:38 +00:00
|
|
|
$this->product_type = 'external';
|
2012-12-19 23:04:25 +00:00
|
|
|
parent::__construct( $product );
|
2012-11-21 18:07:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns false if the product cannot be bought.
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return cool
|
|
|
|
*/
|
2012-12-14 21:49:46 +00:00
|
|
|
public function is_purchasable() {
|
2012-11-21 18:07:45 +00:00
|
|
|
return apply_filters( 'woocommerce_is_purchasable', false, $this );
|
|
|
|
}
|
2012-11-29 16:48:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* get_product_url function.
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2012-12-14 21:49:46 +00:00
|
|
|
public function get_product_url() {
|
2012-11-29 16:48:40 +00:00
|
|
|
return $this->product_url;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get_button_text function.
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2012-12-14 21:49:46 +00:00
|
|
|
public function get_button_text() {
|
2012-11-29 16:48:40 +00:00
|
|
|
return $this->button_text ? $this->button_text : __( 'Buy product', 'woocommerce' );
|
|
|
|
}
|
2012-11-21 18:07:45 +00:00
|
|
|
}
|