Okay
  Public Ticket #3592937
Child Theme
Closed

Comments

  • furtivo started the conversation

    Hi there,

    we modified the file aurum/inc/laborator_woocommerce.php. 
    I tried to copy this file in my child themes folder (i.e. aurum-child/inc/) to prevent it from beeing overwritten - but it doesn't seem to work.

    What I'm doing wrong?

    Thank you - Martin T.

  • [deleted] replied

    Hi Martin,

    Except from template files, the core Aurum files are not loaded from child themes even if they exist in the same path. Since the functionality laborator_{name}.php files tend to change over the updates. 

    It is best for you to compare these two files (using GIT) and apply your own changes on the new one. You can also hard replace the file but I am afriad that it may break some of the functionality.

    Also, if there is a possibility to not override the file you may use WordPress Hooks but I am not sure what exactly you have changed in there. 

    Can you tell me what did you changed in the laborator_woocommerce.php so I can suggest you where to apply those changes and be safe from future updates.

  • furtivo replied

    Hey Arlind,

    thank you! That's what I thought... But now I know to handle it.

    I think it's not possible to use WP hooks, but I would be delighted if you could take a look at the screenshot.

    Any Idea?

    Thank you very much!

    Attached files:  laborator_woocommerce-php.jpg

  • [deleted] replied

    Hi Martin,

    Lucky for you, the changes you have made can be added via hooks, as you can see the original code includes these hooks:

    medium
    (view large image)

    So for the first part of code (before title) you can achieve with this:

    add_action( 'aurum_before_shop_loop_item_title', function() {
        // Put the first part of code here
    } );

    And the same for after title:

    add_action( 'woocommerce_after_shop_loop_item', function() {
        // Put the second part of code here
    } );

    This should work for you.