Tagged: Advanced, ALB, cartflows, Layout Builder
-
AuthorPosts
-
May 22, 2020 at 12:15 pm #1215208
Hi guys,
In order to style woocommerce checkout I installed Cartflows (free version)
On their website (https://cartflows.com/docs/enfold-avia-builder/) they gave the code to get Enfold and Cartflows to work together:
function avf_alb_supported_post_types_mod( array $supported_post_types ) { $supported_post_types[] = 'cartflows_step'; $supported_post_types[] = 'cartflows_step'; return $supported_post_types; } add_filter('avf_alb_supported_post_types', 'avf_alb_supported_post_types_mod', 10, 1); function avf_metabox_layout_post_types_mod( array $supported_post_types ) { $supported_post_types[] = 'cartflows_step'; return $supported_post_types; } add_filter('avf_metabox_layout_post_types', 'avf_metabox_layout_post_types_mod', 10, 1);
When I put the code in my childtheme functions.php, I got this error:
Your PHP code changes were rolled back due to an error on line 67 of file wp-content/themes/enfold-child/functions.php. Please fix and try saving again.
Cannot redeclare avf_alb_supported_post_types_mod() (previously declared in wp-content/themes/enfold-child/functions.php:29)
How can I fix this?
Sincerely,
MortickaMay 23, 2020 at 4:22 pm #1215516Hey Morticka,
You already used that function name earlier, so you need to call this avf_alb_supported_post_types_mod function in a different way, f.ex avf_alb_supported_post_types_mod_catflows.
Best regards,
VictoriaMay 23, 2020 at 7:37 pm #1215564Hi Victoria,
I don’t understand what you’re saying. What would the new code look like?Woops, never mind, I see what you meant. :) The new code would be:
/* Adds pagebuilder to Cartflows */ function avf_alb_supported_post_types_mod_cartflows( array $supported_post_types ) { $supported_post_types[] = 'cartflows_step'; $supported_post_types[] = 'cartflows_step'; return $supported_post_types; } add_filter('avf_alb_supported_post_types', 'avf_alb_supported_post_types_mod', 10, 1); function avf_metabox_layout_post_types_mod_cartflows( array $supported_post_types ) { $supported_post_types[] = 'cartflows_step'; return $supported_post_types; } add_filter('avf_metabox_layout_post_types', 'avf_metabox_layout_post_types_mod', 10, 1);
Unfortunately, it does not work, the button for the Avia layoutbuilder is not there? Did I do something wrong, can you help me?
Sincerely,
Morticka- This reply was modified 4 years, 6 months ago by Morticka. Reason: Read the message before going to sleep, in the morning it made a lot more sense :D
May 24, 2020 at 9:17 am #1215670Hey Victoria,
You know what, never mind. I’m going to look for another, simpler solution to style the woocommerce checkout page.
Thx for your effort so far, you can close this ticket. :)
Sincerely,
MortickaMay 24, 2020 at 6:03 pm #1215843Hi Morticka,
Ok, we are closing the thread.
If you need further assistance please let us know in a new one.
Best regards,
Victoria -
AuthorPosts
- The topic ‘Using cartflows with enfold ALB error’ is closed to new replies.