File "class-wc-product-simple.php"
Full path: /home/kosmetik/public_html/wp-content/plugins/woocommerce/includes/class-wc-product-simple.php
File
size: 1.31 B
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php
defined('ABSPATH') || exit;
class WC_Product_Simple extends WC_Product
{
public function __construct($product = 0)
{
$this->supports[] = 'ajax_add_to_cart';
parent::__construct($product);
}
public function get_type()
{
return 'simple';
}
public function add_to_cart_url()
{
$url = $this->is_purchasable() && $this->is_in_stock() ? remove_query_arg('added-to-cart', add_query_arg(array('add-to-cart' => $this->get_id()), function_exists('is_feed') && is_feed() || function_exists('is_404') && is_404() ? $this->get_permalink() : '')) : $this->get_permalink();
return apply_filters('woocommerce_product_add_to_cart_url', $url, $this);
}
public function add_to_cart_text()
{
$text = $this->is_purchasable() && $this->is_in_stock() ? __('Add to cart', 'woocommerce') : __('Read more', 'woocommerce');
return apply_filters('woocommerce_product_add_to_cart_text', $text, $this);
}
public function add_to_cart_description()
{
$text = $this->is_purchasable() && $this->is_in_stock() ? __('Add “%s” to your cart', 'woocommerce') : __('Read more about “%s”', 'woocommerce');
return apply_filters('woocommerce_product_add_to_cart_description', sprintf($text, $this->get_name()), $this);
}
}