PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.1.9
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.1.9
1.4.15 1.4.14 1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.54 1.3.53 1.3.52 1.3.51 1.3.50 1.3.49 1.3.48 1.3.47 1.3.46 All 178 releases
disco / app / DropDown / AttributeDropDown.php

AttributeDropDown.php in Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO 1.1.9, at app/DropDown/AttributeDropDown.php

54 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Disco\App\DropDown;
4
5 /**
6 * Class DropDown
7 *
8 * @package CTXFeed
9 * @subpackage app\DropDown
10 * @author Ohidul Islam <wahid0003@gmail.com>
11 * @link https://webappick.com
12 * @license https://opensource.org/licenses/gpl-license.php GNU Public License
13 * @category MyCategory
14 */
15 class AttributeDropDown {
16
17 /**
18 * Get WooCommerce Attributes.
19 *
20 * @return array
21 * @throws \Exception Exception.
22 */
23 public static function get_global_attributes() {
24 $taxonomies = array();
25 $global_attributes = wc_get_attribute_taxonomy_labels();
26
27 if ( count( $global_attributes ) ) {
28 foreach ( $global_attributes as $key => $value ) {
29 $taxonomies[sprintf( 'global_attribute_pa_%s', $key )] = DropDown::prepare_filters(
30 $value,
31 'select',
32 array(
33 'type' => 'select',
34 'option_type' => 'manual',
35 'multiple' => true,
36 'options' => get_terms(
37 array(
38 'taxonomy' => 'pa_' . $key,
39 'fields' => 'id=>name',
40 )
41 ),
42 )
43 );
44 }
45 }
46
47 return array(
48 'optionGroup' => esc_html__( 'Product Attributes', 'disco' ),
49 'options' => $taxonomies,
50 );
51 }
52
53 }
54