Lucas Haas
Lucas Haas

Reputation: 341

Woocommerce single.php simplified

Is there a way to simplify the single.php without using all the woocommerce template part files?

I wanted to create a very simple loop for the products and apply them exactly to the layout I created. But with all the loop parts from Woocommerce, makes this task a bit difficult.

What I want is something that respects the following structure:

<div A> 
[product images code]
</div>

<div B>
[product short description + buy button]
</div>

<div C>
[full description of the product]
</div>

<div D>
[related products]
</div>

Is that impossible? Does anyone knows a way to do something like this?

thanks!

Upvotes: 0

Views: 521

Answers (1)

shramee
shramee

Reputation: 5099

Yeah, it is possible ;)

There are number of ways to do this... You can try like this...

<div A> 
<?php woocommerce_show_product_images() ?>
</div>

<div B>
<?php woocommerce_template_single_excerpt() ?>
<?php woocommerce_template_single_add_to_cart() ?>
</div>

<div C>
<?php woocommerce_product_description_tab() ?>
</div>

<div D>
<?php woocommerce_output_related_products() ?>
</div>

This approach uses WooCommerce functions as much as possible so as to avoid writing any extra code 😉

Be sure to add your own css styles and make it pretty 🙂

Upvotes: 2

Related Questions