Okay
  Public Ticket #2382085
display dimensions
Closed

Comments

  • lecantin started the conversation

    Please help me with this.

    I want to display the woocommerce product dimensions in the store page in the meta. Please see the screenshot to have an idea of what I need to do. Title and price are fine. But between them I want the dimensions.

    Thanks

  •  675
    Neuron replied

    Hi Lecantin,

    If you check the Arteon folder, every layout is separated well in the templates. 

    https://prnt.sc/s8rh2k

    So, if you want to override the meta outside of the shop and add there a meta tag, please grab the file at arteon > templates > shop > type > meta-outside.php

    Place that file into your child theme, so in case of any update you won't lose a thing.

    Go to the corresponding line and add the following php. https://prnt.sc/s8rive

    <?php 
        global $product;
        if ( $product--->has_dimensions() ) {
            echo '<table class="shop_attributes"><tbody><tr>
                <th>' . __( 'Dimensions', 'woocommerce' ) . '</th>
                <td class="product_dimensions">' . esc_html( wc_format_dimensions( $product->get_dimensions( false ) ) ) . '</td>
            </tr></tbody></table>';
        }
    ?>
    

    - https://stackoverflow.com/questions/55108223/display-product-dimension-in-woocommerce-product-summary

    Kind Regards


    Subscribe to our newsletter to get the latest updates about NeuronThemes and join our community Facebook Group.

  • lecantin replied

    Hi,

    Thanks for your time, but the code don't work.

    Here's my "meta outside" template lines where you want me to put the code. Without your code. It broke my site when I put the code after the last <?php endif; ?>.

    <div class="o-neuron-hover__body">

            <div class="o-neuron-hover__body-meta">
                
                <?php if ($neuron_posts_meta_title == 'yes') : ?>
                    <h5 class="o-neuron-hover__body-meta__title"><a href="<?php the_permalink() ?>">
                        <?php echo esc_attr($product->get_title()); ?></a></h5>
                <?php endif; ?>
                <?php if ($neuron_posts_meta_price == 'yes') : ?>
                    <h6 class="o-neuron-hover__body-meta__price"><?php wc_get_template_part('woocommerce/loop/price') ?></h6>
                    <?php
                if (!$product->is_in_stock()) {
                    echo '<div class="a-woo-badge a-woo-badge--red-color">' . esc_html__('Out of Stock', 'arteon') . '</div>';
                } elseif ($product->is_on_sale()) {
                    echo '<div class="a-woo-badge a-woo-badge--theme-color">' . esc_html__('Sale!', 'arteon') . '</div>';
                }
                ?>
                <?php endif; ?>
            </div>
        </div>



  •  675
    Neuron replied

    Hi Lecantin,

    If you could provide me with your wp-admin or FTP access, it would be easier for me. Since, I could implement and see what was not working.

    Kind Regards


    Subscribe to our newsletter to get the latest updates about NeuronThemes and join our community Facebook Group.

  • lecantin replied

    Sure,


    Here's your admin login info:

    User: NeuronSupport

    Pass: XAh%dd6pcfK2KsS%


    Please be patient, the site is slow when you're logged in because of woocommerce.


    thanks


  •  675
    Neuron replied

    Hi Lecantin,

    I have added your code via the child theme, please check it again.

    Kind Regards


    Subscribe to our newsletter to get the latest updates about NeuronThemes and join our community Facebook Group.

  • lecantin replied

    Please revert the changes... ther'es something that have changed in my headers...REVERT.


    send my the files instead... 


    thanks


  • lecantin replied

    There's a shit load of changes that you made... REVERT!


  •  675
    Neuron replied

    Hi Lecantin,

    Those are the options in the customizer that are changed, please go to the Appearance > Themes and switch to Arteon instead of Arteon Child.

    Kind Regards


    Subscribe to our newsletter to get the latest updates about NeuronThemes and join our community Facebook Group.