Home Forums WoodMart support forum Issues with Custom Attribute Styling after the upgrades

Issues with Custom Attribute Styling after the upgrades

Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #561367

    wysongibsonltd
    Participant

    Hi, I use a custom attribute to add product requirement info for each product. This was displaying perfectly well as you’ll see in the staging side using a previous version of your theme: vs how the requirrements attribute is now displayed after the recent theme updates.
    The backend looks the same for both, just the front end messed up

    #562036

    Hung Pham
    Keymaster

    Hi wysongibsonltd,

    Thanks for reaching to us.

    First of all, take my apologies for the delay in answering.

    I cannot see custom attributes in Staging site and these are looked good in main site https://prnt.sc/oW5uRYlDQGJ5, please let me know if you resolved it.

    Regards,

    #562068

    wysongibsonltd
    Participant

    PLEASE, its taking ages to get a response in return so please at least bother to read the messages carefully. I said the custom Attributes are being used for REQUIREMENTS, the screenshot you sent me and most likely what you are looking for on the pages I sent you is NOT requirements. Please see attached for where to see the custom attributes being used for REQUIREMENTS and where it appears on the page

    Attachments:
    You must be logged in to view attached files.
    #562351

    Hung Pham
    Keymaster

    Hi wysongibsonltd,

    To assist you in the best possible manner, I kindly ask that you please provide me temporary wp-admin info (wp-admin URL, username, password) to the Private Content area, this will allow me to thoroughly investigate and address your concerns more efficiently.

    Regards,

    #563119

    wysongibsonltd
    Participant

    Provided privately below:

    #563289

    Hung Pham
    Keymaster

    Hi wysongibsonltd,

    Thanks for sharing details.

    First of all, I’m really sorry have taken long time to reply you due to the weekend.

    – Open product-attributes.php file (woocommerce/single-product/product-attributes.php)

    – Replace

    $exploded_terms = explode( ',', wp_strip_all_tags( $product_attribute['value'] ) );

    with

    $exploded_terms = explode( ',', html_entity_decode( $product_attribute['value'], ENT_COMPAT | ENT_HTML5 ));

    Now, you can use HTML tags for attribute values.

    You can create a ticket here: https://woodmart.canny.io/feature-requests so our developers will consider such a feature.

    Regards,

    #563350

    wysongibsonltd
    Participant

    Hi, in theme file editor: “Woodmart: product-attributes.php (woocommerce/single-product/product-attributes.php)” I cannot find the line of code tha you need me to change

    #563375

    Hung Pham
    Keymaster

    Hi wysongibsonltd,

    I see you modified code as I guided. Can you please edit attribute’s value with HTML tags to make it look better?

    Regards,

    #563658

    wysongibsonltd
    Participant

    I have NOT made any changes, if you read my message yu’ll note that I couldnt even find the code you are talking about. Please keep in mind this was never an issue as you’ll see in the staging site I already provided which runs an older version of your theme where everything appears perfectly fine.

    Im not sure if Im talking to one person or many but its already been ages just trying to solve this simple thing, please read the whole thread properly so we can save ourselves from wasting even more time. Issue still not solved

    #563712

    Hung Pham
    Keymaster

    Hi wysongibsonltd,

    I checked the staging site and the issue still persists as well. I fixed with provided code and it worked well.

    To assist you in the best possible manner, I kindly ask that you please provide me temporary wp-admin info (wp-admin URL, username, password) and FTP account of live site to the Private Content area, I will help you to fix it.

    Regards,

    #563803

    wysongibsonltd
    Participant

    The issue is only on the staging site now because I pulled changes from the live site andso all updates to theme are now applied on the staging site too. The issue did not exist when the them was the older verion.

    I am more than happy to apply the changes you suggested to the live site but for the 3rd time, I cannot see where that code is on the file you are pointing out. PLease find yet again my previous message:

    Hi, in theme file editor: “Woodmart: product-attributes.php (woocommerce/single-product/product-attributes.php)” I cannot find the line of code tha you need me to change

    For many security, customer privacy and legal reasons I cannot provide access to the live site but I am perfectly capable of applying the change myself. Can you see if your fix works on the staging site now that it is using the latestest up to date theme and then provide a FULL PATH to the file that needs to be changed and on what line.

    Thanks

    #563974

    Hung Pham
    Keymaster

    Hi wysongibsonltd,

    It’s strange, I applied the fixes on staging site and it worked perfectly.

    Please see recorded video for better understanding https://go.screenpal.com/watch/cZhjhhVM8CL

    Regards,

    #564031

    wysongibsonltd
    Participant

    Thank you very much for the video. So from what I can see the issue and reason I cannot find the code you are talking about is that it does not exist on the live site. That file in the live site is exactly as follows and does not contain any of the rest of the code vsible in your video towards the end:

    <?php
    /**
    * Product attributes
    *
    * Used by list_attributes() in the products class.
    *
    * This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-attributes.php.
    *
    * HOWEVER, on occasion WooCommerce will need to update template files and you
    * (the theme developer) will need to copy the new files to your theme to
    * maintain compatibility. We try to do this as little as possible, but it does
    * happen. When this occurs the version of the template file will be bumped and
    * the readme will list any important changes.
    *
    * @var array $product_attributes List of product attributes.
    * @see https://docs.woocommerce.com/document/template-structure/
    * @package WooCommerce\Templates
    * @version 3.6.0
    */

    use XTS\Modules\Layouts\Global_Data as Builder_Data;

    defined( ‘ABSPATH’ ) || exit;

    if ( ! $product_attributes ) {
    return;
    }
    ?>
    <table class=”woocommerce-product-attributes shop_attributes”>
    <?php foreach ( $product_attributes as $product_attribute_key => $product_attribute ) : ?>
    <?php
    $attribute_name = str_replace( ‘attribute_pa_’, ”, $product_attribute_key );
    $thumb_id = get_option( ‘woodmart_pa_’ . $attribute_name . ‘_thumbnail’ );
    $image_size = apply_filters( ‘woodmart_product_attributes_table_image_size’, ‘thumbnail’ );
    $attribute_hint = get_option( ‘woodmart_pa_’ . $attribute_name . ‘_hint’ );

    if ( ! empty( Builder_Data::get_instance()->get_data( ‘wd_product_attributes_include’ ) ) || ! empty( Builder_Data::get_instance()->get_data( ‘wd_product_attributes_exclude’ ) ) ) {
    $attributes_include = Builder_Data::get_instance()->get_data( ‘wd_product_attributes_include’ );
    $attributes_exclude = Builder_Data::get_instance()->get_data( ‘wd_product_attributes_exclude’ );
    $current_attribute_name = str_replace( ‘attribute_pa_’, ‘pa_’, $product_attribute_key );

    if ( $attributes_include && ! in_array( $current_attribute_name, $attributes_include, true ) ) {
    continue;
    }
    if ( $attributes_exclude && in_array( $current_attribute_name, $attributes_exclude, true ) ) {
    continue;
    }
    }
    ?>

    <tr class=”woocommerce-product-attributes-item woocommerce-product-attributes-item–<?php echo esc_attr( $product_attribute_key ); ?>”>
    <th class=”woocommerce-product-attributes-item__label”>
    <span class=”wd-attr-name”>
    <?php if ( ! empty( $thumb_id ) ) : ?>
    <?php if ( woodmart_is_svg( wp_get_attachment_image_url( $thumb_id ) ) ) : ?>
    <?php echo woodmart_get_svg_html( $thumb_id, $image_size, array( ‘class’ => ‘wd-attr-name-img’ ) ); //phpcs:ignore. ?>
    <?php else : ?>
    <?php echo wp_get_attachment_image( $thumb_id, $image_size, false, array( ‘class’ => ‘wd-attr-name-img’ ) ); ?>
    <?php endif; ?>
    <?php endif; ?>
    <span class=”wd-attr-name-label”>
    <?php echo wp_kses_post( $product_attribute[‘label’] ); ?>
    </span>
    <?php if ( $attribute_hint ) : ?>
    <?php woodmart_enqueue_js_library( ‘tooltips’ ); ?>
    <?php woodmart_enqueue_js_script( ‘btns-tooltips’ ); ?>
    <span class=”wd-hint wd-tooltip”>
    <?php echo wp_kses_post( $attribute_hint ); ?>
    </span>
    <?php endif; ?>
    </span>
    </th>
    <td class=”woocommerce-product-attributes-item__value”>
    <?php echo wp_kses_post( $product_attribute[‘value’] ); ?>
    </td>
    </tr>
    <?php endforeach; ?>
    </table>

    #564042

    wysongibsonltd
    Participant

    And once again, all this was working perfectly fine before recent updates. Will I now have to go through the requirements attribute for ALL my products and add html tags? This was all displaying perfectly and formating itself correctly before

    #564212

    Hung Pham
    Keymaster

    Hi wysongibsonltd,

    You don’t need to add HTML tags, you can enter new line to make it looks more clearly.

    Regards,

    #564213

    wysongibsonltd
    Participant

    Please respond to the message before that

    #564324

    Hung Pham
    Keymaster

    Hi wysongibsonltd,

    Can you please rollback to the version that worked properly before?

    I checked and your live site is now using 7.5.1 version, which same as version on my end so it should be the same.

    To assist you in the best possible manner, I kindly ask that you provide me temporary wp-admin info (wp-admin URL, username, password) to Private Content area, this will allow me to thoroughly investigate and address your concerns in a more efficient and I can give you more better assist.

    Regards,

    #564893

    wysongibsonltd
    Participant

    Access link provided privately below, I really hope we can finally resolve this as it really does not look good on the front end to the customers

    #564987

    Hung Pham
    Keymaster

    Hi wysongibsonltd,

    First of all, I’m really sorry have taken long time to reply you due to the weekend.

    May I know how did you update theme to the latest version? I tested WoodMart latest version and it looked same as what I showed you before.

    You can re-download theme from ThemeForest to see if it the file looks like how I showed to you.

    Thanks for your patience.

    Regards,

    #565021

    wysongibsonltd
    Participant

    Not sure why that file was different, I was upgrading via the usual wordpress updates. Anyway replacing the files with the ones downloading from theme forest and changing that line of code as advised now fixes everything. Will I have to repeat this fix every single time the them is updated?

    #565035

    Hung Pham
    Keymaster

    Hi wysongibsonltd,

    Glad to hear your issue has been resolved.

    I’ve passed this topic to one of our developers for more details.

    Regards,

Viewing 21 posts - 1 through 21 (of 21 total)