[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

woocommerce template files issue

Posted on 2015-01-10
3
Medium Priority
?
335 Views
Last Modified: 2015-01-12
hey, i am working with woocommerce for the first time. i want to change the html of the shop page.
so i understand that there are two ways of doing it:
1 - in my theme folder create the structure of the woocommerce template folder and change whatever file i want.
2 - using filter hooks.

i fail miserably with both approaches.
i copy the archive-product.php template file, so i can do add and change some html but the loop itself is not there, and i cannot understand where is that html in order to change it. this is the code there:

			<?php
				/**
				 * woocommerce_before_shop_loop hook
				 *
				 * @hooked woocommerce_result_count - 20
				 * @hooked woocommerce_catalog_ordering - 30
				 */
				do_action( 'woocommerce_before_shop_loop' );
			?>

			<?php woocommerce_product_loop_start(); ?>

				<?php woocommerce_product_subcategories(); ?>

				<?php while ( have_posts() ) : the_post(); ?>

					<?php wc_get_template_part( 'content', 'product' ); ?>

				<?php endwhile; // end of the loop. ?>

			<?php woocommerce_product_loop_end(); ?>

			<?php
				/**
				 * woocommerce_after_shop_loop hook
				 *
				 * @hooked woocommerce_pagination - 10
				 */
				do_action( 'woocommerce_after_shop_loop' );
			?>

Open in new window


i do not want to wrap it with my html, but to change the content of the loop html !!! where can i find it?

and how can you do it via the filter hook?

i have looked at their documentation, and it is not really orgenized or explained good, at least af far as i could see.

best regards
0
Comment
Question by:derrida
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
eemit earned 2000 total points
ID: 40543562
The template for displaying product content within loops is:
\woocommerce\templates\content-product.

Override this template by copying it to yourtheme/woocommerce/content-product.php

What do you want to change?
0
 
LVL 1

Author Comment

by:derrida
ID: 40543781
thanks. it is.
you get the template by combining those: <?php wc_get_template_part( 'content', 'product' ); ?>?

i want to change the html of it.

and how can you do if with filter?

and still there is a problem there.
<?php do_action( 'woocommerce_before_shop_loop_item_title' ); ?>
this poduces the img tag of the product, and i need to change some classes, and remove the width and hight attributes. i want to bootstrap it.
where is the html of it? or with filter?
0
 
LVL 15

Expert Comment

by:eemit
ID: 40544911
You should check Dashboard/WooCommerce/Settings/Products/Product Image Sizes.
In "Catalog Images" you can set width and hight.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I want to start by talking about the use of plug-ins for WordPress. I started a web-site for a company I was working for a few years ago; I had extremely basic knowledge of HTML. I am a Graphic Designer by trade so I invited the opportunity as a cha…
While Plesk offers many potential benefits to website administrators, including compatibility with Windows Server and other leading technologies, the company has also been working to differentiate it from other control panels for content management…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Suggested Courses
Course of the Month17 days, 17 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question