pbosakov
Forum Replies Created
-
Forum: Plugins
In reply to: [PVB Contact Form 7 Calculator Add-on] two digits after kommaDear Manu,
You can try adding this post-processing Javascript to your website.
jQuery(function($) { $('form').on('wpcf7calculate', function() { $('.wpcf7-calculation').each(function() { $(this).val(parseFloat($(this).val()).toFixed(2)); }); }); });
Forum: Plugins
In reply to: [The Events Calendar] Missing field “eventAttendanceMode”Hi, while we are waiting for an official plugin update that will hopefully introduce support for these new fields, here is a quick temporary fix that we added to our theme’s
functions.php
file in order to inject the extra info into the metadata of all our events./* all events moved online due to COVID-19 */ if (!function_exists('custom_event_schema_extras')) { function custom_event_schema_extras($_data, $args, $event) { $_data->eventStatus = 'EventMovedOnline'; $_data->eventAttendanceMode = 'OnlineEventAttendanceMode'; return $_data; } add_filter('tribe_json_ld_event_object', 'custom_event_schema_extras', 10, 3); }
Hello!
I am going to reply with regard to the free version, because I am not allowed to provide support for the Pro version on these forums. However, my reply is valid for both versions of the plugin.
My calculator plugin does have a limited ability to use date fields as inputs, but it cannot yield a date in its final output; it always has to be a number. You would therefore need an extra post-processing JavaScript to “translate” the number of weeks into a future date.
For a simple date calculation such as the one from your example, I would suggest that you skip my plugin altogether and code your own ad hoc embedded Javascript calculator. It will work well enough without the need for any server-side processing. Since the calculation formula is simple and is not confidential, it can be calculated directly in the visitor’s browser.
Forum: Plugins
In reply to: [PVB Contact Form 7 Calculator Add-on] Warning “continue”Hi, thank you for reporting this. These forums are only for supporting the free version of the plugin hosted on www.remarpro.com. If you can kindly repost your issue on the Pro version forum, I would be happy to provide support there. Thanks!
Forum: Plugins
In reply to: [PVB Contact Form 7 Calculator Add-on] simple sumYou can trigger calculation programmatically from your own Javascript code by calling the
cf7Calculate
function. It takes as a single argument a jQuery object constructed from the respectiveform
element. For example:<script> jQuery(document).ready(function($){ var recalc = function() { // Find any forms on the current page and activate the calculations cf7Calculate(jQuery('form')); }; jQuery('.wpcf7-form select').on('change', function() { cf7Calculate(jQuery(this).closest('form')); }); }); </script>
Forum: Plugins
In reply to: [PVB Contact Form 7 Calculator Add-on] kilograms?Hello,
Yes, you can achieve something similar with my calculator plugin. Drop-downs are a premium feature, but with the free version hosted here on www.remarpro.com you can easily enter kilograms and obtain a price quote.
Just FYI, the site you sent me as an example uses a different proprietary WordPress plugin which you might also consider for your needs: https://codecanyon.net/item/cost-calculator-wordpress-plugin/12778927
Best regards,
PetkoForum: Plugins
In reply to: [PVB Contact Form 7 Calculator Add-on] Not workHi, you have actually run into a limitation of the plugin. You can only have one calculated field on the same page (inline or in a popup).
To work around that, you can use iframes in your popups (I believe there are third-party plugins for that).
Alternatively, you may look into the Pro version of my plugin which does not have this limitation.
Hope this helps!
Best regards,
PetkoForum: Plugins
In reply to: [PVB Contact Form 7 Calculator Add-on] kilograms?Hello, I am not sure I understand your question. Could you please give me an example of the input and output that you are looking to obtain?
Forum: Plugins
In reply to: [PVB Contact Form 7 Calculator Add-on] Not workHello and thank you for reporting this!
Could you please provide a link to a page where the problem can be seen so I can look into it?Hello, I tested it with version 4.7.7 and it works like a charm. Thanks!
Forum: Plugins
In reply to: [PVB Contact Form 7 Calculator Add-on] Problem with the correct formulaHi, due to a limitation in the tokenizer module, the calculator fails to correctly interpret the minus sign before the parenthesis in your formula.
To work around that, try changing it to the following:
[calculation wynik precision:2 "(d + e + f + g + h)*(-1*((c / b)-1))"]
Hope that helps!
Forum: Plugins
In reply to: [PVB Contact Form 7 Calculator Add-on] Precision calculatorHi Laurent,
The “precision” option will always round to the nearest integer.
If you want to round up instead, you have two options.
Option 1: you can remove the “precision” option and instead use a JavaScript event handler that fires after the calculation and does the rounding. This is an example:
jQuery(function($) { $('form').on('wpcf7calculate', function() { var $field = jQuery('.wpcf7-calculation'); $field.val(Math.ceil(parseFloat($field.val()))); }); });
Option 2: the Pro version of the calculator plugin supports the “roundup” and “rounddown” options in addition to the “precision” option, so it will let you easily control the direction in which results are rounded. If you have any pre-sales or support questions related to the Pro version, you can contact me on my website.
Hope that helps!
Forum: Plugins
In reply to: [PVB Contact Form 7 Calculator Add-on] Loan Calculator – Yearly not MonthlyHi,
Your formula seems to be incorrect. Try this instead (derived from the annuity formula):
[calculation total precision:0 "loanamount * (1 + 2.3 / 12 * 0.01) ^ (years * 12) * 2.3 / 12 * 0.01 / ( (1 + 2.3 / 12 * 0.01) ^ (years * 12) - 1)"]
This should give you a result comparable to other online loan calculators.
Sorry, I need to reopen this topic just to let you know that I noticed another glitch after applying your suggested patch. When converting currencies for PayPal, the full price seems to be applied even if a product is on sale.
Example: a product variation is set to be reduced from 420 BGN to 360 BGN until a certain date. The cart and checkout page show the correct reduced price (360 BGN). After converting currencies though, the amount billed is 214.74 € which is the equivalent of the full price (reduced price should be 184.07 €).
Just letting you know so you can consider this in your testing. I hope you can let me know if a fix for this gets released.
Forum: Plugins
In reply to: [PVB Contact Form 7 Calculator Add-on] min max not workingYou can try adding this JavaScript snippet to your website to enforce min/max attributes strictly.
jQuery(function($) { $('input[type=number]').on('change', function() { var min = $(this).attr('min'); var max = $(this).attr('max'); var val = parseFloat($(this).val()); if (val > max) { $(this).val(max); } if (val < min) { $(this).val(min); } }); });