@Override public void addSubjectJDynamiTeValues(JDynamiTe jDynamiTe, Transaction transaction) { super.addSubjectJDynamiTeValues(jDynamiTe, transaction); CompanyDetails companyDetails = CommonConfiguration.getCommonConfiguration().getDefaultCompanyDetails(); jDynamiTe.setVariable("COMPANY_NAME", companyDetails.getCompanyName()); jDynamiTe.setVariable("ORDER_NUMBER", transaction.getId().toString()); }
@Override public boolean isApplicable( Transaction transaction, AdditionalShippingOption additionalShippingOption, boolean isFrontEnd) { if (!super.isApplicable(transaction, additionalShippingOption, isFrontEnd)) { return false; } if (TransactionType.ECOMMERCE_ORDER.equals(transaction.getTransactionStatus())) { if (!isShowingOnWebsite()) { return false; } } return true; }
@Override public void addContentJDynamiTeValues(JDynamiTe jDynamiTe, Transaction transaction) { super.addContentJDynamiTeValues(jDynamiTe, transaction); jDynamiTe.setVariable( "CUSTOMER_FULLNAME", transaction.getEcommerceShoppingCart().getCustomer().getDisplayName()); CompanyDetails companyDetails = CommonConfiguration.getCommonConfiguration().getDefaultCompanyDetails(); jDynamiTe.setVariable("COMPANY_NAME", companyDetails.getAddress().getContactFirstName()); if (companyDetails.getLogoDetails() != null) { jDynamiTe.setVariable("COMPANY_LOGO", companyDetails.getLogoDetails().getFilename()); } jDynamiTe.setVariable("COMPANY_WEBSITE", companyDetails.getWeb()); jDynamiTe.setVariable("ORDER_NUMBER", transaction.getId().toString()); jDynamiTe.setVariable("DISPATCH_DATETIME", new Date().toString()); String shippingMethodName = ""; if (transaction.getEcommerceShoppingCart().getAvailableShippingService() != null) { shippingMethodName = transaction .getEcommerceShoppingCart() .getAvailableShippingService() .getCachedServiceName(); } jDynamiTe.setVariable("SHIPPING_METHOD_NAME", shippingMethodName); jDynamiTe.setVariable( "SHIPPING_ADDRESS_STRING", transaction.getShippingAddress().getAddressString()); jDynamiTe.setVariable("ORDER_STATUS", transaction.getTransactionStatus().getLabel()); List<ShoppingCartItem> shoppingCartItems = transaction.getEcommerceShoppingCart().getItems(); for (int i = 0, n = shoppingCartItems.size(); i < n; i++) { EcommerceShoppingCartItem shoppingItem = (EcommerceShoppingCartItem) shoppingCartItems.get(i); jDynamiTe.setVariable( "PRODUCT_CODE_REPEATED", CommonUtil.getStringOrEmpty(shoppingItem.getItemCode())); jDynamiTe.setVariable("PRODUCT_SIZE_REPEATED", shoppingItem.getProductSize()); jDynamiTe.setVariable("PRODUCT_BRAND_AND_NAME_REPEATED", shoppingItem.getItemName()); jDynamiTe.setVariable( "PRODUCT_QUANTITY_REPEATED", FormatUtil.formatTwoDigit(shoppingItem.getQuantity())); jDynamiTe.parseDynElem("productList"); } jDynamiTe.setVariable( "COMPLETE_OR_CONTINUE", "This dispatch completes your order. We hope you will be very happy with your purchases."); jDynamiTe.setVariable("PART_OR_Y", "Y"); }