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.
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
Thanks for the details, I am trying to duplicate same problem, will feedback if there is anything found
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
Yes, it is exactly as you wrote it.
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.
You are great!!! Thank you very much.
Works perfectly!