Support » Plugin: Jigoshop » Custom template of single products for specific category

  • Hello!
    I have a standart template that use all single products of my cataloge. But I have a special category (for example, “Special offer”) and I want a different design and structure of that products from a .php file.

    How can I do that?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Jigoshop Support – Marcin

    (@azrielnefezen)

    Hi
    Jigoshop 1.x or Jigoshop eCommerce?

    Jigoshop, a WordPress eCommerce plugin.

    Plugin Author Jigoshop Support – Marcin

    (@azrielnefezen)

    So Jigoshop 1.x it is – you would need to edit the “taxonomy_product_cat.php” file from wp-content/plugins/jigoshop/templates – simply copy the file and include the case, when the queried term is your term – move the previous contents of the file into an “else” clause and you’re all set 🙂

    Thanks! I will try.
    Can I copy this file into my theme directory (theme/jigoshop/) and load from there for safely updating a plugin?

    Plugin Author Jigoshop Support – Marcin

    (@azrielnefezen)

    yup 🙂

    Could you, please, help?

    First, I copied a file taxonomy_product_cat.php to my theme directory.
    Second, I created a new file for a new template (example.php).
    Third, I checked what category ID I need (for example, it’s an ’18’).

    After that changed a file taxonomy_product_cat.php like this:

    
    <?php if ( have_posts() ) : ?>                                
            <?php /* The loop */ ?>
            <?php if (query_posts('product_cat=18')) while ( have_posts() ) : the_post(); ?>
                    <?php jigoshop_get_template( 'example.php'); ?>
            <?php endwhile; ?>                                        
    
    <?php else : ?>
            <?php jigoshop_get_template( 'product_taxonomy.php' ); ?>
    <?php endif; ?>
    

    But nothing changed. Maybe it’s because in your plugin I need use another function ‘query_posts’. Where I did a mistake?

    • This reply was modified 1 year, 6 months ago by  TeslAndroid.
    • This reply was modified 1 year, 6 months ago by  TeslAndroid.
    Plugin Author Jigoshop Support – Marcin

    (@azrielnefezen)

    <?php if ( have_posts() ) : ?>                               
            <?php /* The loop */ ?>
    <?php global $wp_query;?>
            <?php if ($wp_query->query_vars['product_cat'] == 'category_slug') 
                      while ( have_posts() ) : the_post(); ?>
                    <?php jigoshop_get_template( 'example.php'); ?>
            <?php endwhile; ?>  
    
    // the rest unchanged       

    Something like this 🙂

    Didn’t help 🙁
    Nothing was changed. I tried to edit every file taxonomy-product_cat.php that I have, but nothing… I tried even to delete all files “taxonomy-product_cat.php” to see what will happen with single pages of items, but nothing happened too.

    I’m sure that I pointed out the right category slug and right template name..
    Maybe I should change single-product.php?

    if category is 18… then include file “example.php”
    else: echo summary info

    There is my point (see the img):
    page layout
    Items from 1 category should contain a static content from example.php file after thumbnail info. I tried to include this file with functions.php (I wrote a shortcode for doing this) but I had a problem: a content appeared after thumbnail (as I needed) but BEFORE product-summary info (I need to show this after summary. Although, I need to show the first div from static div inline with a div from product summary info… and there is a problem.. I tried to reach it through CSS, but couldn’t).

    I can insert this content with wp-admin (into each item info when I’m in Edit Product Mode), but I want to optimize with 1 static file. If I would like to change there some information, I would need only change 1 file, not all items at all… and without side plugins. I hope, you understand my problem.

    Plugin Author Jigoshop Support – Marcin

    (@azrielnefezen)

    Contact me at support@jigoshop.com, I’ll see what I can do.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Custom template of single products for specific category’ is closed to new replies.