Okay
  Public Ticket #2364834
Skip Cart --> Checkout
Closed

Comments

  • Liam started the conversation

    Hi,

    With Amelia 2.4 I recieved these info to skip the cart after an appointment.


    Now I will upgrade to 2.6 but there are some changes and before I change something. Can I have the right info how to change it again?

    Info from Amelia 2.4:

    modify the WooCommerceService.php file in the location /ameliabooking/src/Infrastructure/WP/Integrations/WooCommerce/

    and find the function GetCartUrl() 

    and change 'cart' to 'checkout' in it so it will look like this: 

    /**
         * Get cart page
         *
         * @return string
         */
        public static function getCartUrl()
        {
            return wc_get_checkout_url();
        }
    

    Now that part is:

     /**
         * Get cart page
         *
         * @return string
         */
        public static function getPageUrl()
        {
            switch (self::$settingsService->getCategorySettings('payments')['wc']['page']) {
                case 'checkout':
                    return wc_get_checkout_url();
                    break;
                case 'cart':
                    return wc_get_cart_url();
                    break;
                default:
                    return wc_get_cart_url();
            }
        }

    Is it still in the file you need to adjust, and what?

    Thanks for the info.

    Kind regards,

    Liam

  • [deleted] replied

    Hello Liam, 

    In the latest release of Amelia the developers added this as an option in the code (to proceed to checkout or the cart page, as you wish). So, now you just need to change this in you database and it will be saved there so you won't have to modify the code each time after the update. 

    When you go to your database you need to find and open the wp-options table, and find option amelia_settings in it. Then please edit this option and when you find property 'wc:' there you need to set cart for the 'page' property instead of checkout, like here: 

     "wc": {
            "onSiteIfFree": false,
            "page": "cart"
    }
    

    If you have any further questions or concerns feel free to ask.