Tagged: 

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1403032

    Hi Mike,
    in reference to ticket Change Shop
    I open this ticket again, hope you can reply.

    How to get, instead of:
    Autore: Raimondo Maria Pavarin
    this:
    di Raimondo Maria Pavarin
    Instead of “Autore: ” > “di ”

    Instead of
    https://img.savvyify.com/image/UaX1
    it should become
    https://img.savvyify.com/image/UoEN

    #1403237

    Hey Oriano,
    Thanks for the screenshots, the attribute Autore is set in your WooCommerce ▸ Attributes please see this post
    Enfold_Support_354.jpeg
    *Note that the screenshot says Author but this is where you added Autore on your site.
    so you need to change this to your new text di

    Best regards,
    Mike

    #1403263

    Hi Mike,

    the problem is that the term “Autore” should remain in the Product Attribute, while under the title, where, thanks to your code the attribute appears, the term “Autore” should be replaced with the word “di“, see image .
    I tried to use the “after” css, but failed :(

    Best regards
    Oriano

    #1403265

    Hi,
    Try changing the di in the function that gets the label

    add_action( 'woocommerce_single_product_summary', 'product_attribute_dimensions', 25 );
    function product_attribute_dimensions(){
        global $product;
    
        $taxonomies = array('pa_authors');
        foreach($taxonomies as $taxonomy){
            $value = $product->get_attribute( $taxonomy );
            if ( $value ) {
                $label = get_taxonomy( $taxonomy )->labels->singular_name;
        
                echo '<p>' di ': ' . $value . '</p>';
            }
        }
    }

    Enfold_Support_793.jpeg

    Best regards,
    Mike

    #1403266

    Hi Mike,

    > Try changing the di in the function that gets the label
    I have try, and I get the following error:
    Parse error: syntax error, unexpected ‘di’ (T_STRING), expecting ‘;’ or ‘,’ in /Volumes/T7/sitimamp/clueb/wp-content/themes/enfold-child/functions.php on line 103

    and on line 103, I have this:
    echo '<p>' di ': ' . $value . '</p>';

    Best regards
    Oriano

    #1403273

    Hi,
    Try this instead:
    echo '<p> di : ' . $value . '</p>';

    Best regards,
    Mike

    #1403275

    Hi Mike
    i tried with:
    > echo ‘<p> di : ‘ . $value . ‘</p>’;
    and it doesn’t change anything, and I don’t even get error :(

    Best regards
    Oriano

    #1403281

    Hi,
    Please include an admin login in the Private Content area so we can examine.

    Best regards,
    Mike

    #1403297

    Hi Mike,
    sorry, but I am on local MAMP :(

    If you think it’s useful, I can prepare tomorrow an online clone of the production site.

    Oriano

    #1403298

    Hi Mike,
    I’m preparing an installation copy of the site in production. It will be ready tomorrow.
    As soon as I’m ready, I’ll write the admin login in the Private Content area.

    Best regards
    Oriano

    #1403299

    Hi,
    It’s been a while since I helped you create this, so I tried to recreate this on my test site and found that changing the label in the function to di like this works correctly: echo '<p> di : ' . $value . '</p>';
    Enfold_Support_807.jpeg
    But after re-reading the original support thread after this solution was created you asked for the author’s name to be also linked.
    So I believe you are not using this function and you are using the script instead.
    In this case please add this script to your child theme functions.php:

    function custom_replace_autore_script() { ?>
      <script>
    window.addEventListener('DOMContentLoaded', function() {
    (function($){
    $('.pa-autore .autore-label').contents().filter(function() {
      return this.nodeType == 3
    }).each(function(){
      this.textContent = this.textContent.replace('Autore','di');
    });
    })(jQuery);
    });
    </script>
      <?php
    }
    add_action('wp_footer', 'custom_replace_autore_script');

    the expected results:
    Enfold_Support_811.jpeg

    Best regards,
    Mike

    #1403317

    Yes, yes, yes, Mike.

    Thank you very much. I do not know how to thank you 👏👏
    And I am also a little ashamed for having bored you with this problem on Sunday.

    Best regards,
    Oriano

    #1403319

    Hi,
    Glad we were able to help adjust this for you, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Change Shop #2’ is closed to new replies.