/** * Adds product header on product listing * */ function product_list_header() { $archive_names = get_archive_names(); if ((!empty($archive_names['all_products']) || !empty($archive_names['category_products'])) && !is_ic_shortcode_query()) { if (!is_tax() && !is_search() && !empty($archive_names['all_products'])) { echo '<h2 class="catalog-header">' . do_shortcode($archive_names['all_products']) . '</h2>'; } else { if (is_tax() && !empty($archive_names['category_products']) && is_ic_product_listing_showing_cats()) { //$the_tax = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); echo '<h2 class="catalog-header">' . do_shortcode($archive_names['category_products']) . '</h2>'; } } } }
function custom_names_content() { ?> <div class="names-product-settings settings-wrapper"> <?php $tab = $_GET['tab']; $submenu = $_GET['submenu']; ?> <div class="settings-submenu"> <h3> <a id="single-names" class="element current" href="<?php echo admin_url('edit.php?post_type=al_product&page=product-settings.php&tab=names-settings&submenu=single-names'); ?> "><?php _e('Single Product', 'al-ecommerce-product-catalog'); ?> </a> <a id="archive-names" class="element" href="<?php echo admin_url('edit.php?post_type=al_product&page=product-settings.php&tab=names-settings&submenu=archive-names'); ?> "><?php _e('Product Listings', 'al-ecommerce-product-catalog'); ?> </a> </h3> </div><?php if ($submenu == 'single-names') { ?> <div id="single_names" class="setting-content submenu"> <script> jQuery( '.settings-submenu a' ).removeClass( 'current' ); jQuery( '.settings-submenu a#single-names' ).addClass( 'current' ); </script> <form method="post" action="options.php"> <?php settings_fields('product_names_single'); $default_single_names = default_single_names(); $single_names = get_option('single_names', $default_single_names); $single_names['product_sku'] = isset($single_names['product_sku']) ? $single_names['product_sku'] : 'SKU:'; ?> <h2><?php _e('Front-end Labels', 'al-ecommerce-product-catalog'); ?> </h2> <h3><?php _e('Single Product Labels', 'al-ecommerce-product-catalog'); ?> </h3> <table class="wp-list-table widefat product-settings-table" style="clear:right; text-align: left;"> <thead><th><strong><?php _e('Front-end Element', 'al-ecommerce-product-catalog'); ?> </strong></th><th><strong><?php _e('Front-end Text', 'al-ecommerce-product-catalog'); ?> </strong></th></thead> <tbody> <tr><td><?php _e('Price Label', 'al-ecommerce-product-catalog'); ?> </td><td><input type="text" name="single_names[product_price]" value="<?php echo $single_names['product_price']; ?> " /></td></tr> <tr><td><?php _e('SKU Label', 'al-ecommerce-product-catalog'); ?> </td><td><input type="text" name="single_names[product_sku]" value="<?php echo $single_names['product_sku']; ?> " /></td></tr> <tr><td><?php _e('Shipping Label', 'al-ecommerce-product-catalog'); ?> </td><td><input type="text" name="single_names[product_shipping]" value="<?php echo $single_names['product_shipping']; ?> " /></td></tr> <tr><td><?php _e('Features Label', 'al-ecommerce-product-catalog'); ?> </td><td><input type="text" name="single_names[product_features]" value="<?php echo $single_names['product_features']; ?> " /></td></tr> <tr><td><?php _e('Another Categories', 'al-ecommerce-product-catalog'); ?> </td><td><input type="text" name="single_names[other_categories]" value="<?php echo $single_names['other_categories']; ?> " /></td></tr> <tr><td><?php _e('Return to Products', 'al-ecommerce-product-catalog'); ?> </td><td><input type="text" name="single_names[return_to_archive]" value="<?php echo $single_names['return_to_archive']; ?> " /></td></tr> <?php do_action('single_names_table', $single_names); ?> </tbody> </table> <p class="submit"> <input type="submit" class="button-primary" value="<?php _e('Save changes', 'al-ecommerce-product-catalog'); ?> " /> </p> </form> </div> <div class="helpers"><div class="wrapper"><?php main_helper(); ?> </div></div><?php } else { if ($submenu == 'archive-names') { ?> <div id="archive_names" class="setting-content submenu"> <script> jQuery( '.settings-submenu a' ).removeClass( 'current' ); jQuery( '.settings-submenu a#archive-names' ).addClass( 'current' ); </script> <form method="post" action="options.php"><?php settings_fields('product_names_archive'); $archive_names = get_archive_names(); ?> <h2><?php _e('Front-end Labels', 'al-ecommerce-product-catalog'); ?> </h2><?php $disabled = ''; if (get_integration_type() == 'simple') { $disabled = 'disabled'; implecode_warning(sprintf(__('Product listing pages are disabled with simple theme integration. See <a href="%s">Theme Integration Guide</a> to enable product listing pages.', 'al-ecommerce-product-catalog'), 'http://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=front-labels')); } ?> <h3><?php _e('Product Listing Labels', 'al-ecommerce-product-catalog'); ?> </h3> <table class="wp-list-table widefat product-settings-table" style="clear:right; text-align: left; width: 100%;"> <style>.names-product-settings .setting-content th {text-align: left;}</style> <thead><th><strong><?php _e('Front-end Element', 'al-ecommerce-product-catalog'); ?> </strong></th><th style="width:69%"><strong><?php _e('Front-end Text', 'al-ecommerce-product-catalog'); ?> </strong></th></thead> <tbody> <?php implecode_settings_text(__('Product Archive Title', 'al-ecommerce-product-catalog'), 'archive_names[all_products]', $archive_names['all_products'], null, 1, 'wide', null, $disabled); implecode_settings_text(__('Categories Header', 'al-ecommerce-product-catalog'), 'archive_names[all_main_categories]', $archive_names['all_main_categories'], null, 1, 'wide', null, $disabled); implecode_settings_text(__('Subcategories Header', 'al-ecommerce-product-catalog'), 'archive_names[all_subcategories]', $archive_names['all_subcategories'], null, 1, 'wide', null, $disabled); implecode_settings_text(__('Category Prefix', 'al-ecommerce-product-catalog'), 'archive_names[all_prefix]', $archive_names['all_prefix'], null, 1, 'wide', null, $disabled); implecode_settings_text(__('Category Products Header', 'al-ecommerce-product-catalog'), 'archive_names[category_products]', $archive_names['category_products'], null, 1, 'wide', null, $disabled); ?> </tbody> </table> <p class="submit"> <input type="submit" <?php echo $disabled; ?> class="button-primary" value="<?php _e('Save changes', 'al-ecommerce-product-catalog'); ?> " /> </p> </form> </div> <div class="helpers"><div class="wrapper"><?php main_helper(); ?> </div></div><?php } } do_action('names-settings'); ?> </div><?php }
if (!defined('ABSPATH')) { exit; // Exit if accessed directly } /** * The template for displaying products archive content. * * @version 1.1.3 * @package ecommerce-product-catalog/templates * @author Norbert Dreszer */ global $post; $default_archive_names = default_archive_names(); $multiple_settings = get_multiple_settings(); $archive_names = get_archive_names(); do_action('product_listing_begin', $multiple_settings); $listing_class = apply_filters('product_listing_classes', 'al_product responsive type-page'); ?> <article id="product_listing" <?php post_class($listing_class); ?> > <?php do_action('before_product_listing_entry', $post, $archive_names); ?> <div class="entry-content"> <?php $archive_template = get_product_listing_template(); do_action('product_listing_entry_inside', $archive_template, $multiple_settings); ?>
/** * Shows product listing title tag */ function add_product_listing_name() { if (is_ic_taxonomy_page()) { $archive_names = get_archive_names(); //$the_tax = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); $the_tax = get_queried_object(); if (!empty($archive_names['all_prefix'])) { $title = $archive_names['all_prefix'] . ' ' . $the_tax->name; } else { $title = $the_tax->name; } } else { if (is_ic_product_search()) { $title = __('Search Results for:', 'ecommerce-product-catalog') . ' ' . $_GET['s']; } else { if (is_ic_product_listing()) { $title = get_product_listing_title(); } else { $title = get_the_title(); } } } echo '<h1 class="entry-title product-listing-name">' . $title . '</h1>'; }
function get_product_listing_title() { $archive_names = get_archive_names(); $def_page_id = get_product_listing_id(); $page_id = apply_filters('before_archive_post_id', $def_page_id); $page = get_post($page_id); if ($page == '') { $page_title = $archive_names['all_products']; } else { $page_title = $page->post_title; } return $page_title; }