• Resolved shoot2

    (@shoot2)


    dear all,

    After i replace orginal file got this error? What happend?

    public_html/wp-content/plugins/booked-woocommerce-payments/lib/woocommerce/class-wc-cart.php. Error message: syntax error, unexpected ‘ global’ (T_STRING)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter shoot2

    (@shoot2)

    class Booked_WC_Cart_Hooks {

    public static function woocommerce_checkout_fields( $fields ) {
    151 >>>? ?global $woocommerce;
    ? ?$booked_first_name = $woocommerce->session->get( ‘booked_first_name’ );
    ? ?$booked_last_name = $woocommerce->session->get( ‘booked_last_name’ );
    ? ?$booked_email = $woocommerce->session->get( ‘booked_email’ );

    ? ?if(!is_null($booked_first_name)):
    ? ? $fields[‘billing’][‘billing_first_name’][‘default’] = $booked_first_name;
    ? ?endif;
    ? ?if(!is_null($booked_last_name)):
    ? ? $fields[‘billing’][‘billing_last_name’][‘default’] = $booked_last_name;
    ? ?endif;
    ? ?if(!is_null($booked_email)):
    ? ? $fields[‘billing’][‘billing_email’][‘default’] = $booked_email;
    ? ?endif;
    ? ?return $fields;
    }

    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @shoot2!

    It is never a good idea to make changes to any core files. I am not sure about the plugin you are using ( booked-woocommerce-payments ), but your best bet would be to reach out to the author of that plugin and see if there is a code snippet available for what exactly you need to achieve, without you having to override the core code.

    Cheers!

    Thread Starter shoot2

    (@shoot2)

    Solved. ??? PHPissues.

    Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there,

    That Booked_WC_Cart_Hooks class that you are editing in the booked-woocommerce-payments plugin is not part of the core WooCommerce plugin (which is what this support forum is for). For assistance with that plugin, please contact the support team for that plugin — it appears that might be the Payments add-on for the Booked WooCommerce plugin here:
    https://getbooked.io/

    Best of luck and take care! If you have any questions about the core WooCommerce plugin, please feel free to open a new forum post. Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error message: syntax error, unexpected ‘ global’ (T_STRING)’ is closed to new replies.