Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the description to be filtered by themes or plugins #1761

Open
smarx80 opened this issue Feb 3, 2021 · 7 comments
Open

Allow the description to be filtered by themes or plugins #1761

smarx80 opened this issue Feb 3, 2021 · 7 comments
Labels
feature: product sync Relating to syncing product data to Facebook. priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: bug The issue is a confirmed bug.

Comments

@smarx80
Copy link

smarx80 commented Feb 3, 2021

Hi,
using the plugin I noticed a problem in sending title, content and excerpt of products to Facebook.
In the file include/fbproduct.php it seems that are used directly $post->content , $post->title etc… which is almost fine, but it doesn’t apply all the filters that are needed and that are set by theme and plugins.
In a context where plugins like wpglobus are used for translations, incorrect data are sent, (will be sent also all amount of its placeholders for example, obviously).
I have therefore corrected it using the corresponding functions (get_the_title, get_the_excerpt) and applied the corresponding content filter, removing the wptexturize to avoid problems of incorrect rendering of some characters that are not then reconverted on Facebook.
Here the diff so you can push in next release if you want.
Thanks,
Simone.

patch.txt

@jconroy
Copy link
Member

jconroy commented Feb 17, 2021

Hi @smarx80

Thanks for the issue - seems sensible - we'll need to investigate / double-check. At face value there might be some historic reasons this might not be happening if it is the case.

@haszari haszari added type: bug The issue is a confirmed bug. and removed bug labels Mar 22, 2021
@haszari haszari added the feature: product sync Relating to syncing product data to Facebook. label Apr 16, 2021
@smarx80
Copy link
Author

smarx80 commented Jul 29, 2021

Hi,
have you made any progress internally? Is there anything I can do to help you in your decision to merge the patch?
Thanks,
Simone.

@smarx80
Copy link
Author

smarx80 commented Sep 22, 2021

@haszari @jconroy can you give me feedback on this issue? At least to know if there is anything I can do, if there are any doubts, and in case there are no obstacles when you plan to publish the changes. Thank you. Simone.

@smarx80
Copy link
Author

smarx80 commented Nov 29, 2021

Hello @haszari @jconroy, is there anyone on this topic?? Give me a feedback on this issue please. Now ~ 10 month have passed, without any progress, it seems to be quite long time to have an answer. An answer to decide if apply or not apply my patch, or another one that you want. Please answer. Thank you, Simone.

@mikkamp
Copy link
Collaborator

mikkamp commented Feb 9, 2022

Thanks for the patch @smarx80 and sorry for the delayed response.

We have discussed the suggested solution and we prefer to handle this slightly differently.

First of all we'd like to make use of the WC_Product::get_description function (like is done for the variable products). Instead of applying the filter the_content, we would prefer to process the description and prepare it for the feed as needed. This would allow us to apply some specific rules required for the descriptions (like no HTML, maximum length, etc.).

The final description can then be passed through a filter so any plugins/themes can hook into this filter if the content needs to be changed. You can see a similar example of how this is done for one of our other extensions here.

We don't have this solution ready, but we'll leave this issue open so it can be prioritized and a PR can be created.

@mikkamp mikkamp changed the title remove wptexturize from content Feb 9, 2022
@mikkamp
Copy link
Collaborator

mikkamp commented Feb 9, 2022

Until this has been resolved a temporary workaround is to use the facebook_for_woocommerce_integration_prepare_product filter to modify the description. Which will still allow you to call the appropriate filters for wpglobus to populate the correct content.

@jconroy jconroy added the priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. label Feb 14, 2022
@jconroy
Copy link
Member

jconroy commented Feb 14, 2022

Marking as low for now as there is a workaround available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: product sync Relating to syncing product data to Facebook. priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: bug The issue is a confirmed bug.
4 participants