コード例 #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')));
            }
        }
    }
コード例 #2
0
ファイル: templates-functions.php プロジェクト: RA2WP/RA2WP
function content_product_adder_archive_before()
{
    $page_id = apply_filters('before_archive_post_id', get_product_listing_id());
    $page = empty($page_id) ? '' : get_post($page_id);
    if ($page != '') {
        if (get_integration_type() != 'simple') {
            $content = apply_filters("the_content", $page->post_content);
        } else {
            $content = $page->post_content;
        }
    } else {
        $content = '';
    }
    return '<div class="entry-summary">' . $content . '</div>';
}
コード例 #3
0
function create_product_categories()
{
    $archive_multiple_settings = get_multiple_settings();
    $category_enable = true;
    if (get_integration_type() == 'simple') {
        $category_enable = false;
    }
    $names = get_catalog_names();
    $names['singular'] = ucfirst($names['singular']);
    $labels = array('name' => sprintf(__('%s Categories', 'al-ecommerce-product-catalog'), $names['singular']), 'singular_name' => sprintf(__('%s Category', 'al-ecommerce-product-catalog'), $names['singular']), 'search_items' => sprintf(__('Search %s Categories', 'al-ecommerce-product-catalog'), $names['singular']), 'all_items' => sprintf(__('All %s Categories', 'al-ecommerce-product-catalog'), $names['singular']), 'parent_item' => sprintf(__('Parent %s Category', 'al-ecommerce-product-catalog'), $names['singular']), 'parent_item_colon' => sprintf(__('Parent %s Category:', 'al-ecommerce-product-catalog'), $names['singular']), 'edit_item' => sprintf(__('Edit %s Category', 'al-ecommerce-product-catalog'), $names['singular']), 'update_item' => sprintf(__('Update %s Category', 'al-ecommerce-product-catalog'), $names['singular']), 'add_new_item' => sprintf(__('Add New %s Category', 'al-ecommerce-product-catalog'), $names['singular']), 'new_item_name' => sprintf(__('New %s Category', 'al-ecommerce-product-catalog'), $names['singular']), 'menu_name' => sprintf(__('%s Categories', 'al-ecommerce-product-catalog'), $names['singular']));
    $args = array('public' => $category_enable, 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug' => apply_filters('product_category_slug_value_register', sanitize_title($archive_multiple_settings['category_archive_url'])), 'with_front' => false), 'capabilities' => array('manage_terms' => 'manage_product_categories', 'edit_terms' => 'edit_product_categories', 'delete_terms' => 'delete_product_categories', 'assign_terms' => 'assign_product_categories'));
    register_taxonomy('al_product-cat', 'al_product', $args);
    register_taxonomy_for_object_type('al_product-cat', 'al_product');
    // flush_rewrite_rules(false);
    //	check_permalink_options_update();
}
コード例 #4
0
ファイル: product.php プロジェクト: satokora/IT354Project
function create_product()
{
    global $wp_version;
    $enable_product_listing = get_option('enable_product_listing', 1);
    $slug = get_product_slug();
    if ($enable_product_listing == 1 && get_integration_type() != 'simple') {
        $product_listing_t = $slug;
    } else {
        $product_listing_t = false;
    }
    $names = get_catalog_names();
    $query_var = get_product_query_var();
    if ($wp_version < 3.8) {
        $reg_settings = array('labels' => array('name' => $names['plural'], 'singular_name' => $names['singular'], 'add_new' => sprintf(__('Add New %s', 'al-ecommerce-product-catalog'), ucfirst($names['singular'])), 'add_new_item' => sprintf(__('Add New %s', 'al-ecommerce-product-catalog'), ucfirst($names['singular'])), 'edit_item' => sprintf(__('Edit %s', 'al-ecommerce-product-catalog'), ucfirst($names['singular'])), 'new_item' => sprintf(__('Add New %s', 'al-ecommerce-product-catalog'), ucfirst($names['singular'])), 'view_item' => sprintf(__('View %s', 'al-ecommerce-product-catalog'), ucfirst($names['singular'])), 'search_items' => sprintf(__('Search %s', 'al-ecommerce-product-catalog'), ucfirst($names['plural'])), 'not_found' => sprintf(__('No %s found', 'al-ecommerce-product-catalog'), $names['plural']), 'not_found_in_trash' => sprintf(__('No %s found in trash', 'al-ecommerce-product-catalog'), $names['plural'])), 'public' => true, 'has_archive' => $product_listing_t, 'rewrite' => array('slug' => apply_filters('product_slug_value_register', $slug), 'with_front' => false), 'query_var' => $query_var, 'supports' => array('title', 'thumbnail'), 'register_meta_box_cb' => 'add_product_metaboxes', 'taxonomies' => array('al_product_cat'), 'menu_icon' => plugins_url() . '/ecommerce-product-catalog/img/product.png', 'capability_type' => 'product', 'capabilities' => array('publish_posts' => 'publish_products', 'edit_posts' => 'edit_products', 'edit_others_posts' => 'edit_others_products', 'edit_published_posts' => 'edit_published_products', 'edit_private_posts' => 'edit_private_products', 'delete_posts' => 'delete_products', 'delete_others_posts' => 'delete_others_products', 'delete_private_posts' => 'delete_private_products', 'delete_published_posts' => 'delete_published_products', 'read_private_posts' => 'read_private_products', 'edit_post' => 'edit_product', 'delete_post' => 'delete_product', 'read_post' => 'read_product'), 'exclude_from_search' => false);
    } else {
        $reg_settings = array('labels' => array('name' => $names['plural'], 'singular_name' => $names['singular'], 'add_new' => sprintf(__('Add New %s', 'al-ecommerce-product-catalog'), ucfirst($names['singular'])), 'add_new_item' => sprintf(__('Add New %s', 'al-ecommerce-product-catalog'), ucfirst($names['singular'])), 'edit_item' => sprintf(__('Edit %s', 'al-ecommerce-product-catalog'), ucfirst($names['singular'])), 'new_item' => sprintf(__('Add New %s', 'al-ecommerce-product-catalog'), ucfirst($names['singular'])), 'view_item' => sprintf(__('View %s', 'al-ecommerce-product-catalog'), ucfirst($names['singular'])), 'search_items' => sprintf(__('Search %s', 'al-ecommerce-product-catalog'), ucfirst($names['plural'])), 'not_found' => sprintf(__('No %s found', 'al-ecommerce-product-catalog'), $names['plural']), 'not_found_in_trash' => sprintf(__('No %s found in trash', 'al-ecommerce-product-catalog'), $names['plural'])), 'public' => true, 'has_archive' => $product_listing_t, 'rewrite' => array('slug' => apply_filters('product_slug_value_register', $slug), 'with_front' => false), 'query_var' => $query_var, 'supports' => array('title', 'thumbnail'), 'register_meta_box_cb' => 'add_product_metaboxes', 'taxonomies' => array('al_product-cat'), 'capability_type' => 'product', 'capabilities' => array('publish_posts' => 'publish_products', 'edit_posts' => 'edit_products', 'edit_others_posts' => 'edit_others_products', 'edit_published_posts' => 'edit_published_products', 'edit_private_posts' => 'edit_private_products', 'delete_posts' => 'delete_products', 'delete_others_posts' => 'delete_others_products', 'delete_private_posts' => 'delete_private_products', 'delete_published_posts' => 'delete_published_products', 'read_private_posts' => 'read_private_products', 'edit_post' => 'edit_product', 'delete_post' => 'delete_product', 'read_post' => 'read_product'), 'exclude_from_search' => false);
    }
    register_post_type('al_product', $reg_settings);
}
コード例 #5
0
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 
        }
    }
}
コード例 #6
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', '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 
}
コード例 #7
0
ファイル: templates.php プロジェクト: satokora/IT354Project
function product_page_content($content)
{
    if ('al_product' == get_quasi_post_type() && get_integration_type() == 'simple') {
        if (is_single()) {
            ob_start();
            content_product_adder();
            $content = ob_get_contents();
            ob_end_clean();
        }
    }
    return $content;
}
コード例 #8
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', '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 
}
コード例 #9
0
/**
 * Checks if sort drop down should be shown
 *
 * @global int $product_sort
 * @global object $wp_query
 * @return boolean
 */
function is_product_sort_bar_active()
{
    global $product_sort, $wp_query;
    if (get_integration_type() != 'simple' && (is_product_filters_active() || isset($product_sort) && $product_sort == 1 || !is_ic_shortcode_query() && ($wp_query->max_num_pages > 1 || $wp_query->found_posts > 0))) {
        return true;
    }
    return false;
}
コード例 #10
0
function product_breadcrumbs()
{
    if (get_integration_type() != 'simple' && !is_front_page()) {
        global $post;
        $post_type = get_post_type();
        $home_page = get_home_url();
        if (function_exists('additional_product_listing_url') && $post_type != 'al_product') {
            $catalog_id = catalog_id($post_type);
            $product_archives = additional_product_listing_url();
            $product_archive = $product_archives[$catalog_id];
            $archives_ids = get_option('additional_product_archive_id');
            $breadcrumbs_options = get_option('product_breadcrumbs', unserialize(DEFAULT_PRODUCT_BREADCRUMBS));
            if (empty($breadcrumbs_options['enable_product_breadcrumbs'][$catalog_id]) || !empty($breadcrumbs_options['enable_product_breadcrumbs'][$catalog_id]) && $breadcrumbs_options['enable_product_breadcrumbs'][$catalog_id] != 1) {
                return;
            }
            $product_archive_title_options = $breadcrumbs_options['breadcrumbs_title'][$catalog_id];
            if ($product_archive_title_options != '') {
                $product_archive_title = $product_archive_title_options;
            } else {
                $product_archive_title = get_the_title($archives_ids[$catalog_id]);
            }
        } else {
            $archive_multiple_settings = get_multiple_settings();
            if (empty($archive_multiple_settings['enable_product_breadcrumbs']) || !empty($archive_multiple_settings['enable_product_breadcrumbs']) && $archive_multiple_settings['enable_product_breadcrumbs'] != 1) {
                return;
            }
            $product_archive = product_listing_url();
            if ($archive_multiple_settings['breadcrumbs_title'] != '') {
                $product_archive_title = $archive_multiple_settings['breadcrumbs_title'];
            } else {
                $product_archive_title = get_product_listing_title();
            }
        }
        $additional = '';
        if (is_ic_product_page()) {
            $current_product = get_the_title();
        } else {
            if (is_ic_taxonomy_page()) {
                $obj = get_queried_object();
                $current_product = $obj->name;
                $taxonomy = isset($obj->taxonomy) ? $obj->taxonomy : 'al_product-cat';
                $current_category_id = $obj->term_id;
                $parents = array_filter(explode('|', ic_get_product_category_parents($current_category_id, $taxonomy, true, '|')));
                array_pop($parents);
                foreach ($parents as $parent) {
                    if (!empty($parent)) {
                        $additional .= ' » <span typeof="v:Breadcrumb">
		<span class="breadcrumb_last" property="v:title">' . $parent . '</span>
	</span>';
                    }
                }
            } else {
                if (is_search()) {
                    $current_product = __('Product Search', 'ecommerce-product-catalog');
                } else {
                    $current_product = '';
                }
            }
        }
        $bread = '<p id="breadcrumbs"><span xmlns:v="http://rdf.data-vocabulary.org/#"><span typeof="v:Breadcrumb"><a href="' . $home_page . '" rel="v:url" property="v:title">' . __('Home', 'ecommerce-product-catalog') . '</a></span>';
        if (!empty($product_archive)) {
            $bread .= ' » <span typeof="v:Breadcrumb"><a href="' . $product_archive . '" rel="v:url" property="v:title">' . $product_archive_title . '</a></span>';
        }
        if (!empty($additional)) {
            $bread .= $additional;
        }
        if (!empty($current_product)) {
            $bread .= ' » <span typeof="v:Breadcrumb"><span class="breadcrumb_last" property="v:title">' . $current_product . '</span></span></span>';
        }
        $bread .= '</p>';
        return $bread;
    }
}
コード例 #11
0
    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'));
        }
    }
コード例 #12
0
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('<strong>You are currently using eCommerce Product Catalog in Simple Mode</strong> &#8211; to switch to Advanced Mode you probably need Theme Integration.', 'al-ecommerce-product-catalog');
        ?>
</h4>
		<p class="submit"><a href="http://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=top-message" target="_blank" class="button-primary"><?php 
        _e('Theme Integration Guide', 'al-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', 'al-ecommerce-product-catalog');
        ?>
</a><a class="skip button" href="<?php 
        echo add_query_arg('hide_al_product_adder_support_check', 'true');
        ?>
"><?php 
        _e('I know, don\'t bug me', 'al-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('<strong>You are currently using eCommerce Product Catalog in Advanced Mode without the integration file</strong> &#8211; please see the guide for quick integration file creation.', 'al-ecommerce-product-catalog');
            ?>
</h4>
		<p class="submit"><a href="http://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=advanced-mode&key=top-message" target="_blank" class="button-primary"><?php 
            _e('Theme Integration Guide', 'al-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', 'al-ecommerce-product-catalog');
            ?>
</a><a class="skip button" href="<?php 
            echo add_query_arg('hide_al_product_adder_support_check', 'true');
            ?>
"><?php 
            _e('I know, don\'t bug me', 'al-ecommerce-product-catalog');
            ?>
</a></p>
	</div>
</div><?php 
        } 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 = 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.', 'al-ecommerce-product-catalog');
            ?>
</h4>
		<p class="submit"><a href="<?php 
            echo $sample_product_url;
            ?>
" class="button-primary"><?php 
            _e('Sample Product Page', 'al-ecommerce-product-catalog');
            ?>
</a><a href="http://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=default-mode&key=top-message" target="_blank" class="button"><?php 
            _e('Theme Integration Guide', 'al-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', 'al-ecommerce-product-catalog');
            ?>
</a><a class="skip button" href="<?php 
            echo add_query_arg('hide_al_product_adder_support_check', 'true');
            ?>
"><?php 
            _e('Hide this notice', 'al-ecommerce-product-catalog');
            ?>
</a></p>
	</div>
</div><?php 
        }
    }
}
コード例 #13
0
ファイル: functions.php プロジェクト: satokora/IT354Project
function product_breadcrumbs()
{
    if (get_integration_type() != 'simple') {
        global $post;
        $post_type = get_post_type();
        $home_page = get_home_url();
        if (function_exists('additional_product_listing_url') and $post_type != 'al_product') {
            $catalog_id = catalog_id($post_type);
            $product_archives = additional_product_listing_url();
            $product_archive = $product_archives[$catalog_id];
            $archives_ids = get_option('additional_product_archive_id');
            $breadcrumbs_options = get_option('product_breadcrumbs', unserialize(DEFAULT_PRODUCT_BREADCRUMBS));
            if (empty($breadcrumbs_options['enable_product_breadcrumbs'][$catalog_id]) || !empty($breadcrumbs_options['enable_product_breadcrumbs'][$catalog_id]) && $breadcrumbs_options['enable_product_breadcrumbs'][$catalog_id] != 1) {
                return;
            }
            $product_archive_title_options = $breadcrumbs_options['breadcrumbs_title'][$catalog_id];
            if ($product_archive_title_options != '') {
                $product_archive_title = $product_archive_title_options;
            } else {
                $product_archive_title = get_the_title($archives_ids[$catalog_id]);
            }
        } else {
            $archive_multiple_settings = get_multiple_settings();
            if (empty($archive_multiple_settings['enable_product_breadcrumbs']) || !empty($archive_multiple_settings['enable_product_breadcrumbs']) && $archive_multiple_settings['enable_product_breadcrumbs'] != 1) {
                return;
            }
            $product_archive = product_listing_url();
            if ($archive_multiple_settings['breadcrumbs_title'] != '') {
                $product_archive_title = $archive_multiple_settings['breadcrumbs_title'];
            } else {
                $product_archive_title = get_product_listing_title();
            }
        }
        $current_product = get_the_title($post->ID);
        if (is_ic_product_page()) {
            return '<p id="breadcrumbs">
<span xmlns:v="http://rdf.data-vocabulary.org/#">
	<span typeof="v:Breadcrumb">
		<a href="' . $home_page . '" rel="v:url" property="v:title">' . __('Home', 'al-ecommerce-product-catalog') . '</a>
	</span> » 
	<span typeof="v:Breadcrumb">
		<a href="' . $product_archive . '" rel="v:url" property="v:title">' . $product_archive_title . '</a>
	</span> » 
	<span typeof="v:Breadcrumb">
		<span class="breadcrumb_last" property="v:title">' . $current_product . '</span>
	</span>
</span>
</p>';
        } else {
            if (is_ic_taxonomy_page()) {
                return '<p id="breadcrumbs">
<span xmlns:v="http://rdf.data-vocabulary.org/#">
	<span typeof="v:Breadcrumb">
		<a href="' . $home_page . '" rel="v:url" property="v:title">' . __('Home', 'al-ecommerce-product-catalog') . '</a>
	</span> »
	<span typeof="v:Breadcrumb">
		<a href="' . $product_archive . '" rel="v:url" property="v:title">' . $product_archive_title . '</a>
	</span> »
	<span typeof="v:Breadcrumb">
		<span class="breadcrumb_last" property="v:title">' . $current_product . '</span>
	</span>
</span>
</p>';
            } else {
                return '<p id="breadcrumbs">
<span xmlns:v="http://rdf.data-vocabulary.org/#">
	<span typeof="v:Breadcrumb">
		<a href="' . $home_page . '" rel="v:url" property="v:title">' . __('Home', 'al-ecommerce-product-catalog') . '</a>
	</span> » 
	<span typeof="v:Breadcrumb">
		<span class="breadcrumb_last" property="v:title">' . $product_archive_title . '</span>
	</span>
</span>
</p>';
            }
        }
    }
}
コード例 #14
0
function product_page_content($content)
{
    if (is_ic_catalog_page() && get_integration_type() == 'simple') {
        if (is_single()) {
            ob_start();
            content_product_adder();
            $content = ob_get_contents();
            ob_end_clean();
        }
    }
    return $content;
}
コード例 #15
0
ファイル: extensions.php プロジェクト: nanookYs/orientreizen
function extension_box($name, $url, $desc, $comp = 'simple', $slug, $all_ic_plugins, $not_active_ic_plugins)
{
    if ($comp == 'adv' && get_integration_type() == 'simple') {
        $comp_txt = __('Advanced Mode Required', 'ecommerce-product-catalog');
        $comp_class = 'wrong';
    } else {
        $comp_txt = __('Ready to Install', 'ecommerce-product-catalog');
        $comp_class = 'good';
    }
    $return = '<div class="extension ' . $url . '">
	<a class="extension-name" href="https://implecode.com/wordpress/plugins/' . $url . '/#cam=extensions&key=' . $url . '"><h3><span>' . $name . '</span></h3><span class="click-span">' . __('Click for more', 'ecommerce-product-catalog') . '</span></a>
	<p>' . $desc . '</p>';
    $disabled = '';
    $current_key = get_option('custom_license_code');
    if (!current_user_can('install_plugins')) {
        $disabled = 'disabled';
        $current_key = '';
    }
    if (!empty($all_ic_plugins) && is_ic_plugin_active($slug, $all_ic_plugins)) {
        $return .= '<p><a href="https://implecode.com/support/" class="button-primary">Support</a> <a href="https://implecode.com/docs/" class="button-primary">Docs</a> <span class="comp installed">' . __('Active Extension', 'ecommerce-product-catalog') . '</span></p>';
    } else {
        if (!empty($not_active_ic_plugins) && is_ic_plugin_active($slug, $not_active_ic_plugins)) {
            $return .= '<p><a ' . $disabled . ' href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . urlencode($slug . '/' . $slug . '.php'), 'activate-plugin_' . $slug . '/' . $slug . '.php') . '" class="button-primary">Activate Now</a><span class="comp info">' . __('Installed Extension', 'ecommerce-product-catalog') . '</span></p>';
        } else {
            if ($comp_class == 'wrong') {
                $return .= '<p><a href="https://implecode.com/wordpress/plugins/' . $url . '/#cam=extensions&key=' . $url . '" class="button-primary">See the Extension</a><span class="comp ' . $comp_class . '">' . $comp_txt . '</span></p>';
            } else {
                $return .= '<form class="license_form" action=""><input type="hidden" name="implecode_install" value="1"><input type="hidden" name="url" value="' . $url . '"><input type="hidden" name="slug" value="' . $slug . '"><input type="hidden" name="post_type" value="al_product"><input type="hidden" name="page" value="extensions.php"><input type="text" name="license_key" ' . $disabled . ' class="wide" placeholder="License Key..." value="' . $current_key . '">';
                $return .= wp_nonce_field('install-implecode-plugin_' . $slug, '_wpnonce', 0, 0);
                $return .= '<p class="submit"><input type="submit" ' . $disabled . ' value="Install" class="button-primary"><span class="comp ' . $comp_class . '">' . $comp_txt . '</span> <a href="https://implecode.com/wordpress/plugins/' . $url . '/#cam=extensions&key=' . $url . '" class="button-secondary right">Get your key</a></form></p>';
            }
        }
    }
    $return .= '</div>';
    return $return;
}
コード例 #16
0
function product_page_content($content)
{
    if (is_main_query() && in_the_loop() && is_ic_product_page() && get_integration_type() == 'simple') {
        ob_start();
        content_product_adder();
        $content = ob_get_contents();
        ob_end_clean();
    }
    return $content;
}
コード例 #17
0
<?php

if (!defined('ABSPATH')) {
    exit;
    // Exit if accessed directly
}
/**
 * The template to display product description on product page or with a shortcode
 *
 * Copy it to your theme implecode folder to edit the output: your-theme-folder-name/implecode/product-description.php
 *
 * @version		1.1.2
 * @package		ecommerce-product-catalog/templates/template-parts/product-page
 * @author 		Norbert Dreszer
 */
$product_id = ic_get_product_id();
$product_description = get_product_description($product_id);
if (!empty($product_description)) {
    ?>
	<div class="product-description"><?php 
    if (get_integration_type() == 'simple') {
        echo apply_filters('product_simple_description', $product_description);
    } else {
        echo apply_filters('the_content', $product_description);
    }
    ?>
	</div>
	<?php 
}