Search in sources :

Example 1 with ShippingPackageType

use of com.salesmanager.core.model.shipping.ShippingPackageType in project shopizer by shopizer-ecommerce.

the class ShippingServiceImpl method getPackagesDetails.

@Override
public List<PackageDetails> getPackagesDetails(List<ShippingProduct> products, MerchantStore store) throws ServiceException {
    List<PackageDetails> packages = null;
    ShippingConfiguration shippingConfiguration = this.getShippingConfiguration(store);
    // determine if the system has to use BOX or ITEM
    ShippingPackageType shippingPackageType = ShippingPackageType.ITEM;
    if (shippingConfiguration != null) {
        shippingPackageType = shippingConfiguration.getShippingPackageType();
    }
    if (shippingPackageType.name().equals(ShippingPackageType.BOX.name())) {
        packages = packaging.getBoxPackagesDetails(products, store);
    } else {
        packages = packaging.getItemPackagesDetails(products, store);
    }
    return packages;
}
Also used : ShippingPackageType(com.salesmanager.core.model.shipping.ShippingPackageType) PackageDetails(com.salesmanager.core.model.shipping.PackageDetails) ShippingConfiguration(com.salesmanager.core.model.shipping.ShippingConfiguration)

Aggregations

PackageDetails (com.salesmanager.core.model.shipping.PackageDetails)1 ShippingConfiguration (com.salesmanager.core.model.shipping.ShippingConfiguration)1 ShippingPackageType (com.salesmanager.core.model.shipping.ShippingPackageType)1