Home › Forums › WoodMart support forum › Issues with Custom Attribute Styling after the upgrades
Issues with Custom Attribute Styling after the upgrades
- This topic has 35 replies, 3 voices, and was last updated 5 months, 4 weeks ago by Bogdan Donovan.
-
AuthorPosts
-
April 27, 2024 at 11:30 pm #561367
HasMkoParticipantHi, 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 upApril 30, 2024 at 2:13 pm #562036
Hung PhamKeymasterHi 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,
April 30, 2024 at 2:59 pm #562068
HasMkoParticipantPLEASE, 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.May 1, 2024 at 11:35 am #562351
Hung PhamKeymasterHi 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,
May 3, 2024 at 7:07 pm #563119
HasMkoParticipantProvided privately below:
May 5, 2024 at 6:38 am #563289
Hung PhamKeymasterHi 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,
May 5, 2024 at 8:49 pm #563350
HasMkoParticipantHi, 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
May 6, 2024 at 5:35 am #563375
Hung PhamKeymasterHi 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,
May 6, 2024 at 7:05 pm #563658
HasMkoParticipantI 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
May 7, 2024 at 7:38 am #563712
Hung PhamKeymasterHi 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,
May 7, 2024 at 1:00 pm #563803
HasMkoParticipantThe 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
May 8, 2024 at 8:05 am #563974
Hung PhamKeymasterHi 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,
May 8, 2024 at 11:02 am #564031
HasMkoParticipantThank 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>May 8, 2024 at 11:14 am #564042
HasMkoParticipantAnd 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
May 8, 2024 at 6:42 pm #564212
Hung PhamKeymasterHi wysongibsonltd,
You don’t need to add HTML tags, you can enter new line to make it looks more clearly.
Regards,
May 8, 2024 at 6:45 pm #564213
HasMkoParticipantPlease respond to the message before that
May 9, 2024 at 10:34 am #564324
Hung PhamKeymasterHi 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,
May 11, 2024 at 3:59 pm #564893
HasMkoParticipantAccess 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
May 12, 2024 at 2:32 pm #564987
Hung PhamKeymasterHi 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,
May 12, 2024 at 6:20 pm #565021
HasMkoParticipantNot 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?
May 12, 2024 at 8:19 pm #565035
Hung PhamKeymasterHi wysongibsonltd,
Glad to hear your issue has been resolved.
I’ve passed this topic to one of our developers for more details.
Regards,
May 24, 2024 at 2:55 am #567895
HasMkoParticipantAny updates? The attributes are a lot better now but still displaying enevenly. Please see the link provided in Extra information. Woud really appreciate it if this issue could get resolved.
Attachments:
You must be logged in to view attached files.May 24, 2024 at 9:49 am #567934
Hung PhamKeymasterHi wysongibsonltd,
Please add the following Custom CSS code to Theme Settings > Custom CSS > Global Custom CSS:
table.shop_attributes :is(.wd-attr-name,.wd-attr-term) { display: block; }
Regards,
May 24, 2024 at 2:12 pm #568010
HasMkoParticipantWill try that. What have you done on my staging site? None of the attributes are showing on the product pages
May 24, 2024 at 2:23 pm #568012
HasMkoParticipantOK the changes you sugested doesnt seem to be fixing the issue. I provided staging access and a product page link. Can you show me where on my staging site your code can be seen to fix the issue?
May 25, 2024 at 9:22 am #568117
Hung PhamKeymasterHi wysongibsonltd,
Please copy
product-attributes.php
file content in the staging site and paste into live site.Please add the following Custom CSS code to Theme Settings > Custom CSS > Global Custom CSS:
table.shop_attributes :is(.wd-attr-name,.wd-attr-term) { display: block; }
Regards,
May 25, 2024 at 7:48 pm #568198
HasMkoParticipantOnce again can you please show me a page on the staging site where this fix is working. The attributes at the top are in line now but the Requirements text is STILL mixed up and not as entered in the admin area, i.e NOT correctly formatted. Please see the attachement. THere is no point copying changes to Live site while the issue is STILL not fixed.
Attachments:
You must be logged in to view attached files.May 27, 2024 at 11:39 am #568370
Bogdan DonovanKeymasterHi,
We checked your product page and found that the lack of line breaks is caused by our theme. Please try installing patch 568367. If the problem persists, let us know.
Kind Regards
May 29, 2024 at 2:57 am #568884
HasMkoParticipantThank you, it took almost 30 messages back and forth but we finally got there in the end
May 29, 2024 at 4:38 pm #569087
Bogdan DonovanKeymasterYou are welcome!
-
AuthorPosts
Tagged: custom-attributes
- You must be logged in to create new topics. Login / Register