Tagged: woocommerce
-
AuthorPosts
-
March 30, 2023 at 6:12 pm #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/UoENApril 1, 2023 at 7:42 pm #1403237Hey Oriano,
Thanks for the screenshots, the attribute Autore is set in your WooCommerce ▸ Attributes please see this post
*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 diBest regards,
MikeApril 2, 2023 at 10:39 am #1403263Hi 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
OrianoApril 2, 2023 at 11:44 am #1403265Hi,
Try changing the di in the function that gets the labeladd_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>'; } } }
Best regards,
MikeApril 2, 2023 at 12:07 pm #1403266Hi 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 103and on line 103, I have this:
echo '<p>' di ': ' . $value . '</p>';
Best regards
OrianoApril 2, 2023 at 12:54 pm #1403273April 2, 2023 at 1:14 pm #1403275Hi Mike
i tried with:
> echo ‘<p> di : ‘ . $value . ‘</p>’;
and it doesn’t change anything, and I don’t even get error :(Best regards
OrianoApril 2, 2023 at 2:08 pm #1403281Hi,
Please include an admin login in the Private Content area so we can examine.Best regards,
MikeApril 2, 2023 at 4:46 pm #1403297Hi 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
April 2, 2023 at 5:07 pm #1403298Hi 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
OrianoApril 2, 2023 at 5:47 pm #1403299Hi,
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>';
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');
Best regards,
MikeApril 2, 2023 at 7:12 pm #1403317Yes, 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,
OrianoApril 2, 2023 at 7:23 pm #1403319Hi,
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 -
AuthorPosts
- The topic ‘Change Shop #2’ is closed to new replies.