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')));
            }
        }
    }
/**
 * Shows theme intagration wizard
 *
 * @param type $atts
 */
function theme_integration_wizard($atts)
{
    $current_mode = get_real_integration_mode();
    if (is_ic_integration_wizard_page()) {
        $args = shortcode_atts(array('class' => 'fixed-box'), $atts);
        $class = esc_attr($args['class']);
        $box_content = '<h4>' . __('Advanced Mode Test', 'ecommerce-product-catalog') . '</h4>';
        /* $box_content .= '<script>jQuery(window).scroll( function() { if (isScrolledIntoView(".relative-box")) {jQuery(".fixed-box").hide("slow");}
        	  else {jQuery(".fixed-box").show("slow");}});
        	  function isScrolledIntoView(elem)
        	  {
        	  var docViewTop = jQuery(window).scrollTop();
        	  var docViewBottom = docViewTop + jQuery(window).height();
        	  var elemTop = jQuery(elem).offset().top;
        	  var elemBottom = elemTop + jQuery(elem).height();
        	  return ((docViewTop < elemTop) && (docViewBottom > elemBottom));
        	  //    return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
        	  }</script>'; */
        if (!isset($_GET['test_advanced'])) {
            $box_content .= '<p>' . __('eCommerce Product Catalog is currently running in Simple Mode.', 'ecommerce-product-catalog') . '</p>';
            $box_content .= '<p>' . __('In Simple Mode the product listing, product search and category pages are disabled (please read this Sample Product Page to fully understand the difference).', 'ecommerce-product-catalog') . '</p>';
            $box_content .= '<p>' . __('Please use the button below to check out how the product page looks in Automatic Advanced Mode.', 'ecommerce-product-catalog') . '</p>';
            $box_content .= '<p class="wp-core-ui"><a href="' . esc_url(add_query_arg('test_advanced', '1')) . '" class="button-primary">' . __('Start Advanced Mode Test', 'ecommerce-product-catalog') . '</a><a href="' . esc_url(add_query_arg('test_advanced', 'simple')) . '" class="button-secondary">' . __('Use Simple Mode', 'ecommerce-product-catalog') . '</a></p>';
            if ($current_mode == 'simple') {
                echo '<div id="integration_wizard" class="' . $class . '">' . implecode_info($box_content, 0) . '</div>';
            }
        } else {
            if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 1) {
                $box_content .= '<style>#integration_wizard.fixed-box {opacity: 0.8;}#integration_wizard.fixed-box:hover {opacity: 1;}</style>';
                $box_content .= '<p>' . __('Advanced Mode is temporary enabled for this page now.', 'ecommerce-product-catalog') . '</p>';
                //$box_content .= '<p>' . __( 'Please use the buttons below to let the script know if the Automatic Advanced Integration is done right.', 'ecommerce-product-catalog' ) . '</p>';
                $box_content .= '<p style="margin-bottom: 0">' . __('Make some adjustments if necessary (you can change it at any time later)', 'ecommerce-product-catalog') . ':</p>';
                $box_content .= '<table class="styling-adjustments">';
                $integration_settings = get_integration_settings();
                $box_content .= implecode_settings_number(__('Width', 'ecommerce-product-catalog'), 'container_width', $integration_settings['container_width'], '%', 0, null, null, 0);
                $box_content .= implecode_settings_text_color(__('Background', 'ecommerce-product-catalog'), 'container_bg', $integration_settings['container_bg'], null, 0, null, '{change: function(event, ui){ var hexcolor = jQuery( this ).wpColorPicker( "color" ); jQuery("#container").css("background", hexcolor); jQuery("#container").css("overflow", "hidden"); jQuery("#container").css("width", jQuery("input[name=\\"container_width\\"]").val()+"%");}}');
                $box_content .= implecode_settings_number(__('Padding', 'ecommerce-product-catalog'), 'container_padding', $integration_settings['container_padding'], 'px', 0, null, null, 0);
                if (!defined('AL_SIDEBAR_PLUGIN_BASE_PATH')) {
                    $box_content .= implecode_settings_radio(__('Default Sidebar', 'ecommerce-product-catalog'), 'default_sidebar', $integration_settings['default_sidebar'], array('none' => __('Disabled', 'ecommerce-product-catalog'), 'left' => __('Left', 'ecommerce-product-catalog'), 'right' => __('Right', 'ecommerce-product-catalog')), 0);
                    if ($integration_settings['default_sidebar'] == 'none') {
                        $box_content .= '<style>#catalog_sidebar {display: none;}</style>';
                    }
                }
                $box_content .= implecode_settings_checkbox(__('Disable breadcrumbs', 'ecommerce-product-catalog'), 'disable_breadcrumbs', $integration_settings['disable_breadcrumbs'], 0);
                $box_content .= implecode_settings_checkbox(__('Disable Name', 'ecommerce-product-catalog'), 'disable_name', $integration_settings['disable_name'], 0);
                $box_content .= implecode_settings_checkbox(__('Disable Image', 'ecommerce-product-catalog'), 'disable_image', $integration_settings['disable_image'], 0);
                $box_content .= implecode_settings_checkbox(__('Disable Price', 'ecommerce-product-catalog'), 'disable_price', $integration_settings['disable_price'], 0);
                $box_content .= implecode_settings_checkbox(__('Disable Shipping', 'ecommerce-product-catalog'), 'disable_shipping', $integration_settings['disable_shipping'], 0);
                $box_content .= implecode_settings_checkbox(__('Disable Attributes', 'ecommerce-product-catalog'), 'disable_attributes', $integration_settings['disable_attributes'], 0);
                $box_content .= '</table>';
                $box_content .= '<style>#integration_wizard .al-box table tbody, #integration_wizard .al-box table tr, #integration_wizard .al-box table td {border: 0; background: transparent;} #integration_wizard .al-box table.styling-adjustments td {vertical-align: middle;font-size: 14px; color: rgb(136, 136, 136); text-align: left;} #integration_wizard .wp-picker-container {padding-top: 5px;}html #integration_wizard.fixed-box .al-box table input.wp-picker-clear {background: #ededed; transition: none; padding: 1px 6px; border: 1px solid #000; color: #000; margin: 0; margin-left: 6px;}#integration_wizard .wp-picker-holder{position: absolute;}</style>';
                $box_content .= '<script>jQuery("input[name=\\"container_width\\"]").change(function() { jQuery("#container").css("width", jQuery(this).val()+"%");jQuery("#container").css("margin", "0 auto");});';
                $box_content .= 'jQuery("input[name=\\"container_padding\\"]").change(function() { jQuery("#container #content").css("padding", jQuery(this).val()+"px");jQuery("#container").css("box-sizing", "border-box");jQuery("#container #catalog_sidebar").css("padding", jQuery(this).val()+"px");});';
                $box_content .= 'jQuery("input[name=\\"disable_breadcrumbs\\"]").change(function() { if (jQuery(this).is(":checked")) { jQuery("p#breadcrumbs").hide();} else {jQuery("p#breadcrumbs").show();}});';
                $box_content .= 'jQuery("input[name=\\"disable_name\\"]").change(function() { if (jQuery(this).is(":checked")) { jQuery("h1.product-name").hide();} else {jQuery("h1.product-name").show();}});';
                $box_content .= 'jQuery("input[name=\\"disable_image\\"]").change(function() { if (jQuery(this).is(":checked")) { jQuery("div.product-image").hide();jQuery("#product_details").addClass("no-image");} else {jQuery("div.product-image").show();jQuery("#product_details").removeClass("no-image");}});';
                $box_content .= 'jQuery("input[name=\\"disable_price\\"]").change(function() { if (jQuery(this).is(":checked")) { jQuery("table.price-table").hide();} else {jQuery("table.price-table").show();}});';
                $box_content .= 'jQuery("input[name=\\"disable_shipping\\"]").change(function() { if (jQuery(this).is(":checked")) { jQuery("table.shipping-table").hide();} else {jQuery("table.shipping-table").show();}});';
                $box_content .= 'jQuery("input[name=\\"disable_attributes\\"]").change(function() { if (jQuery(this).is(":checked")) { jQuery("#product_features").hide();} else {jQuery("#product_features").show();}});';
                $box_content .= 'jQuery("input[name=\\"default_sidebar\\"]").change(function() { if (jQuery(this).is(":checked")) { sidebar = jQuery(this).val();if (sidebar == "left") {jQuery("#catalog_sidebar").show();jQuery("#catalog_sidebar").css("float","left");jQuery(".product-catalog #content").css("width","70%");jQuery(".product-catalog #content").css("float","right");} else if (sidebar == "right") {jQuery("#catalog_sidebar").show();jQuery("#catalog_sidebar").css("float","right");jQuery(".product-catalog #content").css("width","70%");jQuery(".product-catalog #content").css("float","left");} else {jQuery("#catalog_sidebar").hide();jQuery(".product-catalog #content").css("width","100%");jQuery(".product-catalog #content").css("float","none");}}});';
                $box_content .= '</script>';
                //$box_content .= '<script>jQuery("input[name=\"container_bg\"]").change(function() { jQuery("#container").css("background", jQuery(this).val());});</script>';
                $box_content .= '<p>' . __('Is everything looking fine now?', 'ecommerce-product-catalog') . '</p>';
                $box_content .= '<script>jQuery(document).ready(function() {
    jQuery("a.integration-ok").click(function(e) {
	clicked = jQuery(this).attr("href");
	e.preventDefault();
	var breadcrumbs = 0;
	if (jQuery("input[name=\\"disable_breadcrumbs\\"]").is(":checked")) {
		breadcrumbs = 1;
	}
	var name = 0;
	if (jQuery("input[name=\\"disable_name\\"]").is(":checked")) {
		name = 1;
	}
	var image = 0;
	if (jQuery("input[name=\\"disable_image\\"]").is(":checked")) {
		image = 1;
	}
	var price = 0;
	if (jQuery("input[name=\\"disable_price\\"]").is(":checked")) {
		price = 1;
	}
	var shipping = 0;
	if (jQuery("input[name=\\"disable_shipping\\"]").is(":checked")) {
		shipping = 1;
	}
	var attributes = 0;
	if (jQuery("input[name=\\"disable_attributes\\"]").is(":checked")) {
		attributes = 1;
	}
	default_sidebar = jQuery("input[name=\\"default_sidebar\\"]:checked").val();
		var data = {
			"action": "save_wizard",
			"container_width": jQuery("input[name=\\"container_width\\"]").val(),
			"container_padding": jQuery("input[name=\\"container_padding\\"]").val(),
			"container_bg": jQuery("input[name=\\"container_bg\\"]").val(),
			"disable_breadcrumbs": breadcrumbs,
			"disable_name": name,
			"disable_image": image,
			"disable_price": price,
			"disable_shipping": shipping,
			"disable_attributes": attributes,
			"default_sidebar": default_sidebar
		};

		jQuery.post("' . admin_url('admin-ajax.php') . '", data, function(response) {
			window.location.href = clicked;
		});
	}); });
</script>';
                $box_content .= '<p class="wp-core-ui"><a href="' . esc_url(add_query_arg('test_advanced', 'ok')) . '" class="button-primary integration-ok">' . __('It\'s Fine', 'ecommerce-product-catalog') . '</a><a href="' . esc_url(add_query_arg('test_advanced', 'bad')) . '" class="button-secondary">' . __('It\'s Broken', 'ecommerce-product-catalog') . '</a></p>';
                echo '<div id="integration_wizard" class="' . $class . '">' . implecode_info($box_content, 0) . '</div>';
            } else {
                if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 'bad') {
                    $box_content .= '<p>' . __('It seems that Manual Theme Integration is needed in order to use Advanced Mode with your current theme.', 'ecommerce-product-catalog') . '</p>';
                    $box_content .= '<h4>' . __('You Have 3 choices', 'ecommerce-product-catalog') . ':</h4>';
                    $box_content .= '<ol>';
                    $box_content .= '<li>' . __('Get the Manual Theme Integration done.', 'ecommerce-product-catalog') . '</li>';
                    $box_content .= '<li>' . __('Keep using Simple Mode which is still functional.', 'ecommerce-product-catalog') . '</li>';
                    $box_content .= '<li>' . __('Switch the theme.', 'ecommerce-product-catalog') . '</li>';
                    $box_content .= '</ol>';
                    $box_content .= '<p>' . __('Please make your choice below or switch the theme.', 'ecommerce-product-catalog') . '</p>';
                    $box_content .= '<p class="wp-core-ui"><a target="_blank" href="https://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=integration-advanced-fail" class="button-primary">' . __('Free Theme Integration Guide', 'ecommerce-product-catalog') . '</a><a href="' . esc_url(add_query_arg('test_advanced', 'simple')) . '" class="button-secondary">' . __('Use Simple Mode', 'ecommerce-product-catalog') . '</a></p>';
                    enable_simple_mode();
                    echo '<div id="integration_wizard" class="' . $class . '">' . implecode_warning($box_content, 0) . '</div>';
                } else {
                    if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 'ok') {
                        $box_content .= '<p>' . __('Congratulations! eCommerce Product Catalog is working on Advanced Mode now. You can go to admin and add the products to the catalog.', 'ecommerce-product-catalog') . '</p>';
                        $box_content .= '<p>' . __('If you are a developer or would like to have full control on the product pages templates we still recommend to proceed with manual integration.', 'ecommerce-product-catalog') . '</p>';
                        $box_content .= '<p>' . __('You can switch between modes at any time in Product Settings.', 'ecommerce-product-catalog') . '</p>';
                        $box_content .= '<p class="wp-core-ui"><a href="' . admin_url('edit.php?post_type=al_product') . '" class="button-primary">' . __('Go to Admin', 'ecommerce-product-catalog') . '</a><a target="_blank" href="https://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=advanced-mode&key=integration-advanced-success" class="button-secondary">' . __('Free Theme Integration Guide', 'ecommerce-product-catalog') . '</a></p>';
                        enable_advanced_mode();
                        echo '<div id="integration_wizard" class="' . $class . '">' . implecode_success($box_content, 0) . '</div>';
                    } else {
                        if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 'simple') {
                            $box_content .= '<p>' . __('You are using simple mode now.', 'ecommerce-product-catalog') . '</p>';
                            $box_content .= '<p>' . __('You can switch between modes at any time in Product Settings.', 'ecommerce-product-catalog') . '</p>';
                            $box_content .= '<p>' . __('Use the buttons below to try the advanced integration again or go to admin and start adding your products.', 'ecommerce-product-catalog') . '</p>';
                            $box_content .= '<p class="wp-core-ui"><a href="' . admin_url('edit.php?post_type=al_product') . '" class="button-primary">' . __('Go to Admin', 'ecommerce-product-catalog') . '</a><a href="' . esc_url(add_query_arg('test_advanced', '1')) . '" class="button-secondary">' . __('Restart Advanced Mode Test', 'ecommerce-product-catalog') . '</a></p>';
                            enable_simple_mode();
                            echo '<div id="integration_wizard" class="' . $class . '">' . implecode_success($box_content, 0) . '</div>';
                        }
                    }
                }
            }
        }
    }
}
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', 'al-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', 'al-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', 'al-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', 'al-ecommerce-product-catalog');
            ?>
</h3><?php 
            if (get_integration_type() == 'simple') {
                $disabled = 'disabled';
                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.', 'al-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.', 'al-ecommerce-product-catalog') . '</p>');
            }
            ?>
						<table>
							<?php 
            implecode_settings_radio(__('Choose theme integration type', 'al-ecommerce-product-catalog'), 'archive_multiple_settings[integration_type]', $archive_multiple_settings['integration_type'], array('simple' => __('Simple Integration<br>', 'al-ecommerce-product-catalog'), 'advanced' => __('Advanced Integration', 'al-ecommerce-product-catalog')));
            ?>
						</table>
					<?php 
        }
        ?>
					<h3><?php 
        _e('Product Catalog', 'al-ecommerce-product-catalog');
        ?>
</h3>
					<table><?php 
        implecode_settings_text(__('Catalog Singular Name', 'al-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.', 'al-ecommerce-product-catalog'));
        implecode_settings_text(__('Catalog Plural Name', 'al-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.', 'al-ecommerce-product-catalog'));
        ?>
					</table>

					<h3><?php 
        _e('Product listing page', 'al-ecommerce-product-catalog');
        ?>
</h3><?php 
        if ($disabled == 'simple') {
            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.', 'al-ecommerce-product-catalog'), 'http://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=product-listing'));
        }
        ?>
					<table>
						<tr>
							<td style="width: 180px">
								<?php 
        _e('Enable Product Listing Page', 'al-ecommerce-product-catalog');
        ?>
:
							</td>
							<td>
								<input <?php 
        echo $disabled;
        ?>
									title="<?php 
        _e('Disable and use [show_products] shortcode to display the products.', 'al-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', 'al-ecommerce-product-catalog');
        ?>
:
							</td>
							<td><?php 
        if ($enable_product_listing == 1) {
            $listing_url = product_listing_url();
            select_page('product_archive', __('Default', 'al-ecommerce-product-catalog'), $product_archive, true, $listing_url);
        } else {
            select_page('product_archive', __('Default', 'al-ecommerce-product-catalog'), $product_archive, true);
        }
        ?>
							</td>
						</tr> <?php 
        /*
        						  <tr>
        						  <td><?php _e('Product listing URL', 'al-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', 'al-ecommerce-product-catalog');
        ?>
 </td>
							<td><input <?php 
        echo $disabled;
        ?>
									title="<?php 
        _e('You can also use shortcode with products_limit attribute to set this.', 'al-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', 'al-ecommerce-product-catalog');
        ?>
								.
							</td>
						</tr><?php 
        implecode_settings_radio(__('Product listing shows', 'al-ecommerce-product-catalog'), 'archive_multiple_settings[product_listing_cats]', $archive_multiple_settings['product_listing_cats'], array('off' => __('Products', 'al-ecommerce-product-catalog') . '<br>', 'on' => __('Products & Main Categories', 'al-ecommerce-product-catalog') . '<br>', 'cats_only' => __('Main Categories', 'al-ecommerce-product-catalog')));
        $sort_options = get_product_sort_options();
        implecode_settings_radio(__('Product order', 'al-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.', 'al-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.', 'al-ecommerce-product-catalog'));
        ?>
					<h3><?php 
        _e('Categories Settings', 'al-ecommerce-product-catalog');
        ?>
</h3><?php 
        if ($disabled != '') {
            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.', 'al-ecommerce-product-catalog'), 'http://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=categories-settings'));
        }
        ?>
					<table>
						<?php 
        if (is_ic_permalink_product_catalog()) {
            ?>
							<tr>
								<td><?php 
            _e('Categories Parent URL', 'al-ecommerce-product-catalog');
            ?>
:</td>
								<?php 
            $site_url = site_url();
            $urllen = strlen($site_url);
            if ($urllen > 25) {
                $site_url = substr($site_url, 0, 11) . '...' . 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.', 'al-ecommerce-product-catalog');
            ?>
"
																										  id="category_archive_url"
																										  value="<?php 
            echo sanitize_title($archive_multiple_settings['category_archive_url']);
            ?>
"/>/<?php 
            _e('category-name', 'al-ecommerce-product-catalog');
            ?>
									/
								</td>
							</tr><?php 
        }
        implecode_settings_radio(__('Category Page shows', 'al-ecommerce-product-catalog'), 'archive_multiple_settings[category_top_cats]', $archive_multiple_settings['category_top_cats'], array('off' => __('Products', 'al-ecommerce-product-catalog') . '<br>', 'on' => __('Products & Subcategories', 'al-ecommerce-product-catalog') . '<br>', 'only_subcategories' => __('Subcategories', 'al-ecommerce-product-catalog')));
        implecode_settings_radio(__('Categories Display', 'al-ecommerce-product-catalog'), 'archive_multiple_settings[cat_template]', $archive_multiple_settings['cat_template'], array('template' => __('Template<br>', 'al-ecommerce-product-catalog'), 'link' => __('URLs', 'al-ecommerce-product-catalog')), true, array('template' => __('Display categories with the same listing theme as products.', 'al-ecommerce-product-catalog'), 'link' => __('Display categories as simple links.', 'al-ecommerce-product-catalog')));
        implecode_settings_checkbox(__('Disable Image on Category Page', 'al-ecommerce-product-catalog'), 'archive_multiple_settings[cat_image_disabled]', $archive_multiple_settings['cat_image_disabled']);
        do_action('product_category_settings', $archive_multiple_settings);
        ?>
					</table>
					<h3><?php 
        _e('SEO Settings', 'al-ecommerce-product-catalog');
        ?>
</h3><?php 
        if ($disabled != '') {
            implecode_warning(sprintf(__('SEO settings are disabled with simple theme integration. See <a href="%s">Theme Integration Guide</a> to enable SEO settings.', 'al-ecommerce-product-catalog'), 'http://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=seo-settings'));
        }
        ?>
					<table>
						<?php 
        implecode_settings_text(__('Archive SEO Title', 'al-ecommerce-product-catalog'), 'archive_multiple_settings[seo_title]', $archive_multiple_settings['seo_title']);
        implecode_settings_checkbox(__('Enable SEO title separator', 'al-ecommerce-product-catalog'), 'archive_multiple_settings[seo_title_sep]', $archive_multiple_settings['seo_title_sep']);
        ?>

					</table>
					<h3><?php 
        _e('Breadcrumbs Settings', 'al-ecommerce-product-catalog');
        ?>
</h3><?php 
        if ($disabled != '') {
            implecode_warning(sprintf(__('Breadcrumbs are disabled with simple theme integration. See <a href="%s">Theme Integration Guide</a> to enable product breadcrumbs.', 'al-ecommerce-product-catalog'), 'http://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=breadcrumbs-settings'));
        }
        ?>
					<table>
						<tr>
							<td><?php 
        _e('Enable Product Breadcrumbs:', 'al-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:', 'al-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', 'al-ecommerce-product-catalog');
        ?>
</h3>
					<table id="payment_table">
						<thead>
							<?php 
        implecode_settings_radio(__('Price', 'al-ecommerce-product-catalog'), 'product_currency_settings[price_enable]', $product_currency_settings['price_enable'], array('on' => __('On<br>', 'al-ecommerce-product-catalog'), 'off' => __('Off', 'al-ecommerce-product-catalog')));
        ?>
						</thead>
						<tbody><?php 
        do_action('payment_settings_table_start');
        ?>
							<tr>
								<td><?php 
        _e('Your currency', 'al-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.', 'al-ecommerce-product-catalog');
        ?>
</div>
								</td>
							</tr>
							<tr>
								<td><?php 
        _e('Custom Currency Symbol', 'al-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', 'al-ecommerce-product-catalog'), 'product_currency_settings[price_format]', $product_currency_settings['price_format'], array('before' => __('Before Price<br>', 'al-ecommerce-product-catalog'), 'after' => __('After Price', 'al-ecommerce-product-catalog')));
        implecode_settings_radio(__('Space between currency & price', 'al-ecommerce-product-catalog'), 'product_currency_settings[price_space]', $product_currency_settings['price_space'], array('on' => __('On<br>', 'al-ecommerce-product-catalog'), 'off' => __('Off', 'al-ecommerce-product-catalog')));
        implecode_settings_text(__('Thousands Separator', 'al-ecommerce-product-catalog'), 'product_currency_settings[th_sep]', $product_currency_settings['th_sep'], null, 1, 'small_text_box');
        implecode_settings_text(__('Decimal Separator', 'al-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', 'al-ecommerce-product-catalog');
        ?>
</h3>
					<table><?php 
        implecode_settings_checkbox(__('Disable SKU', 'al-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', 'al-ecommerce-product-catalog');
        ?>
"/>
					</p>
				</form>
			</div>
			<div class="helpers">
				<div class="wrapper"><?php 
        main_helper();
        doc_helper(__('shortcode', 'al-ecommerce-product-catalog'), 'product-shortcode');
        //did_know_helper('support', __('You can get instant support by email','al-ecommerce-product-catalog'), 'http://implecode.com/wordpress/plugins/premium-support/')
        ?>
				</div>
			</div>
			<?php 
    }
    do_action('product-settings');
    permalink_options_update();
    ?>
	</div>

	<?php 
}
Exemple #4
0
function theme_integration_shortcode($atts)
{
    $current_mode = get_real_integration_mode();
    if (current_user_can("delete_private_products") && !is_advanced_mode_forced()) {
        $args = shortcode_atts(array('class' => 'relative-box'), $atts);
        $class = esc_attr($args['class']);
        $box_content = '<h4>' . __('Advanced Mode Test', 'al-ecommerce-product-catalog') . '</h4>';
        $box_content .= '<script>jQuery(window).scroll( function() { if (isScrolledIntoView(".relative-box")) {jQuery(".fixed-box").hide("slow");}
else {jQuery(".fixed-box").show("slow");}});
function isScrolledIntoView(elem)
{
    var docViewTop = jQuery(window).scrollTop();
    var docViewBottom = docViewTop + jQuery(window).height();
    var elemTop = jQuery(elem).offset().top;
    var elemBottom = elemTop + jQuery(elem).height();
    return ((docViewTop < elemTop) && (docViewBottom > elemBottom));
//    return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
}</script>';
        if (!isset($_GET['test_advanced'])) {
            $box_content .= '<p>' . __('eCommerce Product Catalog is currently running in Simple Mode.', 'al-ecommerce-product-catalog') . '</p>';
            $box_content .= '<p>' . __('In Simple Mode the product listing, product search and category pages are disabled (please read this Sample Product Page to fully understand the difference).', 'al-ecommerce-product-catalog') . '</p>';
            $box_content .= '<p>' . __('Please use the button below to check out how the product page looks in Automatic Advanced Mode.', 'al-ecommerce-product-catalog') . '</p>';
            $box_content .= '<p class="wp-core-ui"><a href="' . add_query_arg('test_advanced', '1') . '" class="button-primary">' . __('Start Advanced Mode Test', 'al-ecommerce-product-catalog') . '</a><a href="' . add_query_arg('test_advanced', 'simple') . '" class="button-secondary">' . __('Use Simple Mode', 'al-ecommerce-product-catalog') . '</a></p>';
            if ($current_mode == 'simple') {
                return '<div class="' . $class . '">' . implecode_info($box_content, 0) . '</div>';
            }
        } else {
            if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 1) {
                $box_content .= '<p>' . __('Advanced Mode is temporary enabled for this page now.', 'al-ecommerce-product-catalog') . '</p>';
                $box_content .= '<p>' . __('Please use the buttons below to let the script know if the Automatic Advanced Integration is done right.', 'al-ecommerce-product-catalog') . '</p>';
                $box_content .= '<p>' . __('Is everything looking fine, without design break and correct sidebar position?', 'al-ecommerce-product-catalog') . '</p>';
                $box_content .= '<p class="wp-core-ui"><a href="' . add_query_arg('test_advanced', 'ok') . '" class="button-primary">' . __('It\'s Fine', 'al-ecommerce-product-catalog') . '</a><a href="' . add_query_arg('test_advanced', 'bad') . '" class="button-secondary">' . __('It\'s Broken', 'al-ecommerce-product-catalog') . '</a></p>';
                return '<div class="' . $class . '">' . implecode_info($box_content, 0) . '</div>';
            } else {
                if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 'bad') {
                    $box_content .= '<p>' . __('It seems that Manual Theme Integration is needed in order to use Advanced Mode with your current theme.', 'al-ecommerce-product-catalog') . '</p>';
                    $box_content .= '<h4>' . __('You Have 3 choices', 'al-ecommerce-product-catalog') . ':</h4>';
                    $box_content .= '<ol>';
                    $box_content .= '<li>' . __('Get the Manual Theme Integration done.', 'al-ecommerce-product-catalog') . '</li>';
                    $box_content .= '<li>' . __('Keep using Simple Mode which is still functional.', 'al-ecommerce-product-catalog') . '</li>';
                    $box_content .= '<li>' . __('Switch the theme.', 'al-ecommerce-product-catalog') . '</li>';
                    $box_content .= '</ol>';
                    $box_content .= '<p>' . __('Please make your choice below or switch the theme.', 'al-ecommerce-product-catalog') . '</p>';
                    $box_content .= '<p class="wp-core-ui"><a target="_blank" href="http://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=integration-advanced-fail" class="button-primary">' . __('Free Theme Integration Guide', 'al-ecommerce-product-catalog') . '</a><a href="' . add_query_arg('test_advanced', 'simple') . '" class="button-secondary">' . __('Use Simple Mode', 'al-ecommerce-product-catalog') . '</a></p>';
                    enable_simple_mode();
                    return '<div class="' . $class . '">' . implecode_warning($box_content, 0) . '</div>';
                } else {
                    if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 'ok') {
                        $box_content .= '<p>' . __('Congratulations! eCommerce Product Catalog is working on Advanced Mode now. You can go to admin and add the products to the catalog.', 'al-ecommerce-product-catalog') . '</p>';
                        $box_content .= '<p>' . __('If you are a developer or would like to have full control on the product pages templates we still recommend to proceed with manual integration.', 'al-ecommerce-product-catalog') . '</p>';
                        $box_content .= '<p>' . __('You can switch between modes at any time in Product Settings.', 'al-ecommerce-product-catalog') . '</p>';
                        $box_content .= '<p class="wp-core-ui"><a href="' . admin_url() . '" class="button-primary">' . __('Go to Admin', 'al-ecommerce-product-catalog') . '</a><a target="_blank" href="http://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=advanced-mode&key=integration-advanced-success" class="button-secondary">' . __('Free Theme Integration Guide', 'al-ecommerce-product-catalog') . '</a></p>';
                        enable_advanced_mode();
                        return '<div class="' . $class . '">' . implecode_success($box_content, 0) . '</div>';
                    } else {
                        if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 'simple') {
                            $box_content .= '<p>' . __('You are using simple mode now.', 'al-ecommerce-product-catalog') . '</p>';
                            $box_content .= '<p>' . __('You can switch between modes at any time in Product Settings.', 'al-ecommerce-product-catalog') . '</p>';
                            $box_content .= '<p>' . __('Use the buttons below to try the advanced integration again or go to admin and start adding your products.', 'al-ecommerce-product-catalog') . '</p>';
                            $box_content .= '<p class="wp-core-ui"><a href="' . admin_url() . '" class="button-primary">' . __('Go to Admin', 'al-ecommerce-product-catalog') . '</a><a href="' . add_query_arg('test_advanced', '1') . '" class="button-secondary">' . __('Restart Advanced Mode Test', 'al-ecommerce-product-catalog') . '</a></p>';
                            enable_simple_mode();
                            return '<div class="' . $class . '">' . implecode_success($box_content, 0) . '</div>';
                        }
                    }
                }
            }
        }
    }
}
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 
}
    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:', 'al-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', 'al-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', 'al-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', 'al-ecommerce-product-catalog');
            ?>
</label>
					<?php 
            $object = $this;
            do_action('product_categories_widget_settings', $instance, $object);
            ?>
 </p> <?php 
        } else {
            implecode_warning(sprintf(__('Category widget is disabled with simple theme integration. Please see <a target="_blank" href="%s">Theme Integration Guide</a> to enable product category widget.', 'al-ecommerce-product-catalog'), 'http://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=category-widget'));
        }
    }
Exemple #7
0
function simple_prepare_csv_file($type = 'w')
{
    $csv_temp = wp_upload_dir();
    ini_set('auto_detect_line_endings', true);
    $fp = fopen($csv_temp['basedir'] . '/simple-products.csv', $type) or die(implecode_warning(sprintf(__('Permission error. Please check WordPress uploads %sfolder permissions%s.', 'ecommerce-product-catalog'), '<a href="https://codex.wordpress.org/Changing_File_Permissions">', '</a>'), 0));
    return $fp;
}