PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 1.1.0
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v1.1.0
4.9.1 4.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.1 3.0.0 3.1.0 3.1.1 4.0.0 4.0.1 4.1.0 4.1.1 4.2.0 4.2.1 4.3.0 4.3.1 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.6.8 4.6.9 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.7.6 4.7.7 4.7.8 4.7.9 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.8.5 4.8.6 4.8.7 4.8.8 4.8.9 trunk 0.1.2-beta 0.1.3-beta 0.1.4-beta 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.8.0 1.8.1 1.9.0
shopengine / widgets / prod-short-code.php
shopengine / widgets Last commit date
account-address 4 years ago account-dashboard 4 years ago account-details 4 years ago account-downloads 4 years ago account-form-login 4 years ago account-form-register 4 years ago account-logout 4 years ago account-navigation 4 years ago account-order-details 4 years ago account-orders 4 years ago add-to-cart 4 years ago additional-information 4 years ago advanced-search 4 years ago archive-description 4 years ago archive-products 4 years ago archive-result-count 4 years ago archive-title 4 years ago archive-view-mode 4 years ago breadcrumbs 4 years ago cart-table 4 years ago cart-totals 4 years ago categories 4 years ago checkout-coupon-form 4 years ago checkout-form-additional 4 years ago checkout-form-billing 4 years ago checkout-form-login 4 years ago checkout-form-shipping 4 years ago checkout-payment 4 years ago checkout-review-order 4 years ago checkout-shipping-methods 4 years ago cross-sells 4 years ago deal-products 4 years ago empty-cart-message 4 years ago filter-orderby 4 years ago filter-products-per-page 4 years ago filterable-product-list 4 years ago init 4 years ago product-categories 4 years ago product-category-lists 4 years ago product-description 4 years ago product-excerpt 4 years ago product-filters 4 years ago product-image 4 years ago product-list 4 years ago product-meta 4 years ago product-price 4 years ago product-rating 4 years ago product-review 4 years ago product-share 4 years ago product-sku 4 years ago product-stock 4 years ago product-tabs 4 years ago product-tags 4 years ago product-title 4 years ago recently-viewed-products 4 years ago related 4 years ago return-to-shop 4 years ago thankyou-address-details 4 years ago thankyou-order-confirm 4 years ago thankyou-order-details 4 years ago thankyou-thankyou 4 years ago up-sells 4 years ago lazy-cache.php 4 years ago manifest.php 4 years ago prod-short-code.php 5 years ago products.php 4 years ago shop.php 5 years ago widget-helper.php 4 years ago
prod-short-code.php
65 lines
1 <?php
2
3 namespace ShopEngine\Widgets;
4
5
6 class Prod_Short_Code extends \WC_Shortcode_Products {
7
8 public function __construct($settings = array(), $type = 'products') {
9
10 $this->settings = $settings;
11 $this->type = $type;
12
13 $this->attributes = $this->parse_attributes([
14 'columns' => $settings['shopengine_columns'],
15 'rows' => $settings['shopengine_rows'],
16 'paginate' => $settings['shopengine_paginate'],
17 'cache' => false,
18 ]);
19
20 $this->query_args = $this->parse_query_args();
21 }
22
23
24 protected function parse_query_args() {
25
26 $query_args = [
27 'post_type' => 'product',
28 'post_status' => 'publish',
29 'ignore_sticky_posts' => true,
30 'no_found_rows' => false === wc_string_to_bool($this->attributes['paginate']),
31 ];
32
33 $settings = $this->settings;
34
35 if($settings['shopengine_paginate'] === 'yes') {
36
37 $page = empty( $_GET['product-page'] ) ? 1 : absint($_GET['product-page']);
38
39 if ($page > 1) {
40 $query_args['paged'] = $page;
41 }
42
43 $ord_arg = WC()->query->get_catalog_ordering_args();
44
45 $query_args['orderby'] = $ord_arg['orderby'];
46 $query_args['order'] = $ord_arg['order'];
47 }
48
49
50 $query_args['fields'] = 'ids';
51 $query_args['post_type'] = 'product';
52 $query_args['posts_per_page'] = intval($settings['shopengine_columns'] * $settings['shopengine_rows']);
53
54
55 return $query_args;
56 }
57
58
59 protected function get_query_results() {
60
61 $results = parent::get_query_results();
62
63 return $results;
64 }
65 }