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0-beta.1 3.2.2 6.3.0-rc.1 3.2.3 6.3.0-rc.2 3.2.4 6.3.1 3.2.5 6.3.2 3.2.6 6.4.0 3.3.0 6.4.0-beta.1 3.3.1 6.4.0-rc.1 3.3.2 6.4.1 3.3.2-rc.1 6.4.2 3.3.3 6.5.0 3.3.4 6.5.0-beta.1 3.3.5 6.5.0-rc.1 3.3.6 6.5.0-rc.2 3.4.0 6.5.1 3.4.0-beta.1 6.5.2 3.4.0-rc.2 6.6.0 3.4.1 6.6.0-beta.1 3.4.2 6.6.0-rc.1 3.4.3 6.6.0-rc.2 3.4.4 6.6.1 3.4.5 6.6.2 3.4.6 6.7.0 3.4.7 6.7.0-beta.1 3.4.8 6.7.0-beta.2 3.5.0 6.7.0-rc.1 3.5.0-beta.1 6.7.1 3.5.0-rc.1 6.8.0 3.5.0-rc.2 6.8.0-beta.1 3.5.1 6.8.0-beta.2 3.5.10 6.8.0-rc.1 3.5.2 6.8.1 3.5.3 6.8.2 3.5.4 6.8.3 3.5.5 6.9.0 3.5.6 6.9.0-beta.1 3.5.7 6.9.0-beta.2 3.5.8 6.9.0-rc.1 3.5.9 6.9.1 3.6.0 6.9.2 3.6.0-beta.1 6.9.3 3.6.0-rc.1 6.9.4 3.6.0-rc.2 6.9.5 3.6.0-rc.3 7.0.0 3.6.1 7.0.0-beta.1 3.6.2 7.0.0-beta.2 3.6.3 7.0.0-beta.3 3.6.4 7.0.0-rc.1 3.6.5 7.0.0-rc.2 3.6.6 7.0.1 3.6.7 7.0.2 3.7.0 7.1.0 3.7.0-beta.1 7.1.0-beta.1 3.7.0-rc.1 7.1.0-beta.2 3.7.0-rc.2 7.1.0-rc.1 3.7.1 7.1.0-rc.2 3.7.2 7.1.1
woocommerce / includes / class-wc-product-attribute.php
woocommerce / includes Last commit date
abstracts 6 years ago admin 6 years ago cli 7 years ago customizer 8 years ago data-stores 6 years ago emails 6 years ago export 6 years ago gateways 6 years ago import 6 years ago integrations 6 years ago interfaces 6 years ago legacy 6 years ago libraries 6 years ago log-handlers 7 years ago payment-tokens 8 years ago queue 7 years ago shipping 6 years ago shortcodes 6 years ago theme-support 6 years ago tracks 6 years ago traits 6 years ago walkers 8 years ago wccom-site 6 years ago widgets 6 years ago class-wc-ajax.php 6 years ago class-wc-api.php 6 years ago class-wc-auth.php 7 years ago class-wc-autoloader.php 6 years ago class-wc-background-emailer.php 8 years ago class-wc-background-updater.php 7 years ago class-wc-breadcrumb.php 7 years ago class-wc-cache-helper.php 6 years ago class-wc-cart-fees.php 6 years ago class-wc-cart-session.php 6 years ago class-wc-cart-totals.php 6 years ago class-wc-cart.php 6 years ago class-wc-checkout.php 6 years ago class-wc-cli.php 8 years ago class-wc-comments.php 6 years ago class-wc-countries.php 6 years ago class-wc-coupon.php 6 years ago class-wc-customer-download-log.php 8 years ago class-wc-customer-download.php 6 years ago class-wc-customer.php 7 years ago class-wc-data-exception.php 8 years ago class-wc-data-store.php 6 years ago class-wc-datetime.php 7 years ago class-wc-deprecated-action-hooks.php 8 years ago class-wc-deprecated-filter-hooks.php 7 years ago class-wc-discounts.php 6 years ago class-wc-download-handler.php 6 years ago class-wc-emails.php 6 years ago class-wc-embed.php 8 years ago class-wc-form-handler.php 6 years ago class-wc-frontend-scripts.php 6 years ago class-wc-geo-ip.php 8 years ago class-wc-geolite-integration.php 6 years ago class-wc-geolocation.php 6 years ago class-wc-https.php 8 years ago class-wc-install.php 6 years ago class-wc-integrations.php 6 years ago class-wc-log-levels.php 7 years ago class-wc-logger.php 7 years ago class-wc-meta-data.php 7 years ago class-wc-order-factory.php 6 years ago class-wc-order-item-coupon.php 7 years ago class-wc-order-item-fee.php 7 years ago class-wc-order-item-meta.php 7 years ago class-wc-order-item-product.php 6 years ago class-wc-order-item-shipping.php 7 years ago class-wc-order-item-tax.php 6 years ago class-wc-order-item.php 6 years ago class-wc-order-query.php 7 years ago class-wc-order-refund.php 8 years ago class-wc-order.php 6 years ago class-wc-payment-gateways.php 7 years ago class-wc-payment-tokens.php 6 years ago class-wc-post-data.php 6 years ago class-wc-post-types.php 7 years ago class-wc-privacy-background-process.php 8 years ago class-wc-privacy-erasers.php 8 years ago class-wc-privacy-exporters.php 7 years ago class-wc-privacy.php 7 years ago class-wc-product-attribute.php 7 years ago class-wc-product-download.php 7 years ago class-wc-product-external.php 8 years ago class-wc-product-factory.php 7 years ago class-wc-product-grouped.php 8 years ago class-wc-product-query.php 7 years ago class-wc-product-simple.php 6 years ago class-wc-product-variable.php 6 years ago class-wc-product-variation.php 7 years ago class-wc-query.php 6 years ago class-wc-rate-limiter.php 6 years ago class-wc-regenerate-images-request.php 7 years ago class-wc-regenerate-images.php 7 years ago class-wc-register-wp-admin-settings.php 8 years ago class-wc-rest-authentication.php 6 years ago class-wc-rest-exception.php 6 years ago class-wc-session-handler.php 6 years ago class-wc-shipping-rate.php 8 years ago class-wc-shipping-zone.php 6 years ago class-wc-shipping-zones.php 8 years ago class-wc-shipping.php 6 years ago class-wc-shortcodes.php 6 years ago class-wc-structured-data.php 6 years ago class-wc-tax.php 6 years ago class-wc-template-loader.php 7 years ago class-wc-tracker.php 6 years ago class-wc-validation.php 6 years ago class-wc-webhook.php 6 years ago class-woocommerce.php 6 years ago wc-account-functions.php 6 years ago wc-attribute-functions.php 6 years ago wc-cart-functions.php 6 years ago wc-conditional-functions.php 6 years ago wc-core-functions.php 6 years ago wc-coupon-functions.php 7 years ago wc-deprecated-functions.php 7 years ago wc-formatting-functions.php 6 years ago wc-notice-functions.php 6 years ago wc-order-functions.php 6 years ago wc-order-item-functions.php 6 years ago wc-page-functions.php 6 years ago wc-product-functions.php 6 years ago wc-rest-functions.php 7 years ago wc-stock-functions.php 6 years ago wc-template-functions.php 6 years ago wc-template-hooks.php 6 years ago wc-term-functions.php 6 years ago wc-update-functions.php 6 years ago wc-user-functions.php 6 years ago wc-webhook-functions.php 7 years ago wc-widget-functions.php 8 years ago
class-wc-product-attribute.php
330 lines
1 <?php
2 /**
3 * Represents a product attribute
4 *
5 * Attributes can be global (taxonomy based) or local to the product itself.
6 * Uses ArrayAccess to be BW compatible with previous ways of reading attributes.
7 *
8 * @package WooCommerce/Classes
9 * @version 3.0.0
10 * @since 3.0.0
11 */
12
13 defined( 'ABSPATH' ) || exit;
14
15 /**
16 * Product attribute class.
17 */
18 class WC_Product_Attribute implements ArrayAccess {
19
20 /**
21 * Data array.
22 *
23 * @since 3.0.0
24 * @var array
25 */
26 protected $data = array(
27 'id' => 0,
28 'name' => '',
29 'options' => array(),
30 'position' => 0,
31 'visible' => false,
32 'variation' => false,
33 );
34
35 /**
36 * Return if this attribute is a taxonomy.
37 *
38 * @return boolean
39 */
40 public function is_taxonomy() {
41 return 0 < $this->get_id();
42 }
43
44 /**
45 * Get taxonomy name if applicable.
46 *
47 * @return string
48 */
49 public function get_taxonomy() {
50 return $this->is_taxonomy() ? $this->get_name() : '';
51 }
52
53 /**
54 * Get taxonomy object.
55 *
56 * @return array|null
57 */
58 public function get_taxonomy_object() {
59 global $wc_product_attributes;
60 return $this->is_taxonomy() ? $wc_product_attributes[ $this->get_name() ] : null;
61 }
62
63 /**
64 * Gets terms from the stored options.
65 *
66 * @return array|null
67 */
68 public function get_terms() {
69 if ( ! $this->is_taxonomy() || ! taxonomy_exists( $this->get_name() ) ) {
70 return null;
71 }
72 $terms = array();
73 foreach ( $this->get_options() as $option ) {
74 if ( is_int( $option ) ) {
75 $term = get_term_by( 'id', $option, $this->get_name() );
76 } else {
77 // Term names get escaped in WP. See sanitize_term_field.
78 $term = get_term_by( 'name', $option, $this->get_name() );
79
80 if ( ! $term || is_wp_error( $term ) ) {
81 $new_term = wp_insert_term( $option, $this->get_name() );
82 $term = is_wp_error( $new_term ) ? false : get_term_by( 'id', $new_term['term_id'], $this->get_name() );
83 }
84 }
85 if ( $term && ! is_wp_error( $term ) ) {
86 $terms[] = $term;
87 }
88 }
89 return $terms;
90 }
91
92 /**
93 * Gets slugs from the stored options, or just the string if text based.
94 *
95 * @return array
96 */
97 public function get_slugs() {
98 if ( ! $this->is_taxonomy() || ! taxonomy_exists( $this->get_name() ) ) {
99 return $this->get_options();
100 }
101 $terms = array();
102 foreach ( $this->get_options() as $option ) {
103 if ( is_int( $option ) ) {
104 $term = get_term_by( 'id', $option, $this->get_name() );
105 } else {
106 $term = get_term_by( 'name', $option, $this->get_name() );
107
108 if ( ! $term || is_wp_error( $term ) ) {
109 $new_term = wp_insert_term( $option, $this->get_name() );
110 $term = is_wp_error( $new_term ) ? false : get_term_by( 'id', $new_term['term_id'], $this->get_name() );
111 }
112 }
113 if ( $term && ! is_wp_error( $term ) ) {
114 $terms[] = $term->slug;
115 }
116 }
117 return $terms;
118 }
119
120 /**
121 * Returns all data for this object.
122 *
123 * @return array
124 */
125 public function get_data() {
126 return array_merge(
127 $this->data,
128 array(
129 'is_visible' => $this->get_visible() ? 1 : 0,
130 'is_variation' => $this->get_variation() ? 1 : 0,
131 'is_taxonomy' => $this->is_taxonomy() ? 1 : 0,
132 'value' => $this->is_taxonomy() ? '' : wc_implode_text_attributes( $this->get_options() ),
133 )
134 );
135 }
136
137 /*
138 |--------------------------------------------------------------------------
139 | Setters
140 |--------------------------------------------------------------------------
141 */
142
143 /**
144 * Set ID (this is the attribute ID).
145 *
146 * @param int $value Attribute ID.
147 */
148 public function set_id( $value ) {
149 $this->data['id'] = absint( $value );
150 }
151
152 /**
153 * Set name (this is the attribute name or taxonomy).
154 *
155 * @param int $value Attribute name.
156 */
157 public function set_name( $value ) {
158 $this->data['name'] = $value;
159 }
160
161 /**
162 * Set options.
163 *
164 * @param array $value Attribute options.
165 */
166 public function set_options( $value ) {
167 $this->data['options'] = $value;
168 }
169
170 /**
171 * Set position.
172 *
173 * @param int $value Attribute position.
174 */
175 public function set_position( $value ) {
176 $this->data['position'] = absint( $value );
177 }
178
179 /**
180 * Set if visible.
181 *
182 * @param bool $value If is visible on Product's additional info tab.
183 */
184 public function set_visible( $value ) {
185 $this->data['visible'] = wc_string_to_bool( $value );
186 }
187
188 /**
189 * Set if variation.
190 *
191 * @param bool $value If is used for variations.
192 */
193 public function set_variation( $value ) {
194 $this->data['variation'] = wc_string_to_bool( $value );
195 }
196
197 /*
198 |--------------------------------------------------------------------------
199 | Getters
200 |--------------------------------------------------------------------------
201 */
202
203 /**
204 * Get the ID.
205 *
206 * @return int
207 */
208 public function get_id() {
209 return $this->data['id'];
210 }
211
212 /**
213 * Get name.
214 *
215 * @return string
216 */
217 public function get_name() {
218 return $this->data['name'];
219 }
220
221 /**
222 * Get options.
223 *
224 * @return array
225 */
226 public function get_options() {
227 return $this->data['options'];
228 }
229
230 /**
231 * Get position.
232 *
233 * @return int
234 */
235 public function get_position() {
236 return $this->data['position'];
237 }
238
239 /**
240 * Get if visible.
241 *
242 * @return bool
243 */
244 public function get_visible() {
245 return $this->data['visible'];
246 }
247
248 /**
249 * Get if variation.
250 *
251 * @return bool
252 */
253 public function get_variation() {
254 return $this->data['variation'];
255 }
256
257 /*
258 |--------------------------------------------------------------------------
259 | ArrayAccess/Backwards compatibility.
260 |--------------------------------------------------------------------------
261 */
262
263 /**
264 * OffsetGet.
265 *
266 * @param string $offset Offset.
267 * @return mixed
268 */
269 public function offsetGet( $offset ) {
270 switch ( $offset ) {
271 case 'is_variation':
272 return $this->get_variation() ? 1 : 0;
273 case 'is_visible':
274 return $this->get_visible() ? 1 : 0;
275 case 'is_taxonomy':
276 return $this->is_taxonomy() ? 1 : 0;
277 case 'value':
278 return $this->is_taxonomy() ? '' : wc_implode_text_attributes( $this->get_options() );
279 default:
280 if ( is_callable( array( $this, "get_$offset" ) ) ) {
281 return $this->{"get_$offset"}();
282 }
283 break;
284 }
285 return '';
286 }
287
288 /**
289 * OffsetSet.
290 *
291 * @param string $offset Offset.
292 * @param mixed $value Value.
293 */
294 public function offsetSet( $offset, $value ) {
295 switch ( $offset ) {
296 case 'is_variation':
297 $this->set_variation( $value );
298 break;
299 case 'is_visible':
300 $this->set_visible( $value );
301 break;
302 case 'value':
303 $this->set_options( $value );
304 break;
305 default:
306 if ( is_callable( array( $this, "set_$offset" ) ) ) {
307 return $this->{"set_$offset"}( $value );
308 }
309 break;
310 }
311 }
312
313 /**
314 * OffsetUnset.
315 *
316 * @param string $offset Offset.
317 */
318 public function offsetUnset( $offset ) {}
319
320 /**
321 * OffsetExists.
322 *
323 * @param string $offset Offset.
324 * @return bool
325 */
326 public function offsetExists( $offset ) {
327 return in_array( $offset, array_merge( array( 'is_variation', 'is_visible', 'is_taxonomy', 'value' ), array_keys( $this->data ) ), true );
328 }
329 }
330