Updating woocommerce, custom template not working?

Hi there,

It’s a bit difficult to explain, but here it goes. I had a e-commerce website made with PRO outputting categories on top of the shop page, like so:

https://www.dropbox.com/s/3czn0jwkx2hx8qm/Screenshot%202021-08-09%20at%2011.51.57.png?dl=0

Anyhow, I needed to update the site, and unfortunately, this custom modification disappeared.

https://birdie-elektromosauto.hu/modellek/

The code I used was in:

/wp-content/themes/pro-child/framework/views/integrity/woocommerce.php

And the code itself was:

<?php // ============================================================================= // VIEWS/INTEGRITY/WOOCOMMERCE.PHP // ----------------------------------------------------------------------------- // WooCommerce page output for Integrity. // ============================================================================= get_header(); ?>
    <?php
$taxonomyName = "product_cat";
//This gets top layer terms only.  This is done by setting parent to 0.  
   $parent_terms = get_terms($taxonomyName, array('parent' => 0, 'orderby' => 'slug', 'order' => 'asc',  'hide_empty' => false));

   echo '<ul class="category">';
   foreach ($parent_terms as $pterm) {
       //show parent categories
       $thumbnail_id = get_term_meta($pterm->term_id, 'thumbnail_id', true);
       // get the image URL for parent category
       $image = wp_get_attachment_url($thumbnail_id);
       // print the IMG HTML for parent category
       echo '<li class="categoryli">' . '<a href="' . get_term_link($pterm, $taxonomyName) .  '">' . "<img src='{$image}' class='catcoverimg alt='' />" . '<br>'  . $pterm->name . '</a></li>';
   }
   echo '</ul>';
      ?>

Can you tell me why this overwrite stopped working and maybe how I could fix it?

I think I managed to fix it by updating the woocommerce template to the latest one and inserting the new code there.

If the woocommerce template gets outdated, wordpress automatically uses the latest one from the plugins folder?

Hey @Pbalazs89,

I’m sorry but we can’t detail what went wrong as custom development is beyond the scope of our theme support.

The one that will always be used is the custom template and it’s possible that some code in there no longer works with the latest WooCommerce template. It would be the website owner’s responsibility to fix the customized template.

Thank you for understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.