Skip Navigation

[Resolved] How can we add addtional prices on cred forms ?

This thread is resolved. Here is a description of the problem and solution.

Problem:

Change the product ID when user submits the CRED form with CRED commerce settings.

Solution:

There isn't such a built-in feature within CRED commerce plugin, but you can try with some PHP codes, for example, when user submit the CRED form for creating the post, use action filter hook "cred_commerce_add_product_to_cart" to trigger your custom PHP function, in this function, change the product ID when specific condition is satisfied.

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/cred-commerce-api/#cred_commerce_add_product_to_cart

Filter that allows to dynamically alter the product associated with a CRED Commerce form, when adding to cart.

This support ticket is created 6 years, 8 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/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 6 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#710594

Tell us what you are trying to do?
Adding more price option on cred form.
Is there any documentation that you are following?
https://toolset.com/forums/topic/multiple-woo-commerce-products-in-cred-form-and-chck-out/

Hi,

Scenario:
Adding and editing listing posts via cred form. Need to add addtional prices.
1-Main Listing Price:
For examle theree month listing price is: 39 $ (cred form connected with woo product)
2-Additional Price (Three days - highligted )
Post will be highligted on homepage for three days( Featured category can be assigned automatically if this option also selected).
The total must be 42 $. But we conencted form with woocomerce product(39$) created before .
Also author shoul be able to select highligted option after published?

Listing will be published for 3 months also shown for 3 days as highligted at featured category on homepage.It will not be highlighted rest of publishing duration until author of listing edit to add a new 3 days highligted option.
We can show only one price on cred form. Is there any way to add more price option like main price connected woocommerce ?

How can we create option to add and edit additional price on cred forms which connected woocommerce?

My solution:
How does is it sound if I creted 2 forms which connected 2 seperated woocommerce products (39 $ and 3 $). One form for edit whole post and one for just selecting featured category. But the problem is duration of post. I don't know which one will be valid.
3 Months(main listing price) or 3 days(highligted) if author needs to edit his post ?

Solution Or your advice ?

Thanks

#713342

Hello,

There isn't such a built-in feature within CRED commerce plugin, but you can try with some PHP codes, for example, when user submit the CRED form for creating the post, use action filter hook "cred_commerce_add_product_to_cart" to trigger your custom PHP function, in this function, change the product ID when specific condition is satisfied.

More help:
https://toolset.com/documentation/programmer-reference/cred-commerce-api/#cred_commerce_add_product_to_cart
Filter that allows to dynamically alter the product associated with a CRED Commerce form, when adding to cart.

#743216

Ok.Thanks

#746214

You are welcome