G
G
gogadesign2020-07-01 14:55:01
WooCommerce
gogadesign, 2020-07-01 14:55:01

How to remove unnecessary html tags in woocommerce?

Hello!

I'm trying to stretch my layout on woocommerce. There was such difficulty:

1. Fine imposition of an output of cards of the goods has a trace. view.

5efc77fa76f8f056868581.png

Displays 4 cards via divs

2. Woocommerce wraps product cards in lists + extra div

5efc7888e8a59825341071.png

Question: How do I remove ul, li tags and remap div class="woocommerce columns-4 "to Thanks in advance! <div class="card">

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Litvinenko, 2020-07-01
@gogadesign

It is not necessary to change tags, let it be a list, it does not affect anything.
To add your class to the wrapper, you can use a similar hook:

// Добавить класс к обертке с товарами
add_filter('woocommerce_product_loop_start', 'mytheme_product_loop_start');
function mytheme_product_loop_start() {
  ?>
  <ul class="card-group products columns-<?php echo esc_attr( wc_get_loop_prop( 'columns' ) ); ?>">
  <?php
}

And the easiest way to add a class to a product is to add content-product.php in the template, which you previously copied to your theme in the woocommerce folder. Like on a picture
5efcbe459b020776214239.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question