if ( !defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* The template to display product short description on product page or with a shortcode
*
* Copy it to your theme implecode folder to edit the output: your-theme-folder-name/implecode/product-short-description.php
*
* @version 1.1.2
* @package ecommerce-product-catalog/templates/template-parts/product-page
* @author Norbert Dreszer
*/
//$product_id = ic_get_product_id();
//$shortdesc = apply_filters( 'product_short_description', get_product_short_description( $product_id ) );
//if ( !empty( $shortdesc ) ) {
?>
<!--<div class="shortdesc">-->
<?php// echo $shortdesc; ?>
<!--</div>-->
<?php
//}
if ( !defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* The template to display product short description on product page or with a shortcode
*
* Copy it to your theme implecode folder to edit the output: your-theme-folder-name/implecode/product-short-description.php
*
* @version 1.1.2
* @package ecommerce-product-catalog/templates/template-parts/product-page
* @author Norbert Dreszer
*/
//$product_id = ic_get_product_id();
//$shortdesc = apply_filters( 'product_short_description', get_product_short_description( $product_id ) );
//if ( !empty( $shortdesc ) ) {
?>
<!--<div class="shortdesc">-->
<?php// echo $shortdesc; ?>
<!--</div>-->
<?php
//}
if ( ! function_exists( 'ic_show_template_file' ) ) {
/**
* Includes template file
*
* @param type $file_path
*
* @return type
*/
function ic_show_template_file( $file_path, $base_path = AL_BASE_TEMPLATES_PATH, $product_id = false ) {
$path = ic_get_template_file( $file_path, $base_path );
if ( $path ) {
ic_enqueue_main_catalog_js_css();
if ( $product_id ) {
$prev_id = ic_get_global( 'product_id' );
if ( $prev_id !== $product_id && is_ic_product( $product_id ) ) {
ic_save_global( 'product_id', $product_id );
}
}
include $path;
if ( $product_id && isset( $prev_id ) ) {
//$prev_id = isset( $prev_id ) ? $prev_id : null;
if ( $prev_id && $prev_id !== $product_id && is_ic_product( $prev_id ) ) {
ic_save_global( 'product_id', $prev_id );
} else if ( $prev_id === false ) {
ic_delete_global( 'product_id' );
}
}
}
return;
}
}
add_filter( 'get_the_archive_title', 'ic_catalog_archive_title' );
function ic_catalog_archive_title( $title ) {
if ( is_ic_taxonomy_page() ) {
$title = single_term_title( '', false );
return $title;
}
add_action( 'product_details', 'show_short_desc', 5, 1 );
/**
* Shows short description
*
*/
function show_short_desc( $product_id = false ) {
if ( is_object( $product_id ) && isset( $product_id->ID ) ) {
$product_id = $product_id->ID;
}
add_filter( 'product_short_description', 'wptexturize' );
add_filter( 'product_short_description', 'convert_smilies' );
add_filter( 'product_short_description', 'convert_chars' );
add_filter( 'product_short_description', 'wpautop' );
add_filter( 'product_short_description', 'shortcode_unautop' );
add_filter( 'product_short_description', 'do_shortcode', 11 );
ic_show_template_file( 'product-page/product-short-description.php', AL_BASE_TEMPLATES_PATH, $product_id );
}
add_action( 'after_product_details', 'show_product_description', 10, 1 );
/**
* Shows product description
*
* @param type $post
* @param type $single_names
*/
function show_product_description( $product_id = false ) {
if ( is_object( $product_id ) && isset( $product_id->ID ) ) {
$product_id = $product_id->ID;
}
add_filter( 'product_simple_description', 'wptexturize' );
add_filter( 'product_simple_description', 'convert_smilies' );
add_filter( 'product_simple_description', 'convert_chars' );
add_filter( 'product_simple_description', 'wpautop' );
add_filter( 'product_simple_description', 'shortcode_unautop' );
ic_show_template_file( 'product-page/product-description.php', AL_BASE_TEMPLATES_PATH, $product_id );
$nesting_level = $this->nesting_level++;
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = $priority = current( $this->iterations[ $nesting_level ] );
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if( ! $this->doing_action ) {
$args[ 0 ] = $value;
}
// Avoid the array_slice if possible.
if ( $the_['accepted_args'] == 0 ) {
$value = call_user_func_array( $the_['function'], array() );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int)$the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
$this->nesting_level--;
return $value;
}
/**
* Executes the callback functions hooked on a specific action hook.
*
* @since 4.7.0
*
* @param mixed $args Arguments to pass to the hook callbacks.
*/
public function do_action( $args ) {
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
$this->nesting_level--;
return $value;
}
/**
* Executes the callback functions hooked on a specific action hook.
*
* @since 4.7.0
*
* @param mixed $args Arguments to pass to the hook callbacks.
*/
public function do_action( $args ) {
$this->doing_action = true;
$this->apply_filters( '', $args );
// If there are recursive calls to the current action, we haven't finished it until we get to the last one.
if ( ! $this->nesting_level ) {
$this->doing_action = false;
}
}
/**
* Processes the functions hooked into the 'all' hook.
*
* @since 4.7.0
*
* @param array $args Arguments to pass to the hook callbacks. Passed by reference.
*/
public function do_all_hook( &$args ) {
$nesting_level = $this->nesting_level++;
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
do {
$priority = current( $this->iterations[ $nesting_level ] );
}
if ( !isset($wp_filter[$tag]) ) {
if ( isset($wp_filter['all']) )
array_pop($wp_current_filter);
return;
}
if ( !isset($wp_filter['all']) )
$wp_current_filter[] = $tag;
$args = array();
if ( is_array($arg) && 1 == count($arg) && isset($arg[0]) && is_object($arg[0]) ) // array(&$this)
$args[] =& $arg[0];
else
$args[] = $arg;
for ( $a = 2, $num = func_num_args(); $a < $num; $a++ )
$args[] = func_get_arg($a);
$wp_filter[ $tag ]->do_action( $args );
array_pop($wp_current_filter);
}
/**
* Retrieve the number of times an action is fired.
*
* @since 2.1.0
*
* @global array $wp_actions Increments the amount of times action was triggered.
*
* @param string $tag The name of the action hook.
* @return int The number of times action hook $tag is fired.
*/
function did_action($tag) {
global $wp_actions;
if ( ! isset( $wp_actions[ $tag ] ) )
return 0;
?>
<div class="entry-content product-entry entry as_produkt_wpis">
<?php
if ( post_password_required() ) {
the_content();
return;
} else {
?>
<div id="product_details_container" class="as_produkt_1">
<div class="as_produkt_miniatura">
<?php
do_action( 'before_product_details', $product_id, $single_options );
$details_class = product_gallery_enabled( $single_options[ 'enable_product_gallery' ], $single_options[ 'enable_product_gallery_only_when_exist' ], $product );
?>
</div>
<div id="product_details" class="product-details <?php echo $details_class; ?> as_produkt_szczegoly">
<?php
do_action( 'product_details', $product, $single_names );
?>
</div>
<div class="as_produkt_handlowcy">
<?php
if (function_exists('pll_current_language')) {
$jezyk_aktywny = pll_current_language();
if($jezyk_aktywny=="pl") {
$content=apply_filters('the_content', get_post_field('post_content', '12'));
echo $content;
}
if($jezyk_aktywny=="en") {
$content=apply_filters('the_content', get_post_field('post_content', '14'));
echo $content;
}
if($jezyk_aktywny=="de") {
$content=apply_filters('the_content', get_post_field('post_content', '22'));
echo $content;
}
if($jezyk_aktywny=="ru") {
}
function content_product_adder_archive() {
$path = get_custom_product_listing_path();
if ( file_exists( $path ) ) {
ob_start();
include apply_filters( 'content_product_adder_archive_path', $path );
$product_listing = ob_get_clean();
echo do_shortcode( $product_listing );
} else {
include apply_filters( 'content_product_adder_archive_path', AL_BASE_TEMPLATES_PATH . '/templates/full/product-listing.php' );
}
}
function content_product_adder_single() {
add_action( 'product_page_inside', 'content_product_adder_single_content' );
$path = get_custom_product_page_path();
if ( file_exists( $path ) ) {
ob_start();
include apply_filters( 'content_product_adder_path', $path );
$product_page = ob_get_clean();
echo do_shortcode( $product_page );
} else {
include apply_filters( 'content_product_adder_path', AL_BASE_TEMPLATES_PATH . '/templates/full/product-page.php' );
}
}
function content_product_adder_single_content() {
$path = get_custom_product_page_inside_path();
if ( file_exists( $path ) ) {
ob_start();
include $path;
$product_page = ob_get_clean();
echo do_shortcode( $product_page );
} else {
include AL_BASE_TEMPLATES_PATH . '/templates/full/product-page-inside.php';
}
}
function content_product_adder_archive_before() {
* @author impleCode
*/
add_shortcode( 'content_product_adder', 'content_product_adder' );
/**
* The function wrapper to show product catalog content for current URL
*
*/
function content_product_adder() {
if ( ! is_ic_catalog_page() ) {
return;
}
echo '<div class="ic-catalog-container">';
if ( is_archive() || is_search() || is_home_archive() || is_ic_product_listing() ) {
do_action( 'before_product_archive' );
content_product_adder_archive();
do_action( 'after_product_archive' );
} else {
do_action( 'before_product_page' );
content_product_adder_single();
do_action( 'after_product_page' );
}
echo '</div>';
}
function ic_redirect_to_same() {
$url = 'http';
if ( is_ssl() ) {
$url .= 's';
}
$url .= '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
wp_redirect( esc_url_raw( $url ) );
exit;
}
function content_product_adder_archive() {
$path = get_custom_product_listing_path();
if ( file_exists( $path ) ) {
ob_start();
include apply_filters( 'content_product_adder_archive_path', $path );
<?php
/**
* Template Name: Product Template
*
* @version 1.1.2
* @package ecommerce-product-catalog/templates
* @author impleCode
*/
if ( !defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
get_header();
do_action( 'advanced_mode_layout_start' );
?>
<div id="container" class="content-area container product-catalog">
<?php do_action( 'advanced_mode_layout_before_content' ); ?>
<div id="content" class="site-content" role="main">
<?php
content_product_adder();
?>
</div><!-- #content -->
<?php do_action( 'advanced_mode_layout_after_content' ); ?>
</div>
<?php
do_action( 'advanced_mode_layout_end' );
get_footer();
elseif ( is_single() && $template = get_single_template() ) :
elseif ( is_page() && $template = get_page_template() ) :
elseif ( is_singular() && $template = get_singular_template() ) :
elseif ( is_category() && $template = get_category_template() ) :
elseif ( is_tag() && $template = get_tag_template() ) :
elseif ( is_author() && $template = get_author_template() ) :
elseif ( is_date() && $template = get_date_template() ) :
elseif ( is_archive() && $template = get_archive_template() ) :
else :
$template = get_index_template();
endif;
/**
* Filters the path of the current template before including it.
*
* @since 3.0.0
*
* @param string $template The path of the template to include.
*/
if ( $template = apply_filters( 'template_include', $template ) ) {
include( $template );
} elseif ( current_user_can( 'switch_themes' ) ) {
$theme = wp_get_theme();
if ( $theme->errors() ) {
wp_die( $theme->errors() );
}
}
return;
endif;
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/
if ( !isset($wp_did_header) ) {
$wp_did_header = true;
// Load the WordPress library.
require_once( dirname(__FILE__) . '/wp-load.php' );
// Set up the WordPress query.
wp();
// Load the theme template.
require_once( ABSPATH . WPINC . '/template-loader.php' );
}
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );