function al_product_adder_page_template($template) { if (is_ic_catalog_page()) { if (is_archive() || is_search() || is_tax()) { $product_archive = get_product_listing_id(); if (!empty($product_archive)) { wp_redirect(get_permalink($product_archive)); exit; } } else { return get_page_php_path(); } } return $template; }
function ic_catalog_page_body_class($classes) { if (is_ic_catalog_page()) { $classes[] = 'type-page'; } return $classes; }
/** * Replaces auto products listing, product category pages and product search title with appropriate entries * * @param string $page_title * @param int $id * @return string */ function override_product_page_title($page_title, $id = null) { if (!is_admin() && is_ic_catalog_page() && !is_ic_product_page() && !in_the_loop() && !is_ic_shortcode_query() && (empty($id) || get_quasi_post_type(get_post_type($id)) == 'al_product')) { $archive_names = get_archive_names(); if (is_ic_taxonomy_page()) { $the_tax = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); $page_title = $archive_names['all_prefix'] . ' ' . $the_tax->name; } else { if (is_ic_product_search()) { $page_title = __('Search Results for:', 'ecommerce-product-catalog') . ' ' . $_GET['s']; } else { if (is_ic_product_listing()) { $page_title = get_product_listing_title(); } } } } return $page_title; }
function product_page_content($content) { if (is_ic_catalog_page() && get_integration_type() == 'simple') { if (is_single()) { ob_start(); content_product_adder(); $content = ob_get_contents(); ob_end_clean(); } } return $content; }