Important:
This support area is for Kalium 3 users only.
Support for Kalium 4 has moved to our new platform at support.laborator.co.
If you’re using Kalium 4, please create a new account there using your email and license key. A password will be sent to you automatically.
I recently purchased the Aurum theme to build an online library.
I love the theme but I need an “author” value attached to the product. I need to be able to put it in Woo Commerce attributes see ACF, but is there a few things planned to make it appear in the product page?
Best regard
Hi Remy,
To add an author attribute for products you can use WooCommerce Product Attributes here:
(view large image)
So after you create and assign authors I can give you the code snippet to place the author where you want, simply tell me the placement.
Hello Arlind
Thanks for the solution
I need the author's name in these 3 locations (certainly in the invoice descriptions unfortunately, I'm moving too slowly to say where exactly, (this is my first WP work)).
Thank a lot!
Hi Remy,
I have added this code snippet in functions.php of the theme (child theme):
// titre_serie add_action( 'aurum_before_shop_loop_item_title', function() { global $product; $atts = $product->get_attributes(); $titre_serie = array_key_exists( 'pa_titre_serie', $atts ) ? $atts['pa_titre_serie'] : null; if ( $titre_serie ) { $terms = []; foreach ( $titre_serie->get_terms() as $term ) { $terms[] = $term->name; } echo sprintf( '<div class="pa-titre-serie">%1$s</div>', implode( ', ', $terms ) ); } } ); // auteur add_action( 'woocommerce_after_shop_loop_item', function() { global $product; $atts = $product->get_attributes(); $auteur = array_key_exists( 'pa_auteur', $atts ) ? $atts['pa_auteur'] : null; if ( $auteur ) { $terms = []; foreach ( $auteur->get_terms() as $term ) { $terms[] = sprintf( '<a href="%2$s">%1$s</a>', $term->name, get_term_link( $term ) ); } echo sprintf( '<div class="pa-auteur">%1$s</div>', implode( ', ', $terms ) ); } } );So it adds the the attributes below the product as you mentioned:(view large image)
They are wrapped in DIV container with their respective class names and you can style them with CSS:
(view large image)
The "titre" and "author" comes out only if it exists. Since you havent added "titre" attribute to any of the product I added it for example to "Harry Potter et l’ordre du phénix" product.
So as you can see if appears only if its assigned.
I hope you like it.
I like your magic !
Thank a lot.
R.
Hi Remy,
Happy to hear that my solution worked
Have a nice day!
P.S: If you like the theme, it would help us a lot if you could give us a five-star rating on Themeforest from your Downloads tab.
A huge thank you from me and Laborator in advance.
Some news.
My exam is passed, with a mention on the quality of the chosen theme (Aurum).
Good job!
Best regard.