PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.2.1
ShopBuilder – WooCommerce Builder For Elementor v2.2.1
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Controllers / ThemesSupport / Astra / ThemeSupport.php

ThemeSupport.php in ShopBuilder – WooCommerce Builder For Elementor 2.2.1, at app/Controllers/ThemesSupport/Astra/ThemeSupport.php

68 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Main AstraSupport class Only Work for astra theme.
5 *
6 * @package RadiusTheme\SB
7 */
8
9 namespace RadiusTheme\SB\Controllers\ThemesSupport\Astra;
10
11 use Astra_Woocommerce;
12 use RadiusTheme\SB\Helpers\BuilderFns;
13 use RadiusTheme\SB\Traits\SingletonTrait;
14
15 // Do not allow directly accessing this file.
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit( 'This script cannot be accessed directly.' );
18 }
19
20 /**
21 * Product Description class
22 */
23 class ThemeSupport {
24 /**
25 * Singleton
26 */
27 use SingletonTrait;
28
29 /**
30 * Construct function
31 */
32 private function __construct() {
33 add_filter( 'astra_dynamic_post_structure_posttypes', [ __CLASS__, 'astra_post_types' ], 15 );
34 add_filter( 'rtsb/elementor/archive/products_per_page', [ __CLASS__, 'astra_products_per_page' ] );
35 remove_filter( 'woocommerce_get_stock_html', 'astra_woo_product_in_stock' );
36 }
37 /**
38 * Get class instance.
39 *
40 * @return object Instance.
41 */
42 public static function init() {
43 if ( ! self::$instance ) {
44 self::$instance = new self();
45 }
46 return self::$instance;
47 }
48
49 public static function astra_post_types( $post_types ) {
50 $position = array_search( 'rtsb_builder', $post_types );
51 unset( $post_types[ $position ] );
52 return $post_types;
53 }
54
55 /**
56 * Astra products per page.
57 *
58 * @return int
59 */
60 public static function astra_products_per_page() {
61 if ( function_exists( 'astra_get_option' ) ) {
62 $per_page = astra_get_option( 'shop-no-of-products' );
63
64 return ! empty( $per_page ) ? absint( $per_page ) : 12;
65 }
66 }
67 }
68