Microweber\Install\DefaultOptionsInstaller::setShippingEnabled PHP Метод

setShippingEnabled() публичный Метод

public setShippingEnabled ( )
    public function setShippingEnabled()
    {
        $existing = DB::table('options')->where('option_key', 'shipping_gw_shop/shipping/gateways/country')->where('option_group', 'shipping')->first();
        if ($existing != false) {
            $option = Option::find($existing->id);
        } else {
            $option = new Option();
        }
        $option->option_key = 'shipping_gw_shop/shipping/gateways/country';
        $option->option_group = 'shipping';
        $option->option_value = 'y';
        $option->save();
        $existing = DB::table('cart_shipping')->where('shipping_country', 'Worldwide')->first();
        if ($existing != false) {
            $shipping = Shipping::find($existing->id);
        } else {
            $shipping = new Shipping();
        }
        $shipping->shipping_country = 'Worldwide';
        $shipping->shipping_type = 'fixed';
        $shipping->shipping_cost = 0;
        $shipping->is_active = 1;
        $shipping->save();
    }