Example #1
0
    function form($instance)
    {
        if (get_integration_type() != 'simple') {
            $instance = wp_parse_args((array) $instance, array('title' => ''));
            $title = $instance['title'];
            ?>
			<p><label for="<?php 
            echo $this->get_field_id('title');
            ?>
"><?php 
            _e('Title:', 'ecommerce-product-catalog');
            ?>
 <input class="widefat" id="<?php 
            echo $this->get_field_id('title');
            ?>
" name="<?php 
            echo $this->get_field_name('title');
            ?>
" type="text" value="<?php 
            echo esc_attr($title);
            ?>
" /></label></p><?php 
        } else {
            if (is_integration_mode_selected()) {
                implecode_warning(sprintf(__('Search widget is disabled with simple theme integration. Please see <a href="%s">Theme Integration Guide</a> to enable product search widget.', 'ecommerce-product-catalog'), 'https://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=search-widget'));
            } else {
                implecode_warning(sprintf(__('Search widget is disabled due to a lack of theme integration.%s', 'ecommerce-product-catalog'), sample_product_button('p')));
            }
        }
    }
function product_adder_theme_check_notice()
{
    if (is_integration_mode_selected() && get_integration_type() == 'simple') {
        ?>
		<div id="implecode_message" class="updated product-adder-message messages-connect">
			<div class="squeezer">
				<h4><?php 
        _e('You are currently using eCommerce Product Catalog in Simple Mode. It is perfectly fine to use it this way, however some features are limited. To switch to Advanced Mode you probably need Theme Integration.', 'ecommerce-product-catalog');
        ?>
</h4>
				<p class="submit"><a href="https://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=top-message" target="_blank" class="button-primary"><?php 
        _e('Theme Integration Guide', 'ecommerce-product-catalog');
        ?>
</a> <a class="skip button" href="<?php 
        echo admin_url('edit.php?post_type=al_product&page=product-settings.php&tab=product-settings&submenu=support');
        ?>
"><?php 
        _e('Plugin Support', 'ecommerce-product-catalog');
        ?>
</a> <a class="skip button" href="<?php 
        echo esc_url(add_query_arg('hide_al_product_adder_support_check', 'true'));
        ?>
"><?php 
        _e('I know, don\'t bug me', 'ecommerce-product-catalog');
        ?>
</a></p>
			</div>
		</div><div class="clear"></div><?php 
    } else {
        if (is_integration_mode_selected() && get_integration_type() == 'advanced') {
            /* ?>
            	  <div id="implecode_message" class="updated product-adder-message messages-connect">
            	  <div class="squeezer">
            	  <h4><?php _e( 'You are currently using eCommerce Product Catalog in Advanced Mode without the integration file. It is perfectly fine to use it this way, however the file may be very handy if you need more control over product pages. See the guide for quick integration file creation.', 'ecommerce-product-catalog' ); ?></h4>
            	  <p class="submit"><a href="https://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=advanced-mode&key=top-message" target="_blank" class="button-primary"><?php _e( 'Theme Integration Guide', 'ecommerce-product-catalog' ); ?></a> <a class="skip button" href="<?php echo admin_url( 'edit.php?post_type=al_product&page=product-settings.php&tab=product-settings&submenu=support' ) ?>"><?php _e( 'Plugin Support', 'ecommerce-product-catalog' ); ?></a> <a class="skip button" href="<?php echo esc_url( add_query_arg( 'hide_al_product_adder_support_check', 'true' ) ); ?>"><?php _e( 'I know, don\'t bug me', 'ecommerce-product-catalog' ); ?></a></p>
            	  </div>
            	  </div><?php */
            ?>
		<div id="implecode_message" class="updated product-adder-message messages-connect">
			<div class="squeezer">
				<h4><?php 
            _e('Congratulations! Now your theme is fully integrated with eCommerce Product Catalog.', 'ecommerce-product-catalog');
            ?>
</h4>
				<p class="submit"><a href="<?php 
            echo admin_url('post-new.php?post_type=al_product');
            ?>
" class="button-primary"><?php 
            _e('Add Product', 'ecommerce-product-catalog');
            ?>
</a> <a class="skip button" href="<?php 
            echo admin_url('edit.php?post_type=al_product&page=product-settings.php');
            ?>
"><?php 
            _e('Product Settings', 'ecommerce-product-catalog');
            ?>
</a> <a href="https://implecode.com/docs/ecommerce-product-catalog/#cam=advanced-mode&key=top-message-docs" class="button"><?php 
            _e('Help & Documentation', 'ecommerce-product-catalog');
            ?>
</a>
				</p>
			</div>
		</div>
		<?php 
            $template = get_option('template');
            update_option('product_adder_theme_support_check', $template);
        } else {
            $product_id = sample_product_id();
            $sample_product_url = get_permalink($product_id);
            if (!$sample_product_url || get_post_status($product_id) != 'publish') {
                $sample_product_url = esc_url(add_query_arg('create_sample_product_page', 'true'));
            }
            ?>
		<div id="implecode_message" class="error product-adder-message messages-connect">
			<div class="squeezer">
				<h4><?php 
            _e('<strong>Your theme does not declare eCommerce Product Catalog support</strong> &#8211; please proceed to sample product page where automatic layout adjustment can be done.', 'ecommerce-product-catalog');
            ?>
</h4>
				<p class="submit">
					<?php 
            echo sample_product_button();
            ?>
					<a href="https://implecode.com/docs/ecommerce-product-catalog/theme-integration-wizard/#cam=default-mode&key=top-message-video" class="button"><?php 
            _e('Theme Integration Video', 'ecommerce-product-catalog');
            ?>
</a>
					<?php 
            /* <a href="https://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=default-mode&key=top-message" target="_blank" class="button"><?php _e( 'Theme Integration Guide', 'ecommerce-product-catalog' ); ?></a> */
            ?>
					<?php 
            /* <a class="skip button" href="<?php echo admin_url( 'edit.php?post_type=al_product&page=product-settings.php&tab=product-settings&submenu=support' ) ?>"><?php _e( 'Plugin Support', 'ecommerce-product-catalog' ); ?></a> */
            ?>
					<a class="skip button" href="<?php 
            echo esc_url(add_query_arg('hide_al_product_adder_support_check', 'true'));
            ?>
"><?php 
            _e('Hide Forever', 'ecommerce-product-catalog');
            ?>
</a>
				</p>
			</div>
		</div><?php 
        }
    }
}
Example #3
0
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', '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', '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');
        $single_names = get_single_names();
        ?>
					<h2><?php 
        _e('Front-end Labels', 'ecommerce-product-catalog');
        ?>
</h2>
					<h3><?php 
        _e('Single Product Labels', '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', 'ecommerce-product-catalog');
        ?>
</strong></th><th><strong><?php 
        _e('Front-end Text', 'ecommerce-product-catalog');
        ?>
</strong></th></thead>
						<tbody>
							<tr><td><?php 
        _e('Price Label', 'ecommerce-product-catalog');
        ?>
</td><td><input type="text" name="single_names[product_price]" value="<?php 
        echo esc_html($single_names['product_price']);
        ?>
" /></td></tr>
							<tr><td><?php 
        _e('Free Product Text', 'ecommerce-product-catalog');
        ?>
</td><td><input type="text" name="single_names[free]" value="<?php 
        echo esc_html($single_names['free']);
        ?>
" /></td></tr>
							<tr><td><?php 
        _e('SKU Label', 'ecommerce-product-catalog');
        ?>
</td><td><input type="text" name="single_names[product_sku]" value="<?php 
        echo esc_html($single_names['product_sku']);
        ?>
" /></td></tr>
							<tr><td><?php 
        _e('Shipping Label', 'ecommerce-product-catalog');
        ?>
</td><td><input type="text" name="single_names[product_shipping]" value="<?php 
        echo esc_html($single_names['product_shipping']);
        ?>
" /></td></tr>
							<tr><td><?php 
        _e('Features Label', 'ecommerce-product-catalog');
        ?>
</td><td><input type="text" name="single_names[product_features]" value="<?php 
        echo esc_html($single_names['product_features']);
        ?>
" /></td></tr>
							<tr><td><?php 
        _e('Another Categories', 'ecommerce-product-catalog');
        ?>
</td><td><input type="text" name="single_names[other_categories]" value="<?php 
        echo esc_html($single_names['other_categories']);
        ?>
" /></td></tr>
							<tr><td><?php 
        _e('Return to Products', 'ecommerce-product-catalog');
        ?>
</td><td><input type="text" name="single_names[return_to_archive]" value="<?php 
        echo esc_html($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', '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', 'ecommerce-product-catalog');
            ?>
</h2><?php 
            $disabled = '';
            if (get_integration_type() == 'simple') {
                $disabled = 'disabled';
                if (is_integration_mode_selected()) {
                    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.', 'ecommerce-product-catalog'), 'https://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=front-labels'));
                } else {
                    implecode_warning(sprintf(__('Product listing pages are disabled due to a lack of theme integration.%s', 'ecommerce-product-catalog'), sample_product_button('p')));
                }
            }
            ?>
					<h3><?php 
            _e('Product Listing Labels', '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', 'ecommerce-product-catalog');
            ?>
</strong></th><th style="width:69%"><strong><?php 
            _e('Front-end Text', 'ecommerce-product-catalog');
            ?>
</strong></th></thead>
						<tbody>
							<?php 
            implecode_settings_text(__('Product Archive Title', 'ecommerce-product-catalog'), 'archive_names[all_products]', $archive_names['all_products'], null, 1, 'wide', null, $disabled);
            implecode_settings_text(__('Categories Header', 'ecommerce-product-catalog'), 'archive_names[all_main_categories]', $archive_names['all_main_categories'], null, 1, 'wide', null, $disabled);
            implecode_settings_text(__('Subcategories Header', 'ecommerce-product-catalog'), 'archive_names[all_subcategories]', $archive_names['all_subcategories'], null, 1, 'wide', null, $disabled);
            implecode_settings_text(__('Category Prefix', 'ecommerce-product-catalog'), 'archive_names[all_prefix]', $archive_names['all_prefix'], null, 1, 'wide', null, $disabled);
            implecode_settings_text(__('Category Products Header', 'ecommerce-product-catalog'), 'archive_names[category_products]', $archive_names['category_products'], null, 1, 'wide', null, $disabled);
            implecode_settings_text(__('Next Page Link', 'ecommerce-product-catalog'), 'archive_names[next_products]', $archive_names['next_products'], null, 1, 'wide', null, $disabled);
            implecode_settings_text(__('Previous Page Link', 'ecommerce-product-catalog'), 'archive_names[previous_products]', $archive_names['previous_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', 'ecommerce-product-catalog');
            ?>
" />
					</p>
				</form>
			</div>
			<div class="helpers"><div class="wrapper"><?php 
            main_helper();
            ?>
				</div></div><?php 
        }
    }
    do_action('names-settings');
    ?>
	</div><?php 
}
    function form($instance)
    {
        //Defaults
        if (get_integration_type() != 'simple') {
            $instance = wp_parse_args((array) $instance, array('title' => ''));
            $title = esc_attr($instance['title']);
            $count = isset($instance['count']) ? (bool) $instance['count'] : false;
            $hierarchical = isset($instance['hierarchical']) ? (bool) $instance['hierarchical'] : false;
            $dropdown = isset($instance['dropdown']) ? (bool) $instance['dropdown'] : false;
            ?>
			<p><label
					for="<?php 
            echo $this->get_field_id('title');
            ?>
"><?php 
            _e('Title:', 'ecommerce-product-catalog');
            ?>
</label>
				<input class="widefat" id="<?php 
            echo $this->get_field_id('title');
            ?>
"
					   name="<?php 
            echo $this->get_field_name('title');
            ?>
" type="text" value="<?php 
            echo $title;
            ?>
"/>
			</p>

			<p><input type="checkbox" class="checkbox" id="<?php 
            echo $this->get_field_id('dropdown');
            ?>
"
					  name="<?php 
            echo $this->get_field_name('dropdown');
            ?>
"<?php 
            checked($dropdown);
            ?>
 />
				<label
					for="<?php 
            echo $this->get_field_id('dropdown');
            ?>
"><?php 
            _e('Display as dropdown', 'ecommerce-product-catalog');
            ?>
</label><br/>

				<input type="checkbox" class="checkbox" id="<?php 
            echo $this->get_field_id('count');
            ?>
"
					   name="<?php 
            echo $this->get_field_name('count');
            ?>
"<?php 
            checked($count);
            ?>
 />
				<label
					for="<?php 
            echo $this->get_field_id('count');
            ?>
"><?php 
            _e('Show product counts', 'ecommerce-product-catalog');
            ?>
</label><br/>

				<input type="checkbox" class="checkbox" id="<?php 
            echo $this->get_field_id('hierarchical');
            ?>
"
					   name="<?php 
            echo $this->get_field_name('hierarchical');
            ?>
"<?php 
            checked($hierarchical);
            ?>
 />
				<label
					for="<?php 
            echo $this->get_field_id('hierarchical');
            ?>
"><?php 
            _e('Show hierarchy', 'ecommerce-product-catalog');
            ?>
</label>
					<?php 
            $object = $this;
            do_action('product_categories_widget_settings', $instance, $object);
            ?>
 </p> <?php 
        } else {
            if (is_integration_mode_selected()) {
                implecode_warning(sprintf(__('Category widget is disabled with simple theme integration. Please see <a href="%s">Theme Integration Guide</a> to enable product category widget.', 'ecommerce-product-catalog'), 'https://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=category-widget'));
            } else {
                implecode_warning(sprintf(__('Category widget is disabled due to a lack of theme integration.%s', 'ecommerce-product-catalog'), sample_product_button('p')));
            }
        }
    }
Example #5
0
function general_settings_content()
{
    $submenu = isset($_GET['submenu']) ? $_GET['submenu'] : '';
    ?>
	<div class="overall-product-settings settings-wrapper" style="clear:both;">
		<div class="settings-submenu">
			<h3>
				<a id="general-settings" class="element current"
				   href="<?php 
    echo admin_url('edit.php?post_type=al_product&page=product-settings.php&tab=product-settings&submenu=general-settings');
    ?>
"><?php 
    _e('General Settings', 'ecommerce-product-catalog');
    ?>
</a>
				   <?php 
    do_action('general_submenu');
    ?>
			</h3>
		</div>

		<?php 
    if ($submenu == 'general-settings' or $submenu == '') {
        ?>
			<div class="setting-content submenu">
				<script>
					jQuery( '.settings-submenu a' ).removeClass( 'current' );
					jQuery( '.settings-submenu a#general-settings' ).addClass( 'current' );
				</script>
				<h2><?php 
        _e('General Settings', 'ecommerce-product-catalog');
        ?>
</h2>

				<form method="post" action="options.php">
					<?php 
        settings_fields('product_settings');
        $product_currency = get_product_currency_code();
        $product_currency_settings = get_currency_settings();
        $enable_product_listing = get_option('enable_product_listing', 1);
        //$product_listing_url		 = product_listing_url();
        $product_archive = get_product_listing_id();
        $archive_multiple_settings = get_multiple_settings();
        /*
        					  $page_get					 = get_page_by_path( $product_listing_url );
        
        					  if ( $product_archive != '' ) {
        					  $new_product_listing_url = get_page_uri( $product_archive );
        					  if ( $new_product_listing_url != '' ) {
        					  update_option( 'product_listing_url', $new_product_listing_url );
        					  } else {
        					  update_option( 'product_listing_url', __( 'products', 'ecommerce-product-catalog' ) );
        					  }
        					  } else if ( !empty( $page_get->ID ) ) {
        					  update_option( 'product_archive', $page_get->ID );
        					  $product_archive = $page_get->ID;
        					  } */
        $disabled = '';
        if (!is_advanced_mode_forced()) {
            ?>
						<h3><?php 
            _e('Theme Integration', 'ecommerce-product-catalog');
            ?>
</h3><?php 
            if (get_integration_type() == 'simple') {
                $disabled = 'disabled';
            }
            if (is_integration_mode_selected()) {
                $selected = true;
                if (get_integration_type() == 'simple') {
                    implecode_warning('<p>' . __('The simple mode allows to use eCommerce Product Catalog most features. You can build the product listing pages and category pages by using a [show_products] shortcode. Simple mode uses your theme page layout so it can show unwanted elements on product page. If it does please switch to Advanced Mode and see if it works out of the box.', 'ecommerce-product-catalog') . '</p><p>' . __('Switching to Advanced Mode also gives additional features: automatic product listing, category pages, product search and category widget. Building a product catalog in Advanced Mode will be less time consuming as you don’t need to use a shortcode for everything.', 'ecommerce-product-catalog') . '</p>' . sample_product_button('p', __('Restart Integration Wizard', 'ecommerce-product-catalog')));
                }
                ?>
							<table>
								<?php 
                implecode_settings_radio(__('Choose theme integration type', 'ecommerce-product-catalog'), 'archive_multiple_settings[integration_type]', $archive_multiple_settings['integration_type'], array('simple' => __('Simple Integration', 'ecommerce-product-catalog'), 'advanced' => __('Advanced Integration', 'ecommerce-product-catalog')));
                ?>
</table>
							<table class="advanced_mode_settings"><?php 
                implecode_settings_number(__('Catalog Container Width', 'ecommerce-product-catalog'), 'archive_multiple_settings[container_width]', $archive_multiple_settings['container_width'], '%');
                implecode_settings_text_color(__('Catalog Container Background', 'ecommerce-product-catalog'), 'archive_multiple_settings[container_bg]', $archive_multiple_settings['container_bg']);
                implecode_settings_number(__('Catalog Container Padding', 'ecommerce-product-catalog'), 'archive_multiple_settings[container_padding]', $archive_multiple_settings['container_padding'], 'px');
                if (!defined('AL_SIDEBAR_BASE_URL')) {
                    implecode_settings_radio(__('Default Sidebar', 'ecommerce-product-catalog'), 'archive_multiple_settings[default_sidebar]', $archive_multiple_settings['default_sidebar'], array('none' => __('Disabled', 'ecommerce-product-catalog'), 'left' => __('Left', 'ecommerce-product-catalog'), 'right' => __('Right', 'ecommerce-product-catalog')));
                }
                implecode_settings_checkbox(__('Disable Product Name', 'ecommerce-product-catalog'), 'archive_multiple_settings[disable_name]', $archive_multiple_settings['disable_name']);
                ?>
							</table>
							<?php 
                if (get_integration_type() == 'advanced') {
                    echo sample_product_button('p', __('Restart Integration Wizard', 'ecommerce-product-catalog'));
                }
            } else {
                $selected = false;
                ?>
							<table style="display: none">
								<?php 
                implecode_settings_radio(__('Choose theme integration type', 'ecommerce-product-catalog'), 'archive_multiple_settings[integration_type]', $archive_multiple_settings['integration_type'], array('simple' => __('Simple Integration', 'ecommerce-product-catalog'), 'advanced' => __('Advanced Integration', 'ecommerce-product-catalog')));
                ?>
</table>
							<?php 
                echo '<a href="' . sample_product_url() . '" class="button-primary">' . __('Start Auto Adjustment', 'ecommerce-product-catalog') . '</a>';
            }
        }
        ?>
					<h3><?php 
        _e('Product Catalog', 'ecommerce-product-catalog');
        ?>
</h3>
					<table><?php 
        implecode_settings_text(__('Catalog Singular Name', 'ecommerce-product-catalog'), 'archive_multiple_settings[catalog_singular]', $archive_multiple_settings['catalog_singular'], null, 1, null, __('Admin panel customisation setting. Change it to what you sell.', 'ecommerce-product-catalog'));
        implecode_settings_text(__('Catalog Plural Name', 'ecommerce-product-catalog'), 'archive_multiple_settings[catalog_plural]', $archive_multiple_settings['catalog_plural'], null, 1, null, __('Admin panel customisation setting. Change it to what you sell.', 'ecommerce-product-catalog'));
        ?>
					</table>

					<h3><?php 
        _e('Product listing page', 'ecommerce-product-catalog');
        ?>
</h3><?php 
        /* if ( $disabled == 'disabled' ) {
        	  implecode_warning( sprintf( __( 'Product listing page is disabled with simple theme integration. See <a href="%s">Theme Integration Guide</a> to enable product listing page with pagination or use [show_products] shortcode on the page selected below.', 'ecommerce-product-catalog' ), 'https://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=product-listing' ) );
        	  } */
        if (!ic_check_rewrite_compatibility()) {
            implecode_warning(__('It seems that this page is already set to be a listing for different elements. Please change the product listing page to make sure that product pages work fine.<br><br>This is probably caused by other plugin being set to show items on the same page.', 'ecommerce-product-catalog'));
        }
        ?>
					<table>
						<tr>
							<td style="width: 180px">
								<?php 
        _e('Enable Product Listing Page', 'ecommerce-product-catalog');
        ?>
:
							</td>
							<td>
								<input title="<?php 
        _e('Disable and use [show_products] shortcode to display the products.', 'ecommerce-product-catalog');
        ?>
" type="checkbox" name="enable_product_listing" value="1"<?php 
        checked(1, $enable_product_listing);
        ?>
 />
							</td>
						</tr>
						<tr>
							<td>
								<?php 
        _e('Choose Product Listing Page', 'ecommerce-product-catalog');
        ?>
:
							</td>
							<td><?php 
        if ($enable_product_listing == 1) {
            $listing_url = product_listing_url();
            select_page('product_archive', __('Default', 'ecommerce-product-catalog'), $product_archive, true, $listing_url);
        } else {
            select_page('product_archive', __('Default', 'ecommerce-product-catalog'), $product_archive, true);
        }
        ?>
							</td>
						</tr> <?php 
        /*
        						  <tr>
        						  <td><?php _e('Product listing URL', 'ecommerce-product-catalog'); ?>:</td>
        						  <td class="archive-url-td"><a target="_blank" class="archive-url" href="<?php echo product_listing_url() ?>"><?php
        						  $listin_url = product_listing_url();
        						  $listin_urllen = strlen($listin_url);
        						  if ($listin_urllen > 40) {
        						  $listin_url = substr($listin_url, 0, 20).'...'.substr($listin_url, $listin_urllen - 20, $listin_urllen);
        						  }
        						  echo $listin_url;
        						  ?></a></td>
        						  </tr> */
        ?>
						<tr>
							<td><?php 
        _e('Product listing shows at most', 'ecommerce-product-catalog');
        ?>
 </td>
							<td><input
									title="<?php 
        _e('You can also use shortcode with products_limit attribute to set this.', 'ecommerce-product-catalog');
        ?>
"
									size="30" class="number-box" type="number" step="1" min="0"
									name="archive_multiple_settings[archive_products_limit]" id="archive_products_limit"
									value="<?php 
        echo $archive_multiple_settings['archive_products_limit'];
        ?>
"/> <?php 
        _e('products', 'ecommerce-product-catalog');
        ?>
								.
							</td>
						</tr><?php 
        implecode_settings_radio(__('Product listing shows', 'ecommerce-product-catalog'), 'archive_multiple_settings[product_listing_cats]', $archive_multiple_settings['product_listing_cats'], array('off' => __('Products', 'ecommerce-product-catalog'), 'on' => __('Products & Main Categories', 'ecommerce-product-catalog'), 'cats_only' => __('Main Categories', 'ecommerce-product-catalog')));
        $sort_options = get_product_sort_options();
        implecode_settings_radio(__('Product order', 'ecommerce-product-catalog'), 'archive_multiple_settings[product_order]', $archive_multiple_settings['product_order'], $sort_options, true, __('This is also the default setting for sorting drop-down.', 'ecommerce-product-catalog'));
        do_action('product_listing_page_settings');
        ?>
					</table><?php 
        //implecode_info(__('You can also use shortcode to show your products whenever you want on the website. Just paste on any page: [show_products] and you will display all products in place of the shortcode. <br><br>To show products from just one category, use: [show_products category="2"] where 2 is category ID (you can display several categories by inserting comma separated IDs). <br><br>To display products by IDs, use: [show_products product="5"], where 5 is product ID.', 'ecommerce-product-catalog'));
        ?>
					<h3><?php 
        _e('Categories Settings', 'ecommerce-product-catalog');
        ?>
</h3><?php 
        if ($disabled != '') {
            if ($selected) {
                implecode_warning(sprintf(__('Category pages are disabled with simple theme integration. See <a href="%s">Theme Integration Guide</a> to enable category pages or use [show_products category="1"] (where "1" is category ID) on any page to show products from certain category.', 'ecommerce-product-catalog'), 'https://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=categories-settings'));
            } else {
                implecode_warning(sprintf(__('Category pages are disabled due to a lack of theme integration.%s', 'ecommerce-product-catalog'), sample_product_button('p')));
            }
        }
        if (!ic_check_tax_rewrite_compatibility()) {
            implecode_warning(__('It seems that this categories parent URL is already set to be a parent for different elements. Please change the Categories Parent URL to make sure that product category pages work fine.<br><br>This is probably caused by other plugin being set to show categoires with the same parent.', 'ecommerce-product-catalog'));
        }
        ?>
					<table>
						<?php 
        if (is_ic_permalink_product_catalog()) {
            ?>
							<tr>
								<td><?php 
            _e('Categories Parent URL', 'ecommerce-product-catalog');
            ?>
:</td>
								<?php 
            $site_url = site_url();
            $urllen = strlen($site_url);
            if ($urllen > 25) {
                $site_url = ic_substr($site_url, 0, 11) . '...' . ic_substr($site_url, $urllen - 11, $urllen);
            }
            ?>
								<td class="longer"><?php 
            echo $site_url;
            ?>
/<input <?php 
            echo $disabled;
            ?>
 type="text"
																										  name="archive_multiple_settings[category_archive_url]"
																										  title="<?php 
            _e('Cannot be the same as product listing page slug.', 'ecommerce-product-catalog');
            ?>
"
																										  id="category_archive_url"
																										  value="<?php 
            echo urldecode(sanitize_title($archive_multiple_settings['category_archive_url']));
            ?>
"/>/<?php 
            _e('category-name', 'ecommerce-product-catalog');
            ?>
									/
								</td>
							</tr><?php 
        }
        implecode_settings_radio(__('Category Page shows', 'ecommerce-product-catalog'), 'archive_multiple_settings[category_top_cats]', $archive_multiple_settings['category_top_cats'], array('off' => __('Products', 'ecommerce-product-catalog'), 'on' => __('Products & Subcategories', 'ecommerce-product-catalog'), 'only_subcategories' => __('Subcategories', 'ecommerce-product-catalog')));
        implecode_settings_radio(__('Categories Display', 'ecommerce-product-catalog'), 'archive_multiple_settings[cat_template]', $archive_multiple_settings['cat_template'], array('template' => __('Template', 'ecommerce-product-catalog'), 'link' => __('URLs', 'ecommerce-product-catalog')), true, array('template' => __('Display categories with the same listing theme as products.', 'ecommerce-product-catalog'), 'link' => __('Display categories as simple links.', 'ecommerce-product-catalog')));
        implecode_settings_checkbox(__('Disable Image on Category Page', 'ecommerce-product-catalog'), 'archive_multiple_settings[cat_image_disabled]', $archive_multiple_settings['cat_image_disabled']);
        implecode_settings_radio(__('Show Related', 'ecommerce-product-catalog'), 'archive_multiple_settings[related]', $archive_multiple_settings['related'], array('products' => __('Products', 'ecommerce-product-catalog'), 'categories' => __('Categories', 'ecommerce-product-catalog')));
        do_action('product_category_settings', $archive_multiple_settings);
        ?>
					</table>
					<h3><?php 
        _e('SEO Settings', 'ecommerce-product-catalog');
        ?>
</h3><?php 
        if ($disabled != '') {
            if ($selected) {
                implecode_warning(sprintf(__('SEO settings are disabled with simple theme integration. See <a href="%s">Theme Integration Guide</a> to enable SEO settings.', 'ecommerce-product-catalog'), 'https://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=seo-settings'));
            } else {
                implecode_warning(sprintf(__('SEO settings are disabled due to a lack of theme integration.%s', 'ecommerce-product-catalog'), sample_product_button('p')));
            }
        }
        ?>
					<table>
						<?php 
        implecode_settings_text(__('Archive SEO Title', 'ecommerce-product-catalog'), 'archive_multiple_settings[seo_title]', $archive_multiple_settings['seo_title']);
        implecode_settings_checkbox(__('Enable SEO title separator', 'ecommerce-product-catalog'), 'archive_multiple_settings[seo_title_sep]', $archive_multiple_settings['seo_title_sep']);
        ?>

					</table>
					<h3><?php 
        _e('Breadcrumbs Settings', 'ecommerce-product-catalog');
        ?>
</h3><?php 
        if ($disabled != '') {
            if ($selected) {
                implecode_warning(sprintf(__('Breadcrumbs are disabled with simple theme integration. See <a href="%s">Theme Integration Guide</a> to enable product breadcrumbs.', 'ecommerce-product-catalog'), 'https://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=breadcrumbs-settings'));
            } else {
                implecode_warning(sprintf(__('Breadcrumbs are disabled due to a lack of theme integration.%s', 'ecommerce-product-catalog'), sample_product_button('p')));
            }
        }
        ?>
					<table>
						<tr>
							<td><?php 
        _e('Enable Product Breadcrumbs:', 'ecommerce-product-catalog');
        ?>
 </td>
							<td><input <?php 
        echo $disabled;
        ?>
 type="checkbox"
															   name="archive_multiple_settings[enable_product_breadcrumbs]"
															   value="1"<?php 
        checked(1, isset($archive_multiple_settings['enable_product_breadcrumbs']) ? $archive_multiple_settings['enable_product_breadcrumbs'] : '');
        ?>
 />
							</td>
						</tr>
						<tr>
							<td><?php 
        _e('Product listing breadcrumbs title:', 'ecommerce-product-catalog');
        ?>
 </td>
							<td><input <?php 
        echo $disabled;
        ?>
 type="text"
															   name="archive_multiple_settings[breadcrumbs_title]"
															   id="breadcrumbs_title"
															   value="<?php 
        echo $archive_multiple_settings['breadcrumbs_title'];
        ?>
"/>
							</td>
						</tr>

					</table>
					<h3><?php 
        _e('Payment and currency', 'ecommerce-product-catalog');
        ?>
</h3>
					<table id="payment_table">
						<thead>
							<?php 
        implecode_settings_radio(__('Price', 'ecommerce-product-catalog'), 'product_currency_settings[price_enable]', $product_currency_settings['price_enable'], array('on' => __('On', 'ecommerce-product-catalog'), 'off' => __('Off', 'ecommerce-product-catalog')));
        ?>
						</thead>
						<tbody><?php 
        do_action('payment_settings_table_start');
        ?>
							<tr>
								<td><?php 
        _e('Your currency', 'ecommerce-product-catalog');
        ?>
:</td>
								<td><select id="product_currency" name="product_currency">
										<?php 
        $currencies = available_currencies();
        foreach ($currencies as $currency) {
            ?>
											<option name="product_currency[<?php 
            echo $currency;
            ?>
]"
													value="<?php 
            echo $currency;
            ?>
"<?php 
            selected($currency, $product_currency);
            ?>
><?php 
            echo $currency;
            ?>
</option>
												<?php 
        }
        ?>
									</select></td>
								<td rowspan="4">
									<div
										class="al-box info"><?php 
        _e('If you choose custom currency symbol, it will override "Your Currency" setting. This is very handy if you want to use not supported currency or a preferred symbol for your currency.', 'ecommerce-product-catalog');
        ?>
</div>
								</td>
							</tr>
							<tr>
								<td><?php 
        _e('Custom Currency Symbol', 'ecommerce-product-catalog');
        ?>
:</td>
								<td><input type="text" name="product_currency_settings[custom_symbol]"
										   class="small_text_box" id="product_currency_settings"
										   value="<?php 
        echo $product_currency_settings['custom_symbol'];
        ?>
"/></td>
							</tr>
							<?php 
        implecode_settings_radio(__('Currency position', 'ecommerce-product-catalog'), 'product_currency_settings[price_format]', $product_currency_settings['price_format'], array('before' => __('Before Price', 'ecommerce-product-catalog'), 'after' => __('After Price', 'ecommerce-product-catalog')));
        implecode_settings_radio(__('Space between currency & price', 'ecommerce-product-catalog'), 'product_currency_settings[price_space]', $product_currency_settings['price_space'], array('on' => __('On', 'ecommerce-product-catalog'), 'off' => __('Off', 'ecommerce-product-catalog')));
        implecode_settings_text(__('Thousands Separator', 'ecommerce-product-catalog'), 'product_currency_settings[th_sep]', $product_currency_settings['th_sep'], null, 1, 'small_text_box');
        implecode_settings_text(__('Decimal Separator', 'ecommerce-product-catalog'), 'product_currency_settings[dec_sep]', $product_currency_settings['dec_sep'], null, 1, 'small_text_box');
        ?>
						</tbody>
					</table>
					<script>jQuery( document ).ready( function () {
							jQuery( "input[name=\"product_currency_settings[price_enable]\"]" ).change( function () {
								if ( jQuery( this ).val() == 'off' && jQuery( this ).is( ':checked' ) ) {
									jQuery( "#payment_table tbody" ).hide( "slow" );
								}
								else {
									jQuery( "#payment_table tbody" ).show( "slow" );
								}
							} );
							jQuery( "input[name=\"product_currency_settings[price_enable]\"]" ).trigger( "change" );
		                        } );</script>
					<h3><?php 
        _e('Additional Settings', 'ecommerce-product-catalog');
        ?>
</h3>
					<table><?php 
        implecode_settings_checkbox(__('Disable SKU', 'ecommerce-product-catalog'), 'archive_multiple_settings[disable_sku]', $archive_multiple_settings['disable_sku']);
        ?>
					</table>
					<?php 
        do_action('general-settings');
        ?>
					<p class="submit">
						<input type="submit" class="button-primary"
							   value="<?php 
        _e('Save changes', 'ecommerce-product-catalog');
        ?>
"/>
					</p>
				</form>
			</div>
			<div class="helpers">
				<div class="wrapper"><?php 
        main_helper();
        doc_helper(__('shortcode', 'ecommerce-product-catalog'), 'product-catalog-shortcodes');
        doc_helper(__('sorting', 'ecommerce-product-catalog'), 'product-order-settings');
        //did_know_helper('support', __('You can get instant support by email','ecommerce-product-catalog'), 'https://implecode.com/wordpress/plugins/premium-support/')
        ?>
				</div>
			</div>
			<?php 
    }
    do_action('product-settings');
    permalink_options_update();
    ?>
	</div>

	<?php 
}