Okay
  Public Ticket #1162132
Menu not editing
Closed

Comments

  •  3
    Daniel started the conversation

    Hello,


    Can you help me whit menu edit? I dont see menu items in wordpress. 

    Can you see video? After update menu works ok. I test mega menu turn off plugin and I have same problem.

    Thank you

  •  1,558
    Laborator replied

    Hi Daniel,

    The mega menu is a 3rd party plugin not supported officially by our theme so it can cause problems to you because of it's functionality with the theme, they may be conflicting each other, if you're having issues with the menu then we can check it but firstly you will need to give us access to your site since we cannot access it.

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  •   Daniel replied privately
  • [deleted] replied

    Hi Daniel,

    After checking functions.php file, I saw you have added this code:

    function payment_gateway_disable_country( $available_gateways ) {
    global $woocommerce;
    $country = !empty($woocommerce->customer->get_shipping_country()) ? $woocommerce->customer->get_shipping_country() : $woocommerce->customer->get_country();
    if ( isset( $available_gateways['cod'] ) && $country <> 'SK' ) {
    unset( $available_gateways['cod'] );
    }
    return $available_gateways;
    }
    add_filter( 'woocommerce_available_payment_gateways', 'payment_gateway_disable_country' );

    And on menu page generates this error:


    (view large version)

    So I have added a line of code to prevent this from happening:
    function payment_gateway_disable_country( $available_gateways ) {
    global $woocommerce;
    // Firstly check if customer already is set
    if ( $woocommerce->customer ) {
    $country = !empty($woocommerce->customer->get_shipping_country()) ? $woocommerce->customer->get_shipping_country() : $woocommerce->customer->get_country();
    if ( isset( $available_gateways['cod'] ) && $country <> 'SK' ) {
    unset( $available_gateways['cod'] );
    }
    }
    return $available_gateways;
    }
    add_filter( 'woocommerce_available_payment_gateways', 'payment_gateway_disable_country' );

    So this IF condition: if ( $woocommerce->customer )  will check if the customer is set on $woocommerceglobal variable.

    Now the menu page can be opened. 

  •  3
    Daniel replied

    You are genius! How can I thank you?

  • [deleted] replied

    Hahaha, thanks Daniel, I am glad that its now working fine for you.

    You are more than welcome