Skip Navigation

[Resolved] Notification on Cred commerce after post publish

This support ticket is created 4 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 10 replies, has 3 voices.

Last updated by Pat 4 years, 1 month ago.

Assisted by: Waqar.

Author
Posts
#1793149

Pat

Hello,

I have a site with Toolset and WC and have created a form WC. This form is used to define a specific product thanks to a radio field. This is working fine until there and the specific product is placed in the cart. The related opst is well created alszo as a draft.

Now, I have created a notification that should be sent as soon as the post is published.
I have forced the publish state in the WordPress backend and I'm not getting any notificatiuon. Does that means that the notification is sent only if the publish state is made after that the WC order is validated?

Regards
Pat

#1793773

Pat

Hello,

Trying to better understand this issue, I found a bug :
I'm still in the configuration of a Forms WC using a specific radio custom field to define the product to buy. If I setup a notification, no product is added to the cart. If I disable the notification, then the right product is added to the cart. It seems that the 2 processes are not working together ?

Let me know
Regards
Pat

#1794011

Hello,

I assume we are talking about the option " The form specifies the product according to the value of this custom field" of Toolset Form Commerce plugin.

I have tried it in my localhost with a fresh WP installation + the latest version of Toolset plugins, it works fine according to the details you provided above.

I can see different product when choose different option in the custom radio field, after complete the order, I can see the email notification without any problem.

So the problem is abnormal, please check these:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP/JS code snippets, and test again

3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

#1795599

Pat

Hi Luo,

I have disable the WP Mail SMTP plugin andd now, the notification is working ... but only if I check the "send the notification as soon as the form is validated". If I try with "send the notification when the post moves the Publish" or "when the order moves to In progress", then no notification is sent.

For info, when the form is validated, the post is draft as defined in the form. Then, I have tried to make it publish manually in the WordPress backoffice and no notification was sent. I have also validated manually the order. Then, the post has moved to publish (which is normal), but no notification has been sent. That's why I was asking if the fact to manually change the status of the post or the order should work the same way as if the order was validated thanks to the payment (the only available payment on this site is Monetico and I cannot use it "for real" as I should pay each time I make a test !!!).

Regards
Pat

#1797739

Hi Pat,

Thanks for writing back.

Luo is on vacation, so I'll be following up on this ticket.

I've performed some tests with a similar Toolset Form and the "When post status changes to" and "When the purchase status changes to" form notifications options on a test website and it worked every time.

Can you please share temporary admin login details, so that I can see how this form and its notification is set up?
( please also share the link to a page where this form can be seen )

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1797769

Pat

Hi Waqar,

Thanks for taking care.

I'm not able to give you access as the site is now in production. We are working on an additional function actually.
Is there anything I can do to help you to have a better understanding?
Regards
Pat

#1797893

Pat
Toolset3.jpg
Toolset2.jpg
Toolset1.jpg

Hi Waqar,

Some additional info :

- I have tried to use the notification when the order moves to processing or when the post moves to publish and none of them work ! Is there something I can ckeck to see if this issue could come from a bad parameter? I attach 2 screenshots of the notification parameters.

- Then, I tried to use a user ID as the receiver of the notification (in the notification, it is explained that I can chose a user ID thanks to a generic field. I have created a generic field with the current user ID as default, but even with refreshing the field, I have nothing to chose (even if there are several generic fields inside the form that should appear after refreshing!!!). See file Toolset3.jpg to better understand my point.

Could you check if this functionality is working fine on your side? and if yes, what could make it not working on my site (which could lead to an explicaiton of the notification not been sent?)

Regards
Pat

#1802827

Hi Pat,

Thank you for sharing these details.

I understand if you can't share admin access to this production website. The main point to troubleshoot is whether these emails notifications are not being generated or are they having some delivery issue.

I'll recommend to turn on WordPress debugging and see if any error or warnings are generated in the server's error logs.
( ref: https://wordpress.org/support/article/debugging-in-wordpress/ )

Additionally, you can install any third-party plugin like "Post SMTP", which can log the emails sent through the website. This will help in tracking whether email notifications were generated or not.

As for getting user ID from a generic field, I included a "Hidden" type generic field in my form ( screenshot: hidden link ) and it became available in the notification option, as expected ( screenshot: hidden link ).

I'll recommend checking if the generic field is configured correctly.

regards,
Waqar

#1802907

Pat
Toolset.jpg

Hi Waqar,

First of all, here is the generic field I have inserted inside my Forms in order to retrieve the user ID :

      <label>ID utilisateur</label>
[cred_generic_field field='wpcf-id-utilisateur' type='numeric' class='' urlparam='']
{
"required":0,
"persist":1,
"validate_format":0,
"default":"[wpv-user field="ID"]"
}
[/cred_generic_field]

You can see the screeenshot where no field is proposed !!!

Concerning the notification, I have seen that some errors are reported in the console. Here is the detail :
[Script Loader] Error: Permission denied to access property "mediaText"
scanMediaQueries hidden link line 37 > eval:29
scanMediaQueries hidden link line 37 > eval:29
init hidden link line 37 > eval:29
e hidden link line 37 > eval:29
<anonymous> hidden link line 37 > eval:29
<anonymous> hidden link line 37 > eval:27
<anonymous> hidden link line 37 > eval:27
exports hidden link
<anonymous> hidden link
n hidden link
<anonymous> hidden link
n hidden link
<anonymous> hidden link
<anonymous> hidden link
custom.unified.js:37:94
init popups ✔ pum-site-scripts.js:7:12175
Erreur dans les liens source : Error: request failed with status 404
URL de la ressource : hidden link
URL du lien source : custom.unified.js.map

What is strange is that I'm getting the error when logged as a user, but if I'm logged as admin, then, no errors are reported and the notificaiton works well !

I have requested the Divi team support on this issue but perhaps you jave your own idea?

Regards
Pat

#1804533

Hi Pat,

Can you please update the code for the generic field slightly to:


<label>ID utilisateur</label>
[cred_generic_field field='wpcf-id-utilisateur' type='numeric' class='' urlparam='']
{
"required":0,
"persist":1,
"validate_format":0,
"default":"[wpv-user field='ID']",
"generic_type":"user_id"
}
[/cred_generic_field]

After that, this generic field should become available in the notification's option.

Once this is working, you can test the form notification again with the Divi and a default theme like Twenty Twenty, to see if this is limited to a particular theme.

regards,
Waqar

#1804833

Pat

Hi Waqar,

Sounds good, I have now the ability to add the user ID in the notification.
Concerning the notification mail, I have updated the Divi theme and now, it seems that everything id working fine.
Many thanks for your support.
Regards
Pat