Search in sources :

Example 6 with ShippingOrigin

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

the class ShippingDistanceProcessorTest method testDistance.

@Ignore
public void testDistance() throws Exception {
    ShippingQuote shippingQuote = new ShippingQuote();
    Delivery delivery = new Delivery();
    delivery.setAddress("2055 Peel Street");
    delivery.setCity("Montreal");
    delivery.setPostalCode("H3A 1V4");
    Country country = new Country();
    country.setIsoCode("CA");
    country.setName("Canada");
    delivery.setCountry(country);
    Zone zone = new Zone();
    zone.setCode("QC");
    zone.setName("Quebec");
    delivery.setZone(zone);
    ShippingOrigin origin = new ShippingOrigin();
    origin.setAddress("7070, avenue Henri-Julien");
    origin.setCity("Montreal");
    origin.setPostalCode("H2S 3S3");
    origin.setZone(zone);
    origin.setCountry(country);
    // shippingDecisionTablePreProcessor.prePostProcessShippingQuotes(shippingQuote, null, null, delivery, origin, null, null, null, null, null, Locale.CANADA);
    System.out.println(delivery.getLatitude());
    System.out.println(delivery.getLongitude());
// System.out.println(shippingQuote.getQuoteInformations().get(Constants.DISTANCE_KEY));
}
Also used : ShippingQuote(com.salesmanager.core.model.shipping.ShippingQuote) Zone(com.salesmanager.core.model.reference.zone.Zone) Country(com.salesmanager.core.model.reference.country.Country) Delivery(com.salesmanager.core.model.common.Delivery) ShippingOrigin(com.salesmanager.core.model.shipping.ShippingOrigin) Ignore(org.junit.Ignore)

Aggregations

ShippingOrigin (com.salesmanager.core.model.shipping.ShippingOrigin)6 Country (com.salesmanager.core.model.reference.country.Country)4 ShippingQuote (com.salesmanager.core.model.shipping.ShippingQuote)4 Delivery (com.salesmanager.core.model.common.Delivery)3 Zone (com.salesmanager.core.model.reference.zone.Zone)3 PackageDetails (com.salesmanager.core.model.shipping.PackageDetails)3 ShippingConfiguration (com.salesmanager.core.model.shipping.ShippingConfiguration)3 ShippingOption (com.salesmanager.core.model.shipping.ShippingOption)3 CustomIntegrationConfiguration (com.salesmanager.core.model.system.CustomIntegrationConfiguration)3 IntegrationConfiguration (com.salesmanager.core.model.system.IntegrationConfiguration)3 IntegrationModule (com.salesmanager.core.model.system.IntegrationModule)3 IntegrationException (com.salesmanager.core.modules.integration.IntegrationException)3 ShippingQuoteModule (com.salesmanager.core.modules.integration.shipping.model.ShippingQuoteModule)3 BigDecimal (java.math.BigDecimal)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 Locale (java.util.Locale)3 ServiceException (com.salesmanager.core.business.exception.ServiceException)2 DataUtils (com.salesmanager.core.business.utils.DataUtils)2 MerchantStore (com.salesmanager.core.model.merchant.MerchantStore)2