One of the areas we have reviewed in Commerce is the way that we handle custom items. Previously, many of our features were limited to Commerce Products. Even items such as Subscriptions and Download Files were not fully integrated. In Invision Community 5, we have looked at ways to improve the overall experience.
Â
Icons and Images
A small, but important change: displaying the item icon when an image is not available. In previous versions, if no image was available, the checkout and client area displayed a standard "box" icon for all items. In IC5, we now show the icon defined in your Item extension.
Â
Product Details
Line item details are displayed on the checkout screens, as well as on the Invoice. However, this functionality was restricted to custom package fields, which are only available for Commerce Products. This logic has been moved to a new extension method, detailsForDisplay.
Â
Coupons
A very popular request is to create coupons for specific items that are not Commerce Products. Previously, coupons could either be applied to the entire purchase or to specific packages. We have added the following methods to the Item extensions to allow you to integrate your items with the coupon form.
-
couponFormElements
Returns an array of elements that will be shown on the coupon form. If no elements are returned, your item will not be listed. -
saveCouponForm
Process the values of the fields defined in your couponFormElements method. This method returns an array of data that will be stored with the coupon. -
isCouponValid
Check if the coupon is valid for this item.
New default coupon form:
Â
Â
Autopay
When Commerce generates renewal invoices, we attempt to take a payment if a user has a card on file. We have moved this functionality to \IPS\nexus\Gateway::autopay(). Your gateway must also have the SUPPORTS_AUTOPAY constant set to true in order for this to work.
With the new logic, when a renewal invoice is generated, the task will loop through all available methods. If autopay is supported, it will attempt to take payment using that payment method.
Â
We've tried to include the most popular requests that we've seen for custom items and payments. What do you think? Have we missed anything? What are some of the requests you've received for custom item integration?
Recommended Comments