Billing and Shipping address in Broadleaf Commerce - broadleaf-commerce

I'm experimenting with Collect on Delivery (COD) orders in Broadleaf commerce and the question that I have is: how do I find out the Billing and Shipping address that the customer has entered for that particular order?
I can see that entries for both addresses get created in blc_address table.
I guess the Shipping address can be checked via blc_fulfillment_group (address_id and order_id columns) but how about billing address?

Well you get that those details from Order entity
Include the orderService like
#Resource(name = "blOrderService")
protected OrderService orderService;
then query the order like
Order order = orderService.findOrderByOrderNumber(orderNumber);
//below is delivery address
order.getFulfillmentGroups().get(0).getAddress();
//and this is billing address
order.getPayments().get(0).getBillingAddress();

Related

Country flag of customer on bigcommerce orders page is not appearing?

I have created a custom checkout for bigCommerce it's a third party app so I am able to create the customers and orders on the Bigcommerce portal but on the order page the country flag is not showing with the customer. Is there anything I am missing for the for order flag.
And also shipping method is not syncing with the orders.
You have to pass the geoip_country and geoip_country_iso2 with order parameters the country flag will appear with the orders according to the ip address.

Set priority in cucumber scenarios by using tags

I am trying to execute the cucumber scenario's in sequential order. I have multiple feature files with different regions and want to execute my scenarios based on priority as per below.
feature file:1
#IE priority=1
Scenario: A new user can place a Contact Lens order with WorldPay
Given the Guest user trying to buy a mobile phone
When user pay using a card
Then the product is added into the basket
#IE priority=2
Scenario: A returning customer can place a express order
Given The returning customer trying to buy a mobile phone
When user pay using a card
Then the product is added into the basket
#IE priority=3
Scenario: A returning customer can place an order
Given The returning customer trying to buy a mobile phone
When user pay using a card
Then the product is added into the basket
feature file:2
#GB priority=1
Scenario: A new user can place a Contact Lens order with WorldPay
Given the Guest user trying to buy a mobile phone
When user pay using a card
Then the product is added into the basket
#GB priority=2
Scenario: A returning customer can place a express order
Given The returning customer trying to buy a mobile phone
When user pay using a card
Then the product is added into the basket
#GB priority=3
Scenario: A returning customer can place an order
Given The returning customer trying to buy a mobile phone
When user pay using a card
Then the product is added into the basket
I have tried the same with cucumber but unable to execute it in sequential order.

Netsuite customer statement divided per billing addresses

We are trying to customize the Netsuite Customer Statement in order to have for one customer with multiple billing addresses one page per billing address, but not sure if this is really possible. Does anyone knows how to do this?
Many thanks

Programatic shipping and taxes with Stripe Subscription

I would like to use Stripe for a physical subscription site.
Small number of SKUs
Some customers pick up instead of ship
Customers whose addresses are in one state are charged state and local sales tax
I'd like to use Stripe Subscriptions to do this but shipping costs and state/local taxes will be slightly different for every single customer and but unlike in the Stripe Orders API, it does not look like Subscriptions allows for me to dynamically calculate shipping and taxes. Is my reading of this correct, or is there a way for me to programatically edit recurring shipping and taxes on a per-subscription basis?
Thank you!
Answer via #mattwc in #stripe freenode: An invoice is created by the subscription each period 1 hour before it is charged. You can subscribe to this event via webhook and edit the invoice to add shipping and tax information.

Product Subscription - Autoship

I am looking for the best way to support product autoship / subscription which has a validity period (start, end date and shipping interval - (e.g 1 month) and associated product
Customer can subscribe to product autoship.
Products in the customer's order are grouped within the fulfillment group if they share the same autoship the customer has subscribed to.
On every autoship date, the same order is generated in the background.
Suggestions are much appreciated,
Thanks,
Milan
Broadleaf provides an enterprise-compatible module called Subscription that meets these requirements.
If you are looking for something in regards to community edition, you would have to make custom changes.
From a high level, you would want to do the following:
Some indication on your Product or Sku that indicates it is compatible with autoship / subscription.
An entity that holds the fields that you mentioned - start, end date, shipping interval, and also order, customer, customer payment, and status.
During checkout, add a new activity at the end of blCheckoutWorkflow that checks for compatible order items to create your "autoship" entity.
You will need to create some cron job or quarts scheduler that can trigger events. Sounds like you might want this to be set to a daily recurrence. This is provided in enterprise licenses, but you will have to do something custom for community.
Create an endpoint or service that the job/scheduler calls when triggered.
In your endpoint, you will want to create a new workflow with a set of activities. These activities will need to:
Prepare a new order by copying the required entities of the existing order from the "autoship" entity.
Trigger the blCheckoutWorkflow with your newly created order.
Update the "autoship" entity depending on success of the attempted payment.
This should get you to a good place given the requirements.

Resources