Skip Navigation

[Resolved] crud commerce set/replace cart item data with postname or id

This support ticket is created 6 years, 3 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Nigel 6 years, 3 months ago.

Assisted by: Nigel.

Author
Posts
#1082844

Tell us what you are trying to do?update cart item data with meta field in crud form

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?hidden link

#1082867

Hello

I am using single product. product title is "pay to author" i have a post type post.

when user view post and click subscribe post curd form opens. i pass post id and post url to crud form page

there are fields " post id and post url" to store post id and post url of post

after crud commerce success woo order generated in order product name is "Pay to Author".

user subscribe for difference posts but always ordered product name is same "Pay to Author"

I want to add post name for which user subscribed in order details.

how to do this?

Thanks

#1082869

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

I'm not sure I understand the issue.

Are you aiming to do something like add additional fields to the WooCommerce Order when a product is added to the cart? (The typical example is when you are ordering a product that the customer can have engraved with a custom message, so that message is added as a field to the order.)

The title of this thread says "set/replace cart item data with postname or id", and I'm not sure what you mean by that.

#1082909

Hello

i am submitting curd form through product "pay to author" .
"pay to author" is product name linked with form.

different post subscription submitted through same crud form.

if user subscribe to post "Firrst post" After successful payment when user see order details "pay to author" is shown as ordered product but should be post name for which he subscribed

then user subscribe to one other post. After successful payment when user see order details it still shows "pay to author" as ordered product.

because user subscribe to different posts so he get always "pay to author" as product in their woo order details because product linked to crud fo

i want to show additional information post title with order details sent to user.

#1083803

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

Sorry, our messages crossed, I understand what you are aiming for.

Unfortunately, you cannot modify the details of the order created with a CRED Commerce form.

The process is built on top of WooCommerce, and involves:

- somewhere, you display a form to "publish" a post
- the form is linked to a WooCommerce product, and when the form is submitted the product is added to the WooCommerce cart
- the subsequent steps where order is submitted and payment processed is handled wholly by WooCommerce.

Toolset doesn't have any influence over the resulting order.

You can, however, send custom notifications that are triggered when the order is placed, when payment is completed etc., and the fields where you store the post title & post id are available in the notifications. So you can create a custom notification to send to the client (and to the site admin) that says "You have just paid for *this post*" and not simply the same product name each time.

I looked through the API for CRED Commerce (https://toolset.com/documentation/programmer-reference/cred-commerce-api/) and unfortunately I don't see a hook that would help you modify the order programmatically so that you can add custom fields to it. (The order ID is available as an argument with the cred_commerce_after_order_completed or cred_commerce_after_send_notifications hooks, but I think these will fire later than you require.)