WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Custom single-product.php template for a specific product? (2 posts)

  1. ronaldfuquay
    Member
    Posted 11 months ago #

    Ok I have an online store at http://www.tapsbus.com where we sell fares and passes. The stock single-product.php template works well for these products.

    However, I am trying to add an airport shuttle service product that uses the gravity forms extension to the store and I need a custom template for that specific product. The stock template crams the form to the right to make room for an image and I want the form to take up the content area and do not need the image.

    I have been able to fix this using two methods; through css as well as adding the following code to functions.php
    remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );

    The only issue is that both solutions above affect all products. my attempts at creating conditional php or condition css have failed.

    Can anyone help me with this?

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

  2. Roy Ho
    Member
    Posted 11 months ago #

    Well if you already have a working solution and just need to wrap a conditional around it, you can always use the trusted post global.

    global $post;
    
    // assume your product id is 1255
    
    if ( $post->ID === 1255 ) {
         // do your special code here.
    }

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.