Having problems with the Costs & Estimations plugin

Hello,

How are you?

I’m have a couple of issues after updating the Costs & Estimations plugin. The email delivery after the forms are completed has become totally unreliable. I’m still using the same plugin (WPSMTP with mailgun API) that I was before but now a lot of emails don’t get delivered. Some old customers have also started receiving gubberish emails even thought they haven’t visited our site for months. I rolled back to an earlier backup of the site before I updated the plugin and this seemed to resolve the issues.

Also, there’s some weird stuff happening with calculations. Here is the page: https://iloveasiatour.com/book-hoi-an-street-food-tour/

The calculation is supposed to be the price of the tour selected (walking, scooter, car) multiplied by the number of people selected. But it doesn’t seem to show the correct price regardless of which formula I use.

Hello @sameep,

Thanks for writing in!

Have you tested your SMTP if it is working? It could be a server or your WordPress SMTP that is at fault. Regarding the calculation, it seems that there is no base price displaying in the form. Would you mind providing us access to your site so that we can check your settings? Please create a secure note with the following info:
– Link to your site
– WordPress Admin username / password

To know how to create a secure note, please check this out: https://theme.co/apex/forum/t/how-to-get-support/288

Regards.

Hi @sameep,

Thanks for reaching out.

I have tried the Costs Estimation plugin with the same version as yours and it’s sending emails work okay without a problem.

The issue could be the mail system provider that you’re using. There could be a security issue that isn’t present before, which is now and it blocks email. And Costs Estimation plugin isn’t a subscription plugin or service, so your old customers shouldn’t get any recurring emails. Unless something in your site or mail service is collecting those data and sending them emails.

Wordpress only relies on the mail system provided by hosting, or by a plugin like SMTP. And Cost Estimation only uses the resources provided by Wordpress, hence, it has no control over the emails processed by your mail system. It only feeds the message to send, then your mail system process and send them.

And may I know to what version you have upgraded it? Because your current Costs Estimation plugin is up to date to the bundled version that we provided, then may I know what’s resolved?

As for the calculation, is it okay if you clone your site as staging and I’ll check there? So wouldn’t need to change your existing setup on your live site. Something is weird, the “type of tour” always return zero on my test.

And It shouldn’t be multipled by price or you’ll really get wrong total.

Example,

“type of tour” = 40 (+ operation)
“how many people” = calculation by multiplication (+ operation), let’s say 5 people

Hence, 40 + ( 40 * 5 ) = 8,000

You see, every field has its own price that is added to the total price. When you already selected the “type of tour”, it’s already added to the total. Then that price is multiplied again by the number of people and the result is again added to the total price. It’s like total = total + 1 in coding, increment values.

The solution would be not adding the “type of tour”

Then just calculate it by multiplying “the type of tour” and “amount of people”, the product will then be added to the total price. Which means, you only need one field that has one price, and that one is the field where you apply the calculation.

This works on my installation [item-1103_value] * [item-1093_value], but the [item-1103_value] “type of tour” always return zero on your site. And I like to check that further, and if possible please restore your site to when it still working so I could Identify what’s changed while we troubleshoot this on your staging. I’m not sure either if this was really working before as this seems data related, especially something wrong with the mailing process too.

Thanks!

Thanks a lot for your reply. I’m sorry I wasn’t clear about the email part of the problem.

So around 20th Sep, I updated the Costs and Estimations plugin to the latest version at that time. Almost immediately, the problems started. Gibberish emails, poor email delivery etc. I tried three different mailing solutions. Mailgun through WPSMTP plugin, Normal SMTP through the Costs and Estimations settings and even PHP mail through the default WordPress functionality. None of them worked. So I rolled back to the site backup from 19th Sep and everything started working again. Then because some of the forms weren’t rendering, I thought I’d try deactivating the plugin and then reactivating it, but since it was not the current version, there was no option to activate the plugin without upgrading it. So I upgraded it and it seems to be working okay for now. In case I have any more problems with the email delivery, I’ll get back to you.

We’ve made changes to the content on some pages so unfortunately I can’t restore the site to an earlier version. We’ll have to redo the changes. I’ll try the formula that worked for you in your reply. Or if you suggest a better method to achieve what we need, im open to suggestions.

Thanks a lot for your time.

Hi @sameep,

Glad that part is now working.

And I’m trying that calculation but not really working on your setup, it seems the value from those other fields isn’t accessible within the calculation area.

Your form is very simple so it should work, it’s even working on complex forms. I’ll continue checking, but I can’t rule this out as a bug as of yet.

Thanks!

Great. Thanks a lot. Please let me know. As you can imagine, we really need that functionality.

Hi @sameep,

I duplicated your sample form and applied this formula

[price] = [total]
[price] = [price] - ( [price] /  [item-1129_quantity]  )

And it works, the idea is this

Given:
The [price] of “How many people” field is zero
The [total] is equal to already selected “Type of Tour”, let’s say 40.

Now, in order for “How many people” to work, we need to add a price into it, hence let’s make [price] equal to the overall total price and that is 40 since we already selected it. Which makes the overall total to 80 (eg. "Type of tour" + "How many people")

40 + 40 x 1 = 80

[price] = [total] //40 multiplied by quantity like 1
[total] = [price] + [type of tour] //40 the type of tour plus the new [price]

It seems the Cost estimation plugin now read the calculation per line, and the result per line is applied to overall total. Hence this simple line [price] = [total] made it 80 even though the amount of people is 1.

To fix it, I added another line [price] = [price] - ( [price] / [item-1129_quantity] ) which translate to this

80 = 80 - ( 80 / 1 ) result to 0

hence 40 + 0 = 40 and that is type of tour + [price]

Another sample, let’s say Walking and 5 people

Walking = 40
How many people = 5

40 + 40 x 5 = 200
200 = 200 - ( 200 / 5 )
Result = 160

And to confirm this, Type of tour multipled by how many people ( 40 x 5 = 160 ). A simple implementation needs this complex calculation due to priorities of per line calculations that changes overall total right away.

Hope this helps.

Great! Thanks a lot for clearing that up. I’ll edit all the forms now with this new formula.

Thanks once again.

You’re welcome, @sameep. Glad we’re able to help.

Hello. I’m sorry to bother you again but there’s a problem with the plugin again. We just started getting the gibberish emails again. I’ve attached a screenshot.

This was happening even earlier but then everything started working. Yesterday, someone made a booking and this is the email we got. This started after the plugin update around 20th of September. This never happened before that. Then it got resolved for a few days and now it’s back.

Hi @sameep,

I tried to replicate the issue but failed. Can you try doing some test bookings and see if the emails are still sending gibberish contents? If yes, can you paste the email here? So that we can add it to the report that we will send to the plugin’s author if this issue will still not be resolved. Thanks!

We made a lot of test bookings. A lot of emails weren’t delivered. A few came through. This was the same problem that we had earlier when I originally raised this support request. Is there any way to revert back to the old version of the plugin till this issue is fixed or figured out? All these problems only started after the update around Sep 20.

Hey There,

Please write us an email via our contact form here and we’ll send you the older version so you can give it a try. Thanks!

Hello. I sent an email for the old plugin 3 days ago. Haven’t heard anything yet. We’re having problems with our bookings because of this plugin issue. Could you please look into it?

Hey Sam,

Please check your emails. Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.