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

feat(compat): share goal progress across multiple forms using WPML #2883

Closed
vukvukovich opened this issue Mar 8, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@vukvukovich
Copy link
Contributor

commented Mar 8, 2018

Issue Overview

Common donation goal for multiple languages.

Expected Behavior

Option that enables common goal for multiple languages. So that it sums donations across languages.

Current Behavior

Currently we can make separate goals for each language with same donation goal amount.
But every donation is calculated separately.

For example:
If you donate 10$ in English, english goal will be for that donation closer, not Spanish and vice versa.

Possible Solution

I've debugged a bit and it would be great if there was an option that updates _give_form_sales and _give_form_earnings in your custom tables.

For WPML you can use this hook to get translated form ID: https://wpml.org/wpml-hook/wpml_object_id/

@kevinwhoffman kevinwhoffman changed the title Multilingual donation goal - WPML compatibility feat(compat): share goal progress across multiple forms using WPML Mar 11, 2018

@kevinwhoffman

This comment has been minimized.

Copy link
Member

commented Mar 11, 2018

Hi @vukvukovich thanks for the issue. If I understand correctly you have a separate form for each language but want to display progress towards a common goal.

We have an open issue for a [give_totals] shortcode that allows you to display goal progress from multiple forms. Does that sound like what you're looking for?

@vukvukovich

This comment has been minimized.

Copy link
Contributor Author

commented Mar 16, 2018

Thanks @kevinwhoffman, that looks like it should do the job. Will it support multiple [give_totals]? For example: 4 forms in general, but 2 common goals?

@kevinwhoffman

This comment has been minimized.

Copy link
Member

commented Mar 23, 2018

@vukvukovich Our current implementation has been merged into the Give 2.1.0 release. Here's how it works. You define your overall goal in the shortcode and the forms that you want to include in the calculation. The shortcode will add the totals of the forms you've defined and output the total goal progress.

Example: [give_totals total_goal="5000" ids="1,2,3"]
If each of those forms has raised $1,000 then the shortcode will display $3,000 of the $5,000 with the message you define and an optional progress bar.

You can also pass in categories or tags if you want it to be a bit more dynamic. We're documenting the shortcode now, but you can see the available attributes here: https://github.com/WordImpress/Give/blob/issue/2943/includes/shortcodes.php#L548-L692

This will be available when 2.1.0 releases in the near future. I'm going to close this out in the meantime. Cheers.

@vukvukovich

This comment has been minimized.

Copy link
Contributor Author

commented Mar 26, 2018

@kevinwhoffman Great, thanks. 😄 Exactly what was needed. Keep up the good work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.