AboutUs.class.php
3 years ago
BackwardsCompatibility.class.php
4 years ago
Blocks.class.php
4 years ago
CustomPostTypes.class.php
2 years ago
Dashboard.class.php
3 years ago
DeactivationSurvey.class.php
1 month ago
Helper.class.php
4 years ago
InstallationWalkthrough.class.php
4 years ago
Permissions.class.php
4 years ago
ReviewAsk.class.php
4 years ago
Settings.class.php
2 years ago
Widgets.class.php
4 years ago
WooCommerceIntegration.class.php
4 years ago
template-functions.php
2 years ago
WooCommerceIntegration.class.php
49 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Class to replace the main WooCommerce product image with a slider |
| 5 | * that contains all of the product images |
| 6 | */ |
| 7 | |
| 8 | if ( !defined( 'ABSPATH' ) ) |
| 9 | exit; |
| 10 | |
| 11 | class ewdusWooCommerceIntegration { |
| 12 | |
| 13 | |
| 14 | public function __construct() { |
| 15 | |
| 16 | add_filter( 'woocommerce_locate_template', array( $this, 'add_plugin_template' ), 1, 3 ); |
| 17 | } |
| 18 | |
| 19 | public function add_plugin_template( $template, $template_name, $template_path ) { |
| 20 | global $woocommerce; |
| 21 | |
| 22 | $_template = $template; |
| 23 | |
| 24 | if ( ! $template_path ) { |
| 25 | |
| 26 | $template_path = $woocommerce->template_url; |
| 27 | } |
| 28 | |
| 29 | $plugin_path = EWD_US_PLUGIN_DIR . '/woocommerce-templates/'; |
| 30 | |
| 31 | if ( file_exists( $plugin_path . $template_name ) ) { |
| 32 | |
| 33 | $template = $plugin_path . $template_name; |
| 34 | } |
| 35 | |
| 36 | if ( ! $template ) { |
| 37 | |
| 38 | $paths = array( |
| 39 | $template_path . $template_name, |
| 40 | $template_name |
| 41 | ); |
| 42 | |
| 43 | $template = locate_template( $paths ); |
| 44 | } |
| 45 | |
| 46 | |
| 47 | return $template; |
| 48 | } |
| 49 | } |