-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Description
Merchants who are selling into different regions can now configure individual price lists and tax settings to that region. For example, you can create a tax-exclusive price list for your US storefront and a tax inclusive price list for your UK storefront.
When you select inclusive or exclusive pricing for a price list, prices must be entered for each product and variant on the price list. To prevent unusual tax calculations and incorrect product pricing, empty price fields will now return as null.
The BC4WP plugin needs to be updated to support this new Price List model allowing null prices.
The plugin is currently using the moderntribe/bigcommerce-api-php-v3 client for all BC requests, and its pricing models/interfaces don’t allow nullable fields for pricing in some models.
Expected behavior
If a price field is left empty, no price should display on the storefront and the product or variant should not be purchasable.
Actual behavior
The price displays (oddly if some of the variants have prices - see image below). There is "[422] Product is not purchasable" error on the product page if attempting to add to cart.
Steps to reproduce behavior
- Ensure that the multi-storefront tax inclusive and exclusive price beta is enabled on your BigCommerce store
- Install the BC4WP plugin and create a channel on the beta-enabled store
- Create a price list with a tax setting different from global and assign it to the Wordpress channel
- Configure the price for a product and ensure that you leave the price blank (on the product or one of the variants)
- Note the error upon attempting to purchase the variant or product with a missing price
Screenshot/Video (if applicable)
Workaround or possible solution
Update ModernTribes PHP API client to support nullable prices and update the plugin once their client has been updated and released.
Additionally, plugin should respect the X-Allow-Nullable-Prices header for the pricing request. This can be done either in the plugin or implicitly enable this from bcapp since we know x-client-type will be Wordpress.