Home › Forums › WoodMart support forum › Compare Product in Woodmart
Compare Product in Woodmart
- This topic has 24 replies, 2 voices, and was last updated 4 years, 10 months ago by Aizaz Imtiaz Awan.
-
AuthorPosts
-
January 3, 2020 at 6:38 am #166038
lnseldevParticipantWe have developed a Woocommerce website by using a purchased Woodmart theme. The owner of the website wants to compare the specification in the compare page, but as per your current module you have implemented the functionality using attribute fields but as per requirement by the client, she wanted to add her addition information in the custom fields which implemented by using an additional plugin of Woocommerce custom tabs & customize it but when we place the customize compare.php in the child Woodmart theme, it doesn’t work. Please help how we can place the customized file in the child theme that can work flawlessly in the child theme.
January 3, 2020 at 10:38 am #166086
Aizaz Imtiaz AwanKeymasterHello,
First of all thanks for choosing our Theme, we are glad to be you in WoodMart WordPress family
:-)
.As you want to extend the functionality of compare product function, by adding more custom fields using WooCommerce custom tabs & customize plugin. You need to contact plugin author for this purpose, or use some other plugin.
Because you’re asking for additional functionality, it requires customization and this is beyond our limitations and support policy and if your file works just fine in the parent theme then try to make the same directory structure in the child theme and then replace that customized file in the same folder.
OR
You can simply add more attributes for products and then add those attributes in comparison table, from theme settings >> Shop >> Compare >> Select fields for compare table option.
Screenshot for clarification: https://jmp.sh/mKtkHiy
Best Regards.
January 3, 2020 at 11:09 am #166088
lnseldevParticipantThanks for sharing your concern regarding the issue which we raised. As you mentioned to maintain the directory structure the same as in the child theme. We have already done that to make it work independently. But it’s your theme that doesn’t support the functionality just all other theme does.
So that’s why we are raising this concern with you. As per your suggestion regarding creating attributes, it doesn’t meet our client’s requirement to meet her workflow. So we need to do the customization using custom fields.
It works fine on the parent theme but by maintaining the same directory path it doesn’t work on the child theme. It certainly has a problem with your theme Please suggest.
January 3, 2020 at 11:40 am #166092
Aizaz Imtiaz AwanKeymasterMost Welcome,
Our theme fully supports the customization of child theme, But the directory structure must be the same, as parent and customization must be in an appropriate manner. Because if there is some errors in code or the logic is not correct then it’s not our theme fault.
In your case, you said that your customization works in the parent theme but not in the child theme right?
There might be other additional code which you had added in your child theme which might conflict with the code of compare functionality. So you need to make sure one thing that the other customization which you had in child theme did not conflicts the functionality of compare code.
Best Regards.
January 6, 2020 at 10:57 am #166480
lnseldevParticipantHi,
As you said that the Woodmart theme fully supports the customization of the child theme we have done the customization on compare.php file parent directory path wp-content/themes/woodmart/inc/integrations/woocommerce/modules.
We have placed the customize compare.php on the child directory path wp-content/themes/woodmart-child/inc/integrations/woocommerce/modules. Where we faced the issue that on the parent theme it works, but it doesn’t work on the child theme.
You said there is an error on the code, please do clarify if code works on the parent theme the same will not work on the child, it doesn’t sound logical as you have said. Please suggest. Please check the attached screenshot, a particular section where we have modified.
Thanks
Attachments:
You must be logged in to view attached files.January 6, 2020 at 1:08 pm #166511
Aizaz Imtiaz AwanKeymasterHello,
Yes, if the code works in the parent theme then it have to work in the child theme too.
I did not say that your custom code contains error, I just describe that there is a possibility that this code might conflicts with your other custom code you have in your child theme which you may added to achieve something else.
You added “SPECIFICATION” field in compare page with your custom code right? Kindly share the login credentials so I can check and help you out.
Best Regards.
January 7, 2020 at 4:48 am #166620
lnseldevParticipantHello Aizaz,
We are sharing the wp credentials of the website please have a look into it. We don’t have any other customization on here as we want to add a custom field as our client wants a custom field in a compare section for her products to compare her product specification.
Please see Private Content for Login details:
Thanks & Regards
January 7, 2020 at 8:24 am #166650
Aizaz Imtiaz AwanKeymasterHello,
You are using an old version of theme and outdated theme plugins, kindly update the theme as well as plugins.
Also when I test your site compare page with child theme and parent theme, it looks perfectly fine. “SPECIFICATION” which is your custom field displaying just fine in both child and parent theme. It’s seems just a cache issue. Kindly clear your site and browser cache.
Video for clarification: https://jmp.sh/ln4CFqh
Best Regards.
January 7, 2020 at 9:04 am #166656
lnseldevParticipantHello Aizaz,
As per your suggestion regarding the theme & plugins update, just to inform you that as per the website it required the WordPress & woo-commerce plugin update. Are you telling by updating the WP & woo-commerce plugin it will be sorted out?
In the video, you wanted to say to add the description as the attribute which I’ve earlier mentioned you that will not feasible as per our client concern. So we’re used the woo-commerce custom tabs to overcome the limitation of the compare section.
You’ve mentioned updating the theme but we didn’t see any notification of theme update in the dashboard.
Are you able to assure if the WP & associated plugins updated then the customization will work fine on the child, We don’t think so because if there is any kind of issue is there then it doesn’t work on the parent theme.
Best Regards
Attachments:
You must be logged in to view attached files.January 7, 2020 at 10:56 am #166682
Aizaz Imtiaz AwanKeymasterHello,
You are using 4.0.4 version currently, while the current update of theme is 4.3. I suggest you to update the theme and required plugins so you can able to use the latest features added in update of theme and it is not about the fixing of your issue.
About your issue, I shared a video in which first I activate the child theme and check your compare page and it shown the “Specification” field and then I activate your parent theme and check the compare page it also display the specification field.
As the specification field in one of your custom field right. So your problem is resolved because you describe that your custom field shown in parent theme but not in child. But at my end your custom fields inside compare page also shown with child theme you can clearly see in the video clip which I have shared before.
If you want anything else then also share the screenshot or mini video clip of your issue.
Best Regards.
January 7, 2020 at 1:24 pm #166719
lnseldevParticipantHi Aizaz,
We have updated the theme & associated plugins still we faced the same concern for which we are asking for. Now the theme is updated to 4.3.0. as per your suggestion & while doing this we have observed that we need to do the theme update manually whereas in other themes we WP admin get theme update notification on the dashboard.
As we provided credentials to you we have observed that you changed the theme from child theme to the parent theme.
Meanwhile, while update the theme an email has been shoot to the client However updating the theme didn’t resolve the issue.
Howdy!
Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.
In this case, WordPress caught an error with your theme, Woodmart.
First, visit your website (https://demo.eldereaseindia.com/) and check for any visible issues. Next, visit the page where the error was caught (https://demo.eldereaseindia.com/wp-admin/admin-ajax.php) and check for any visible issues.
Please contact your host for assistance with investigating this issue further.
If your site appears broken and you can’t access your dashboard normally, WordPress now has a special “recovery mode”. This lets you safely login to your dashboard and investigate further.
To keep your site safe, this link will expire in 1 day. Don’t worry about that, though: a new link will be emailed to you if the error occurs again after it expires.
Error Details
=============
An error of type E_ERROR was caused in line 1438 of the file /home1/t0z7s0k8/demo.eldereaseindia.com/wp-content/themes/woodmart/inc/admin/settings/shop.php. Error message: Call to undefined function woodmart_compare_available_fields()Please suggest.
Attachments:
You must be logged in to view attached files.January 7, 2020 at 2:43 pm #166753
Aizaz Imtiaz AwanKeymasterHello,
Yes, I switched to parent theme in your site for testing purposes on your request for checking the issue with child theme. I did not touch anything else.
I have visited your site now and it looks just normal, so nothing to worry about it.
As you said theme update notification not shown in your dashboard. Normally our theme also display the update notifications as like other themes. But these notifications can be hide with custom code in funtions.php file. So you need to make sure that you did not hide or disable the notifications from somewhere.
You can check the below articles for this purpose:
https://thomas.vanhoutte.be/miniblog/wordpress-hide-update/
https://www.redbridgenet.com/disable-individual-theme-update-notification-wordpress/
https://www.wpbeginner.com/wp-tutorials/how-to-disable-automatic-updates-in-wordpress/About your compare custom fields issue. I already explained to you many times that your issue is already resolved and custom fields for compare page also shown in our child theme.
Just clear the site and browser cache and then check the theme settings if it display the current version of theme or not.
Best Regards.
January 8, 2020 at 4:57 am #166834
lnseldevParticipantHi Aizaz,
I want to clear the information that you’ve shared with us
1. We have cleared the browser & server cache many times to see the changes.
2. We didn’t code anything in the functions.php to disable the theme update.
3. As per your instruction, we have update the theme to 4.3 as you shared with us, that doesn’t help us, but it also generated an error in which clients get notified about it.We do minimal customization to overcome the limitation of the theme & for the Woodmart theme we are facing this concern which we didn’t face on other themes. Our client is getting annoyed now regarding the one which we are communicating to get it sorted but somehow it doesn’t work.
We agreed that you are helping us many times & also give suggestions we’re also doing the same many times to get this issue sorted but it doesn’t help us to get the issue sorted.
It’s now extremely urgent for us as this is being going quite a few days now with no proper resolution, We know you’ve played around with the theme but still not resolved – I request to escalate this concern to any senior developer of your team, hope this gets this sorted ASAP today.
This site is plan to go-live by tomorrow, I hope you understand the urgency & deal it accordingly.
Best Regards
January 8, 2020 at 7:56 am #166862
Aizaz Imtiaz AwanKeymasterHello,
As currently you are using the latest version of theme so now your theme update notification can be tested when we release the next update. If it does not display the update notification after releasing our updated version then let us know we will check and help you out accordingly. Also you have to notice that the default WordPress theme shows the update notification or not? Because it is some thing which also related to your default WordPress functionality.
Screenshot for clarification: https://jmp.sh/ubNvXjv
Your actual issue was compare page custom fields not working in the child theme right? And I already described to you that I it was just a cache issue, I have test your theme with child and parent version and it works.
If you want to fix something else, then describe your issue with some screenshots so we will help you out accordingly.
Best Regards.
January 8, 2020 at 12:02 pm #166893
lnseldevParticipantHello,
PFA Video.
Do you think you can resolve this HUGE issue in your next update?
We can then start the Go Live of this website with this in the Parent Theme only as of now (as a temporary solution & not the NEST PRACTICE at all) until your next update to resolve this issue.https://drive.google.com/file/d/1LyuyvQhvCE11layBR1JKPpDbIGNXBdnA/view
Please confirm.
Best Regards
January 8, 2020 at 1:30 pm #166918
Aizaz Imtiaz AwanKeymasterHello,
I have seen your video attachment. Sorry for misunderstanding. As I don’t have your ftp details and when I test from your admin dashboard compare custom fields works. So i thought that you have added that file in child theme and it still working while its not because it was included in parent theme that’s why it works.
Could you please take a backup of your site and share your admin login details so I can check and help you out accordingly and let you know if it’s our theme issue or not. Your prior login details no working any more.
Best Regards.
January 10, 2020 at 5:32 am #167226
lnseldevParticipantHello,
We have taken the back-up of our website & share the credentials below. We are bound to postpone the Go-live until the compare issue gets sorted. Please look into the compare section part & sorted it out. Please let us know if need any help from our end.
demo.eldereaseindia.com/wp-admin/
username : eldereaseindia
password : S55Ao(mGGRTnRYHtVfBest Regards
January 10, 2020 at 7:41 am #167238
Aizaz Imtiaz AwanKeymasterHello,
For testing purposes I rename your compare.php file to compareCustomized.php file inside woodmart\inc\integrations\woocommerce\modules and now it shown the error could you please rename it back as “compare.php” so it get fixed and then I upload the standard compare.php and use your customized compare.php in child theme to check the results.
Also share the Cpnel or ftp details so I can upload the file.
Best Regards.
January 10, 2020 at 9:28 am #167257
lnseldevParticipantHi,
Please find the FTP credentials below
host : eldereaseindia.com
username : [email protected]
password : 8u[%fPAeO+;KBest Regards
January 10, 2020 at 10:13 am #167263
lnseldevParticipantHi,
We observed that the site is not opening as our client is aware of it, We understand you’re working on it; please make this a high priority & fix it ASAP.
Best Regards
January 10, 2020 at 12:36 pm #167282
Aizaz Imtiaz AwanKeymasterHello,
I have test the compare.php file in your child theme and it does not work. Then I used your code in function.php file and it still not working.
Could you please confirm that, the below code is your custom code which you added in compare.php for custom fields or not:
<div class="woodmart-compare-row compare-<?php echo esc_attr( $field_id ); ?>"> <?php foreach ( $products as $product_id => $product ) : ?> <?php if ( ! empty( $product ) ) : ?> <div class="woodmart-compare-col compare-value" data-title="<?php echo esc_attr( $field ); ?>"> <?php woodmart_compare_display_field( $field_id, $product ); ?> </div> <?php else: ?> <div class="woodmart-compare-col compare-field"> <?php echo esc_html( $field ); ?> </div> <?php endif; ?> <?php endforeach ?> </div>
If this is not the right part of code then share the actual code which you have added by your customization so I can check that one in funtion.php once. Or you can try it on your own by declaring that specific function inside funtion.php.
For now I revert all my changes and your website is working as before. Also I suggest you to copy the whole folder of modules from parent and paste it to child theme and then replace the compare.php file with the one which you customized. Because currently you have just compare.php file in the modules folder and not the other files that might be the reason of this issue.
Best Regards.
January 11, 2020 at 4:31 am #167403
lnseldevParticipantHello,
I have earlier share you the snippet screenshot of the code in which we have modified the section to add the custom field. I am now sharing where we have modified in compare.php we have tried to do this in functions.php which doesn’t work as well.
Here is the code.
<div class=”woodmart-compare-table”>
<?php
//echo ‘'; print_r($products); echo '
‘;
if ( ! empty( $products ) ) {
array_unshift( $products, array() );
foreach ( $fields as $field_id => $field ) {
if ( ! woodmart_is_products_have_field( $field_id, $products ) ) {
continue;
}
?>
<div class=”woodmart-compare-row compare-<?php echo esc_attr( $field_id ); ?>”>
<?php foreach ( $products as $product_id => $product ) : ?>
<?php if ( ! empty( $product ) ) : ?>
<div class=”woodmart-compare-col compare-value” data-title=”<?php echo esc_attr( $field ); ?>”>
<?php woodmart_compare_display_field( $field_id, $product ); ?>
</div>
<?php else: ?>
<div class=”woodmart-compare-col compare-field”>
<?php echo esc_html( $field ); ?>
</div>
<?php endif; ?><?php endforeach ?>
</div>
<?php
}
?>
<div class=”woodmart-compare-row compare-specification”>
<div class=”woodmart-compare-col compare-field”>
<?php echo ‘Specification’; ?>
</div>
<?php foreach ( $products as $product_id => $product ) : ?>
<?php if ( ! empty( $product ) ) : ?>
<div class=”woodmart-compare-col compare-value” data-title=”Specification”>
<?php //echo $product[‘id’];//woodmart_compare_display_field( $field_id, $product );
$product_tabs = maybe_unserialize( get_post_meta( $product[‘id’], ‘yikes_woo_products_tabs’ , true ) );
//echo ‘'; print_r($product_tabs); echo '
‘;
echo $product_tabs[0][‘content’];
?></div>
<?php endif; ?>
<?php endforeach ?></div>
<?php
} else {
?>
<p class=”woodmart-empty-compare”>
<?php esc_html_e(‘Compare list is empty.’, ‘woodmart’); ?>
</p>
<?php if ( $empty_compare_text ) : ?>
<div class=”woodmart-empty-page-text”><?php echo wp_kses( $empty_compare_text, array(‘p’ => array(), ‘h1’ => array(), ‘h2’ => array(), ‘h3’ => array(), ‘strong’ => array(), ’em’ => array(), ‘span’ => array(), ‘div’ => array() , ‘br’ => array()) ); ?></div>
<?php endif; ?>
<p class=”return-to-shop”>
“>
<?php esc_html_e( ‘Return to shop’, ‘woodmart’ ); ?>
</p>
<?php
}?>
<div class=”compare-loader”></div>
</div>Please fix this concern ASAP as the site will be Go-live by Monday.
Best Regards
January 11, 2020 at 11:47 am #167462
Aizaz Imtiaz AwanKeymasterHello,
During testing I notice that with active child theme when I rename the compare.php file then it picks the child compare.php file but “woodmart_compare_available_fields()” function called somewhere inside the /home1/t0z7s0k8/demo.eldereaseindia.com/wp-content/themes/woodmart/inc/admin/settings/shop.php on line 1396
So I also paste that directory in the child theme. But it still does not work. Then I test your compare.php file in my test site parent theme version and it does not work. It seems that the function which you created in custom.php called on different other files and your child theme don’t have all of those files, in result the specification field not shown. We are not able to detect where you called that function in other files. I mean we did not know how that custom fields fetched from the single product page. That’s why it is out of our scope and it’s not a theme issue. You might forget to move some other files to child theme which also contains code for custom fields and without those files the compare will not able to work.
This file can’t be overridden from the child theme.
Best Regards.
January 11, 2020 at 12:46 pm #167469
lnseldevParticipantHello,
We are ensuring you that we have not modified anywhere in the file shop.php as you are mentioning.
We have mentioned the number of times that we modified the code only in compare.php nowhere in the other file. We are following the standard customization that we worked on the child theme so it will not be affected by the core functionality of the parent theme.
What you are informing us is not actually relevant to us regarding the concern we have raised to you. It seems that you are just going round & round without concrete resolution of the issue that we are talking about.
What you have mentioned in the above communication thread, we have attached a screenshot which we believe you can understand clearly what you’re saying.
Please resolved this concern by today as our go-live is re-scheduled on 13th January 2020 & we can not afford postponed it further. Hope you understand the seriousness of the issue & major flaw of your theme, you have working on these six man-days this is the high time to get it resolved by TODAY.
Best Regards
Attachments:
You must be logged in to view attached files.January 11, 2020 at 2:47 pm #167482
Aizaz Imtiaz AwanKeymasterHello,
Yes, I can understand and I also get your point what you want and I test almost each and every thing related to this issue in your site. And I upload the shop.php inside your child theme not inside your parent theme. That’s why the filezilla’s screenshot did not display the date as you pointing to the parent theme whereas I override that file inside child version.
I contact to our theme developer and he confirmed that the compare.php can’t be overridden from the child theme.
Because some files linked with some other functions and requires other files functions to run, that is the reason it simply not overridden and for override those files you have to override all the other functions in other files which that specific functions or file linked.Best Regards.
-
AuthorPosts
Tagged: compare
- You must be logged in to create new topics. Login / Register