krishnathapa
Forum Replies Created
-
Hi Vivek,
Not sure if this helps. I was trying on the staging site. I could only test with the failed payment.
Here are screen records.
https://www.awesomescreenshot.com/video/51734017?key=0a821695f8c6a42434ad507adff0a16b
https://www.awesomescreenshot.com/video/51734618?key=a4dbbbf5742a76a9e14caac7dc99f0ce
In the second video, I am showing the order details preview with the failed payment, which is not displaying custom options. I also showed you another order that shows the custom options in the order preview.
If you see edit order details, then you will see the custom option details.https://www.awesomescreenshot.com/image/59952136?key=e768e609978c7425582b91601c01c9f6
Just for example, I am showing order preview, not emails, because we get the same results in both.- This reply was modified 1 month, 2 weeks ago by krishnathapa.
Thanks,
Can we use javaScript and update the value for the paypal payment when we update the first two custom input field?<label for="custom" class="wppaypal_buynow_custom_amount_label">Invoice number or reference:</label>
<input class="wppaypal_buynow_custom_amount_input" type="text" name="custom" id="customInvoice" value="" required=""/>
<br />
<label for="amount" class="wppaypal_buynow_custom_amount_label">Enter the amount (GBP):</label> <input class="wppaypal_buynow_custom_amount_input" type="text" name="amount" id="customAmount" value="" required=""/>
[wp_paypal_checkout button="buynow" description="test checkout product" amount="3.99"]@recetteitalienne – Okay. It seems I can’t help more unless I check your website. So I would suggest to go through support.
@recetteitalienne – In which PHP file you added?
@recetteitalienne – That’s where second code comes in. I gave you the code that get $average_rating from this plugin which you can use on your template schema code.
@recetteitalienne – First code goes into the functions.php which will completely disable the schema created by the plugin.
Second – I just gave you an idea of how you get aggregating. So, it is up to your code how you create your custom schema.@recetteitalienne – It won’t. It will remove all the schema created by the plugin. You might need to do that manually on your existing code. You can try this code.
$postId = get_the_ID(); $ratings = YasrDatabaseRatings::getVisitorVotes($postId); $sum_votes = $ratings['sum_votes']; $no_votes = $ratings['number_of_votes']; if ($sum_votes > 0) { $average_rating = round($sum_votes / $no_votes, 0); }@recetteitalienne – Yes, I managed to fix this using this code.
function remove_yasr_schema_from_footer() { global $yasr_additional_rich_fields; if ($yasr_additional_rich_fields instanceof YasrRichSnippets) { remove_action('wp_footer', array($yasr_additional_rich_fields, 'addSchema')); } } add_action('init', 'remove_yasr_schema_from_footer');That makes sense.
But it was a client request. I will tell exactly what you said to the client and see how it goes.Thank you for your help @carazo. I will see what I can do from here.
Okay. Is there any chance to handle such big data when you update to the async process?
Thank you!
It seems like it will be complex and risky. One more question, What will happen if server terminates the deletion process in between?
Can you suggest any other way to achieve this?
Best
KrishnaThank you for your quick response. Could you please provide a bit more insight on this?
1. How long it might take for an AWS server?
2. What changes do I need to made in our server?
3. I can try in batches as well. Any idea, how much it will be better to do in one batch?Hi,
I found the solution. Here is the final code which fix this issue.if (is_admin() && !current_user_can('administrator') && !(defined('DOING_AJAX') && DOING_AJAX)) { global $current_user; wp_get_current_user(); $user_info = get_userdata($current_user->ID); if ($user_info->wp_user_level == 0) { wp_redirect(home_url()); exit; } }Thank you so much for your help!
Thank you. I think I am very close to solution now.
I found the code in the functions.php which is causing issue.if (is_user_logged_in() && is_admin() && !current_user_can('administrator')) { global $current_user; wp_get_current_user(); $user_info = get_userdata($current_user->ID); if ($user_info->wp_user_level == 0) { wp_redirect(home_url()); exit; } }I need to redirect subscriber to the homepage when they try to access /wp-admin. When we use this code it is causes with the rating. Could you please suggest how can I redirect without conflicting with the plugin?