PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.4.14
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.4.14
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 1.3.45 All 177 releases
disco / app / Utility / Model.php

Model.php in Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO 1.4.14, at app/Utility/Model.php

52 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * DB Model Utility
4 *
5 * @package Disco
6 * @subpackage App\Utility
7 * @since 1.0.0
8 * @category Utility
9 */
10
11 namespace Disco\App\Utility;
12
13 /**
14 * Class Model
15 *
16 * @package Disco
17 * @subpackage App\Utility
18 * @author Ohidul Islam <wahid0003@gmail.com>
19 * @link https://webappick.com
20 * @license https://opensource.org/licenses/gpl-license.php GNU Public License
21 * @category Utility
22 */
23 class Model {
24
25 /**
26 * Get all product attributes.
27 *
28 * @param string $like Search Term.
29 * @return array
30 */
31 public function wc_global_attribute_query( $like = '' ) {
32 global $wpdb;
33 $query = $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}woocommerce_attribute_taxonomies WHERE attribute_name != '' AND attribute_name LIKE %s", $like . '%' );
34
35 return $wpdb->get_results( $query ); //phpcs:ignore
36 }
37
38 /**
39 * Get all product custom attributes.
40 *
41 * @param string $like Search Term.
42 * @return array
43 */
44 public function wc_custom_attribute_query( $like = '' ) {
45 global $wpdb;
46 $query = $wpdb->prepare( 'SELECT meta.meta_id, meta.meta_key as name, meta.meta_value as type FROM ' . $wpdb->postmeta . ' AS meta, ' . $wpdb->posts . " AS posts WHERE meta.post_id = posts.id AND posts.post_type LIKE %s AND meta.meta_key='_product_attributes'", $like . '%' );
47
48 return $wpdb->get_results( $query ); //phpcs:ignore
49 }
50
51 }
52