Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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,
    Morticka

    #1215516

    Hey 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,
    Victoria

    #1215564

    Hi 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, 5 months ago by Morticka. Reason: Read the message before going to sleep, in the morning it made a lot more sense :D
    #1215670

    Hey 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,
    Morticka

    #1215843

    Hi Morticka,

    Ok, we are closing the thread.

    If you need further assistance please let us know in a new one.
    Best regards,
    Victoria

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Using cartflows with enfold ALB error’ is closed to new replies.