Home › Forums › Legacy Support › Support queries › Setup issues › Sort course category carousel using custom order or ID
Tagged: carousel, category, Course, custom order
- This topic has 15 replies, 5 voices, and was last updated 4 years, 4 months ago by Diana.
-
AuthorPosts
-
May 25, 2020 at 1:40 pm #262615Makarand ManeSpectatorHi in course category carousel I want to sort cat using ID or custom order provided in admin. It only sort with name. https://prnt.sc/snfmvaMay 27, 2020 at 6:39 am #263126Makarand ManeSpectatorHi Any updateMay 28, 2020 at 5:36 am #263509JacksonBlockedHello, Dear friend, sorry for late reply, But there is no option to sort courses by id or order in course category carousel, only there is an option to include terms by slug if you want to exclude some items from this carousel then include those items which you want to show, Refer: https://prnt.sc/sp6bv9 Thanks,May 28, 2020 at 11:36 am #263706Makarand ManeSpectatorHI Jackson I dont need to exclude. I need to re-order it, way my client want. Tell me where code of this elementor block is locatedMay 29, 2020 at 12:32 pm #264082JacksonBlockedHello @makarand, Sorry friend , This is Not available , Thanks,May 29, 2020 at 12:34 pm #264083Makarand ManeSpectatorHello @Jackson Just tell me where is code of this elementor block is located. I will change myselfMay 30, 2020 at 9:13 am #264292Anshuman SahuKeymasterIts in \wp-content\plugins\vibe-customtypes\metaboxes\library\vibe-editor.php file taxnomy_carousel function . Note that changing the code directly into core plugin files is not recommended , you will loose all these changes after update and we wont be able to help you with it .May 30, 2020 at 10:52 am #264304Makarand ManeSpectatorHi Alex
- Working with WPLMS since 2014, so well aware about updates
- I am going to modify it using hooks or I will override this function from child theme.
- Can u plz tell me in which function, taxnomy_carousel is called? I checked plugin and theme but didn't found this is used anywhere. I am using elementor builder not vibe builder, so it this same function used by elementor also?
- I saw this shortcode add_shortcode('v_taxonomy_carousel', array($this,'taxonomy_carousel')); But taxonomy_carousel is not used anywhere. Call back for this shortcode is taxonomy_carousel and declared function is taxnomy_carousel. Both are different in spelling.
May 30, 2020 at 12:19 pm #264323Makarand ManeSpectatorHi Alex, Addition to last reply,- You already have parameter declared for shortcode called orderby...
- For elementor you added control Order by but options are wrong ('Decending', 'Ascending') Which should be same as required by shortcode Like 'Alphabetical', 'description'& ,'meta_value_num'='Custom Order' & you dont have control named Order for elementor widget, with option ('Decending', 'Ascending') .
- If you add right control & so it work without any hassle. As shortcode already accepts parameter, meta_value_num & can sort by custom order
- I think its mistake in your code & you should fix in next update
$v_modules['taxonomy_carousel'] = array( 'name' => __('Course Category Carousel', 'vibe-customtypes'), 'options' => array( .................................... 'orderby' => array( 'title' => __('Show Direction arrows', 'vibe-customtypes'), 'type' => 'select', 'type' => 'select', 'options' => array('name'=>__('Alphabetical', 'vibe-customtypes'),'description'=>__('Description', 'vibe-customtypes'),'meta_value_num'=>__('Custom Order','vibe-customtypes')), 'std' => 1 ),
vibe-courseCarousel.php Line no 85$this->add_control( 'orderby', [ 'label' => __('OrderBy', 'vibe-customtypes'), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'rated', 'options' => array( 'DESC' => 'Decending', 'ASC' => 'Ascending' ), ] );
As you can see above, default parameter & options doesnt match at all. On line no 502, Why you are forcefully replacing orderby & order value?if(!empty($atts['orderby'])){ $args['orderby']='name';$args['order']=$atts['orderby']; }
June 1, 2020 at 1:44 pm #264808Anshuman SahuKeymasterYou are right , this was done by a team member who integrated the elementor with theme . Adding to issue log : https://trello.com/c/JrNeeThBJune 1, 2020 at 3:58 pm #264863Makarand ManeSpectatorLooks like your elementor developer was in too hurry to finish it :) Here is my patch https://pastebin.com/FZZuLyeNFrom 680925dc9c3147f052a574ad630b40d2f62fc56d Mon Sep 17 00:00:00 2001 From: Makarand Mane <[email protected]> Date: Sun, 31 May 2020 01:23:06 +0530 Subject: [PATCH] Fix sort category by custom order. Added new dropdown for orderby with correct options. Corrected code in callback function --- includes/elementor/widgets/vibe-courseCarousel.php | 12 +++++++++++- metaboxes/library/vibe-editor.php | 5 ++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/includes/elementor/widgets/vibe-courseCarousel.php b/includes/elementor/widgets/vibe-courseCarousel.php index 23a0dd3..3c7ec48 100644 --- a/includes/elementor/widgets/vibe-courseCarousel.php +++ b/includes/elementor/widgets/vibe-courseCarousel.php @@ -85,7 +85,17 @@ if ( ! defined( 'ABSPATH' ) ) { [ 'label' => __('OrderBy', 'vibe-customtypes'), 'type' => \Elementor\Controls_Manager::SELECT, - 'default' => 'rated', + 'default' => 'name', + 'options' => array('name'=>__('Alphabetical', 'vibe-customtypes'),'description'=>__('Description', 'vibe-customtypes'),'meta_value_num'=>__('Custom Order','vibe-customtypes')), + ] + ); + + $this->add_control( + 'order', + [ + 'label' => __('Order', 'vibe-customtypes'), + 'type' => \Elementor\Controls_Manager::SELECT, + 'default' => 'ASC', 'options' => array( 'DESC' => 'Decending', 'ASC' => 'Ascending' diff --git a/metaboxes/library/vibe-editor.php b/metaboxes/library/vibe-editor.php index 1d9af86..c0df8fa 100644 --- a/metaboxes/library/vibe-editor.php +++ b/metaboxes/library/vibe-editor.php @@ -500,7 +500,10 @@ function custom_post_carousel($atts, $content = null) { } if(!empty($atts['orderby'])){ - $args['orderby']='name';$args['order']=$atts['orderby']; + $args['order']= $atts['order']; + $args['orderby']=$atts['orderby']; + if( $atts['orderby'] == 'meta_value_num') + $args['meta_key']= 'course_cat_order'; } if(empty($args['include'])){unset($args['include']);} if(empty($args['orderby'])){unset($args['orderby']);unset($args['order']);unset($args['meta_key']);} -- 2.19.1.windows.1
June 2, 2020 at 1:09 pm #265140Anshuman SahuKeymasterThank you for reporting these .Will check carefully for other mistakes and these commits and update the plugin code .June 27, 2020 at 5:41 am #271045Makarand ManeSpectatorIs this code added in new update?June 29, 2020 at 12:20 pm #271560Anshuman SahuKeymasterWell the update has not rolled out yet .August 8, 2020 at 12:44 pm #281166mgozitnParticipantThis reply has been marked as private. -
AuthorPosts
- The topic ‘Sort course category carousel using custom order or ID’ is closed to new replies.