Hey :),
that’s great news! I’ll be looking forward to it. If you don’t mind, I would share the temporary workaround to multiple basic payments I made since I needed a solution right away. It can come in handy for someone.
**PLEASE KEEP IN MIND THAT THIS IS A WORKAROUND NOT a permanent solution and don’t forget to delete it and update to the latest version when ready**
I decided to use a custom taxonomy, since the payment categories are usually not the same as the post categories and it could be a headache if you would need to add for example three new categories (pay1, pay2, pay3) which would then be visible to the readers on the frontend.
SOLUTION(dont forget to change the taxonomy ‘type’ and the terms ‘pay1’, ‘pay2’, ‘no_pay’ and keep in mind that these are the “slugs” not the “names” of the terms):
I adjust the basic payment(for correct display in stats), but also the total payment. The different basic payments are calculated based on the one set in the options. So that in my example my basic payment is 4 in the options, but I want 6 for the ‘pay1’ posts so I increase the basic payment by +2. Change this amount as you please.
The ‘no_pay’ posts are posts, which I don’t want to pay for – so I set the amount to 0.
The ‘default’ is for posts for which I want to pay the basic payment set in the plugin options.
1. set a default basic payment in the plugin options
2. (FTP)Go to the plugin directory > post-pay-counter > classes
3. Open the file “ppc_html_functions_class.php” in a text editor
4. Look for the function “data2cash” and go to the line with “$single->ppc_count = $post_countings;”
5. Between this line and the line “$single->ppc_payment = $post_payment[‘ppc_payment’];” add the folowing code:
/* Adjust basic payment based on custom taxonomy "type" */
$post_terms = get_the_terms( $single->ID , 'type' );
if ( $post_terms && ! is_wp_error( $post_terms ) ) {
foreach($post_terms as $term) {
switch ($term->slug) {
case 'pay1':
$post_payment['ppc_payment']['normal_payment']['basic'] = $post_payment['ppc_payment']['normal_payment']['basic'] + 2;
$post_payment['ppc_payment']['normal_payment']['total'] = $post_payment['ppc_payment']['normal_payment']['total'] + 2;
break;
case 'pay2':
$post_payment['ppc_payment']['normal_payment']['basic'] = $post_payment['ppc_payment']['normal_payment']['basic'] + 4;
$post_payment['ppc_payment']['normal_payment']['total'] = $post_payment['ppc_payment']['normal_payment']['total'] + 4;
break;
case 'no_pay':
$post_payment['ppc_payment']['normal_payment']['basic'] = 0;
$post_payment['ppc_payment']['normal_payment']['total'] = 0;
default:
break;
}
}
}
Hope this helps someone. Enjoy.