Home › Forums › Basel support forum › Add size info to shop product archive page
Add size info to shop product archive page
- This topic has 11 replies, 2 voices, and was last updated 7 years, 3 months ago by
Artem Temos.
-
AuthorPosts
-
November 9, 2017 at 9:38 am #23618
DivitesParticipantHi,
I would like to display the size of the product below the product title on the shop archive page. Now it only displays the name of the product. I have filled the size field of the product.
How to achieve this?
Thx for your prompt reply.
Best regards,
Johan
November 9, 2017 at 1:45 pm #23629
Artem TemosKeymasterHello,
There is no such option in our theme to display the size attribute on the shop page. It may require additional customization of the theme template files to achieve this.
Regards
November 9, 2017 at 2:06 pm #23637
DivitesParticipantHi,
Thx for your prompt reply.
Could you please help me with the additional customization.Best regards,
Johan
November 9, 2017 at 2:42 pm #23641
Artem TemosKeymasterWe are sorry, but additional customization of theme files are out of scope of theme support service according to Envato Support Policy https://themeforest.net/page/item_support_policy
Regards
November 9, 2017 at 3:23 pm #23644
DivitesParticipantHi,
Thx again. That sounds a bit strange as other themes do support this. Please see: https://kriesi.at/support/topic/woocommerce-adding-attribute-to-shop-page-results/
Besides that I see a lot of custom code in support threads.
Please help. I would really appreciate it.
Regards,
Johan
November 9, 2017 at 3:25 pm #23645
Artem TemosKeymasterHi,
OK, if you want, we can provide you with a code snippet that shows this information so you just put it in the appropriate file.
Regards
November 9, 2017 at 3:27 pm #23648
DivitesParticipantHi,
Thx! I really appreciate it. I want the size attribute between the title and the button.
I will then put in the appropriate file myself.Best regards,
Johan
November 9, 2017 at 3:31 pm #23649
Artem TemosKeymasterHi,
Add this code snippet to the
functions.php
file in the child theme firstfunction basel_show_dimensions() { global $product; $dimensions = wc_format_dimensions($product->get_dimensions(false)); if ( $product->has_dimensions() ) { echo '<div class="product-meta-size">' . $dimensions . '</div>'; } }
Then, put this code to the file
basel-child/woocommerce/content-product-link.php
. You just need to copy the file from the parent theme and then modify it.<?php basel_show_dimensions(); ?>
Regards
November 9, 2017 at 3:42 pm #23650
DivitesParticipantHi,
thx for your prompt solutions.
I have added the code, but it displays above the product image. please see: http://designbadkamers.divi-test.nl/product-categorie/baden/I placed the code here on the 9th line:
<?php
global $product, $woocommerce_loop;$timer = basel_get_opt( ‘shop_countdown’ );
// Sale countdown
if ( ! empty( $woocommerce_loop[‘timer’] ) )
$timer = true;
?>
<?php basel_show_dimensions() ?><?php do_action( ‘woocommerce_before_shop_loop_item’ ); ?>
<div class=”product-element-top”>
“>
<?php
/**
* woocommerce_before_shop_loop_item_title hook
*
* @hooked woocommerce_show_product_loop_sale_flash – 10
* @hooked basel_template_loop_product_thumbnail – 10
*/
do_action( ‘woocommerce_before_shop_loop_item_title’ );
?>
<?php basel_hover_image(); ?>
<div class=”basel-buttons”>
<?php if( class_exists(‘YITH_WCWL_Shortcode’)) basel_wishlist_btn(); ?>
<?php basel_compare_btn(); ?>
<?php basel_quick_view_btn( get_the_ID(), $woocommerce_loop[‘quick_view_loop’] – 1, ‘main-loop’ ); ?>
</div>
</div>
<?php
basel_swatches_list();
?>
<?php
/**
* woocommerce_shop_loop_item_title hook
*
* @hooked woocommerce_template_loop_product_title – 10
*/
do_action( ‘woocommerce_shop_loop_item_title’ );
?>
<div class=”wrapp-swap”>
<div class=”swap-elements”>
<?php
/**
* woocommerce_after_shop_loop_item_title hook
*
* @hooked woocommerce_template_loop_rating – 5
* @hooked woocommerce_template_loop_price – 10
*/
do_action( ‘woocommerce_after_shop_loop_item_title’ );
?>
<div class=”btn-add”>
<?php do_action( ‘woocommerce_after_shop_loop_item’ ); ?>
</div>
</div>
</div>
<?php if ( $timer ): ?>
<?php basel_product_sale_countdown(); ?><?php endif ?>
Should I place it somewhere else?
Thx!
November 9, 2017 at 3:54 pm #23652
Artem TemosKeymasterPlace it after this code
do_action( ‘woocommerce_after_shop_loop_item_title’ ); ?>
November 9, 2017 at 6:15 pm #23662
DivitesParticipantThx so much. I really appreciate it.
Best regards,
Johan
November 9, 2017 at 7:04 pm #23665
Artem TemosKeymasterYou are welcome!
-
AuthorPosts
The topic ‘Add size info to shop product archive page’ is closed to new replies.
- You must be logged in to create new topics. Login / Register