WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Productpage as Homepage (14 posts)

  1. Frank2k
    Member
    Posted 1 year ago #

    Hello,

    I want a Productpage as Homepage.
    I cant find a option to ativate this. Tried to redirect the homepage to a productpage but then some plugins dont work.

    Does somebody know a solution ?

    Thanks

    http://wordpress.org/extend/plugins/woocommerce/

  2. Roy Ho
    Member
    Posted 1 year ago #

    By default WC creates a page called "Shop". That is the "catch all" products page.

    So if you want to make that your homepage. You can simply go to your settings->reading and set your frontpage displays on "Shop" in the dropdown menu.

  3. Frank2k
    Member
    Posted 1 year ago #

    Tnx for your quick reply.

    But i mean a single productpage. not the "catch all"

  4. Roy Ho
    Member
    Posted 1 year ago #

    Well when you say productpage, it usually mean shop page...You should have said single products page.

  5. Roy Ho
    Member
    Posted 1 year ago #

    The only way I can think of that may work is use htaccess file to redirect to your single products page on load...

    Why do you want your homepage to show a single products page though? Do you only sell one item?

  6. Frank2k
    Member
    Posted 1 year ago #

    its a kind of Deal site. I want the active deal (product) as Homepage.

  7. Roy Ho
    Member
    Posted 1 year ago #

    Or...you can create a page and put the shortcode of the product on the page. That will generate the detail of that product. And set that as your frontpage per the settings I mentioned above.

  8. Frank2k
    Member
    Posted 1 year ago #

    i have tried that, but the shortcode dont include the add to cart option.

  9. Roy Ho
    Member
    Posted 1 year ago #

    Yes it does...what shortcode are you using?

  10. Roy Ho
    Member
    Posted 1 year ago #

    Use:

    [add_to_cart id=""]

    For the add to cart button.

  11. Roy Ho
    Member
    Posted 1 year ago #

    Or if that still doesn't work for you. You make a duplicate of your index.php and name it home.php. Then open up the WC single products template and copy the code from that file and pasted it in your home.php replacing the loop that was once in there.

    Put your settings->reading frontpage back to default which is nothing selected. WordPress will now use your home.php template when your site first loads.

    Of course you will need to adjust the code abit so it will pull in the product that you want but shouldn't be too hard.

    If this is all too much for you to do, then I would suggest you have a developer to help you do it.

  12. Roy Ho
    Member
    Posted 1 year ago #

    Or you can do something like this..

    $product = get_product( $product_id );

    $product is an object that contains all information and methods you need to generate the single products information. You can put this in the home.php replacing the loop.

  13. Frank2k
    Member
    Posted 1 year ago #

    I use [product_page id="productid"]

    That code dont show the add to cart + Price.

    i am gonna try to edit the home.php

    my single-product.php from my theme have the following code:

    <?php
    /**
     * The Template for displaying all single products.
     *
     * Override this template by copying it to yourtheme/woocommerce/single-product.php
     *
     * @author 		WooThemes
     * @package 	WooCommerce/Templates
     * @version     1.6.4
     */ 
    
    remove_action( 'woocommerce_before_main_content', 'yit_shop_page_meta' );
    add_action( 'yit_before_content', 'yit_shop_page_meta' ); 
    
    get_header('shop');
    
    wp_enqueue_script( 'jquery-elastislider' );
    wp_enqueue_script( 'jquery-tipTip' ); ?>
    
        	<?php
        		/**
        		 * woocommerce_before_main_content hook
        		 *
        		 * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
        		 * @hooked woocommerce_breadcrumb - 20
        		 */
        		do_action('woocommerce_before_main_content');
        	?>
    
            <div itemscope itemtype="http://schema.org/Product" id="product-<?php the_ID(); ?>" <?php post_class(); ?>>
        		<?php while ( have_posts() ) : the_post(); ?>
    
        			<?php woocommerce_get_template_part( 'content', 'single-product' ); ?>
    
        		<?php endwhile; // end of the loop. ?>
            </div><!-- #product-<?php the_ID(); ?> -->
    
        	<?php
        		/**
        		 * woocommerce_after_main_content hook
        		 *
        		 * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
        		 */
        		do_action('woocommerce_after_main_content');
        	?>
    
        	<?php
        		/**
        		 * woocommerce_sidebar hook
        		 *
        		 * @hooked woocommerce_get_sidebar - 10
        		 */
        		do_action('woocommerce_sidebar');
        	?>
    
    <?php get_footer('shop'); ?>

    maybe you have a idea what to edit :D

  14. Frank2k
    Member
    Posted 1 year ago #

    I have tried a couple of things but i dont get the result i want.

    I want a the homepage as a single product page.
    Product ID is 355.

    in the post above is the code from single-product.php

    Maybe someone can help me ?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.