A way to add XSTORE theme files to CHILD?

This topic has 2 replies, 1 voice, and was last updated 7 months, 2 weeks ago ago by IP

  • Avatar: Lovelyfashioncompany
    IP
    Participant
    September 19, 2023 at 21:40

    Hello

    My website has slightly messed up when I updated the Parent theme.

    This is because I had made changes to the XSTORE parent theme folder- i am aware XSTORE and WordPress doesn’t recommend this and xstore says to modify the CHILD instead.

    The file I have modified is in the PARENT theme folder (WP-Content > Theme > XSTORE > WooCommerce > Loop)

    Is there a way to add this file to the CHILD folder? So next time I update the parent Theme there wouldn’t be this issue? The code for this file is below

    Thanks

    The code for the file i created in WP-Content > Themes > XSTORE > WooCommerce > Loop:

    <?php
    
    if ( ! defined( 'ABSPATH' ) ) {
        exit;
    }
    
    global $product;
    
    if ( get_option( 'woocommerce_enable_review_rating' ) === 'no' ) {
        return;
    }
    
    $rating_count = $product->get_rating_count();
    $review_count = $product->get_review_count();
    $average      = $product->get_average_rating();
    
    if ( $rating_count > 0 ) : ?>
    
    	        <?php echo wc_get_rating_html($average, $rating_count); ?>
    		<?php if ( comments_open() ): ?><a href="<?php echo get_permalink() ?>#reviews" class="woocommerce-review-link" rel="nofollow">(<?php printf( _n( '%s',$review_count,'woocommerce' ), '<span class="count">' . esc_html( $review_count ) . '</span>' ); ?>)</a><?php endif ?>
    	
    
    <?php endif; ?>
    Please, contact administrator
    for this information.
    1 Answer
    Avatar: Lovelyfashioncompany
    IP
    Participant
    September 19, 2023 at 22:21

    Hello, I have figured out what to do, thanks.

    For anyone else wanting to achieve the same, simply copy the folder to XSTORE Child folder and change values in XSTORE Child

    Example – I copied LOOP folder (from WP-Content > Theme > XSTORE > WooCommerce > Loop) and put it in XSTORE Child, then added the file with the code above and it works

    I also updated the theme after doing this and can confirm it still works

    Thanks

  • Viewing 2 results - 1 through 2 (of 2 total)

The issue related to '‘A way to add XSTORE theme files to CHILD?’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.