Woocommerce - change html of products in a category

product html looks like this:

<li class="post-13 product type-product status-publish has-post-thumbnail first taxable shipping-taxable purchasable product-type-simple product-cat-printer instock">
    <a href="http://xxx">
        <img width="150" height="150" src="http://xx" class="attachment-shop_catalog wp-post-image" alt="" />
        <h3>abc</h3>
        <span class="price"><span class="amount">15.86&nbsp;&euro;</span></span>
    </a>
    <div class="gridlist-buttonwrap">
        <a href="xx?add-to-cart=13" rel="nofollow" data-product_id="13" data-product_sku="" class="button add_to_cart_button product_type_simple">Buy</a>
    </div>
    <hr />          
</li>

      

Can I move the price next to the button?

<li class="post-13 product type-product status-publish has-post-thumbnail first taxable shipping-taxable purchasable product-type-simple product-cat-printer instock">
    <a href="http://xxx">
        <img width="150" height="150" src="http://xx" class="attachment-shop_catalog wp-post-image" alt="" />
        <h3>abc</h3>
    </a>
    <div class="abc">
        <a href="xx?add-to-cart=13" rel="nofollow" data-product_id="13" data-product_sku="" class="button add_to_cart_button product_type_simple">Buy</a>
        <span class="price"><span class="amount">15.86&nbsp;&euro;</span></span>
    </div>          
 </li>

      

The only way to know is that I have to edit the core of the plugin, which is useless because after the updates I will lose all changes.

Edit: for example this topic , they have the following structure:

<li>
    <a href="http://demo2.woothemes.com/sliding/shop/yellow-necklace/" style="width: 192px; height: 295px;">
        <img width="192" height="295" src="http://demo2.woothemes.com/sliding/files/2011/11/yellow-necklace-192x295.jpg" class="attachment-woo_sliding_slider wp-post-image" alt="yellow-necklace" />
        <div class="meta">
            <h3>Yellow Necklace</h3>
            <span class="slider-price"><span class="amount">&pound;19.00</span></span>
        </div>

    </a>

</li>

      

+3


source to share


1 answer


You can override the template file that won't update when woocommerce is updated.

From the WooCommerce docs



Alternatively, you can edit these files in a safe way by updating the override. Just copy it to a directory in your theme called / woocommerce, keeping the same file structure.

Example. To override admin notice, copy: woocommerce / templates / emails / admin-new-order.php for yourtheme / WooCommerce / email / admins-new order.php

+1


source







All Articles