Skip Navigation

[Resolved] Categories in "Packages"

This support ticket is created 7 years, 4 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
- 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 6 replies, has 2 voices.

Last updated by Bochnacki 7 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#548385
categories-in-package.jpg

Continuing the topics https://toolset.com/forums/topic/additional-packages/page/2/#post-537772
Please help me to add posts in Packages, in different categories.
Categories I have created as taxonomies in CPT "Ogłoszenia".
Currently posts in Package/Packages can be added into the "Osobowe" category, and I would like to also "Dostawcze" (screen "categories-in-package.jpg"). Finally, the category will be more.

Thank you in advance for help.

#548623

Dear Bochnacki,

Since there is a connection problem, it is very slow for me to debug in your website, and your website has been changed recently, please provide the latest database dump file of your website in below "private detail box", I need to duplicate same problem and debug it in my localhost, thanks

#548701

Thanks for the details, I am trying to duplicate same problem, will feedback if there is anything found

#549371

Since your website isn't in English, it takes more time to locate the problem:
Here are what I found:
1) I assume we are talking about the page "Nowe ogłoszenie w ramach Pakietu" (page ID: 643):
hidden link

You can edit it, there are two lines codes which are for outputting the CRED form links:

[cred_child_link_form form='730' text='Osobowe' target='_self']
[cred_child_link_form form='767' text='Dostawcze' target='_self']

the second line is the link "Dostawcze" in your screenshot:
hidden link
Which is linked to target page ID 767:

2) In the target page "Dodaj ogłoszenie w kat. Dostawcze - pakiet", there is only one CRED form shortcode:
[cred_form form='ogloszenie-w-kat-dostawcze-pakiet' form_name='Ogłoszenie w kat. Dostawcze - pakiet']

3) The CRED form "Ogłoszenie w kat. Dostawcze - pakiet" (ID 1731) is for creating post of post type "Dostawcze"

It seems to be a CRED form created by your self, are you going to add PHP codes to do this:
CRED form "Ogłoszenie w kat. Dostawcze - pakiet" (ID 1731) work same as CRED form "Ogłoszenie w kat. Osobowe - pakiet" (ID 645, slug "add_another_premium_ad")?

To avoid more misunderstand, please confirm it first, thanks

#549377

Yes, it is exactly as you wrote it.

#549401

Here is a workaround:
1) Edit the file of plugin "toolset-classifieds", file "\toolset-classifieds\inc\toolset-classifieds.class.php", line 11, from:

        protected $_Class_Toolset_Classifieds_PackageOrder = NULL;

to:

        public $_Class_Toolset_Classifieds_PackageOrder = NULL;

2) Add below codes into your theme/functions.php


add_action('wp_loaded', 'my_custom_func');
function my_custom_func(){
	global $Class_Toolset_Classifieds;
	
	/** Add another premium ads from package */
	add_action('cred_save_data_form_ogloszenie-w-kat-dostawcze-pakiet', array($Class_Toolset_Classifieds, 'classifieds_auto_assign_layouts_listings'),10,2);
	
	$Class_Toolset_Classifieds_PackageOrder = $Class_Toolset_Classifieds->_Class_Toolset_Classifieds_PackageOrder;
	
	add_action('cred_submit_complete_form_ogloszenie-w-kat-dostawcze-pakiet', array($Class_Toolset_Classifieds_PackageOrder, 'classifieds_cred_submit_complete_add_another_premium_ad'), 10, 2);

	/**Hook OK**/
	add_action('cred_commerce_after_send_notifications_form_ogloszenie-w-kat-dostawcze-pakiet', array($Class_Toolset_Classifieds_PackageOrder, 'classifieds_cred_commerce_after_send_notifications_add_another_premium_ad'), 10, 1);
	
}

Then test again.

#549421

You are great!!! Thank you very much.
Works perfectly!