Appearance
Upgrading to 4.0
4.0.0 is a major release. Most sites update without changes, but read this page before you update: it lists what you have to check in your templates and settings. All changes are in the changelog.
You can update directly from any 1.x, 2.x or 3.x version, follow the update instructions. Make a backup of the files and the database first, and test the update on a copy of your site when you can.
Requirements
4.0.0 requires ExpressionEngine 7.3+ and PHP 8.2+. ExpressionEngine checks these requirements when you install the add-on. For ExpressionEngine 6 and lower use the legacy package in the download (legacy/ee_reinos_store-v3.12.0.zip).
Check your templates
Order status
{order:status} in the order and orders tags (and {status} in the order confirmation email) is the status itself, e.g. complete, so it works in conditionals. The label, e.g. Complete, is the new {order:status_label} ({status_label} in the email), now also for failed, expired and charged back orders.
- The update replaces
{status}with{status_label}in the Store's order confirmation email. - Replace
{order:status}with{order:status_label}yourself where your templates show the status.
See Order tag.
Manual gateway orders are pending
A new order with the Manual gateway gets the status pending instead of staying open like an unfinished checkout. This is also the case when the gateway is chosen with the payment_gateway param of the checkout tag or by an add-on such as Store Pickup. The new Status of a new order setting of the Manual gateway can set it to complete (unpaid).
With Store Email, use a template on pending (or complete) and not paid for these orders. See Payment Gateways.
Return urls
The return_url of the checkout and cart forms and of the delete_cart_item link only goes to a url of the site itself, otherwise the customer goes to the homepage. Encode a space in the url as %20.
Review template
The review page only uses the review_template param of the checkout tag. A review_template field in the checkout form is ignored, move it to the param.
Shipping methods
The checkout shows the shipping method missing error ({global_error:shipping_method_missing}) when the chosen shipping method is not one of the shipping methods offered for the cart. Templates that still post the old shipping_module_legacy method of Store Shipping must use the shipping methods tag.
New errors in the checkout and the cart
Show these errors in your templates, so the customer knows why the order can't be placed:
{global_error:out_of_stock}: a product is no longer in stock (with Check the stock on). See Checkout tag{global_error:shipping_method_missing}: the chosen shipping method is not offered for the cart{global_error:coupon_code}and{cart:coupon_code_error}: the coupon code gives no discount (anymore). See Cart tag{billing_country:error}and{shipping_country:error}: the country is not one of the Allowed countries{cart:error:out_of_stock}: a higher quantity in the cart is not in stock. See Cart tag
Pending payments
A customer whose payment is still pending (e.g. a bank transfer) returns to the order page instead of the homepage, and the cart is cleared. The default order.html template shows a message for pending orders; add one to your own order template as well.
Check your settings
Stacking discounts (Store Price Rule)
The Enable stacking discounts setting showed off by default while Store Price Rule stacked its rules until the setting was saved. The setting is stored as off now, so Store Price Rule only stacks rules when the setting is on. If you use Store Price Rule, never saved this setting and want the rules to stack, turn it on.
PDF documents
The invoice, the order confirmation and the packing slip are built on the new PDF layouts page. Until you save a layout, the PDFs look like before, with these differences:
- The Invoice footer, Order footer and Packing slip footer settings moved to a text block in the footer of the layout. A new line in a footer without HTML of its own is a line break in the PDF now. In the text blocks
{shipping_method}is the name of the carrier, before it was the add-on that handled the shipping. - The totals show the tax per rate with the amount it is calculated over, and the shipping excl. tax. Before, the shipping incl. tax was added to the subtotal excl. tax, so the rows didn't add up to the total. The total itself doesn't change.
- The page has its own permission. Roles that could change the footers on the Settings page need the PDF layouts permission on the Permissions page; until then only a Super Admin can change the layouts.
Renamed and removed settings
- The Can order on low stock channel setting is renamed to Check the stock. The setting itself doesn't change. See Inventory settings
- The unused Update stock when cancelled setting is removed, the stock is always added back.
- The Tax Type option No Tax is removed. Existing settings are changed to Exclusive, so the prices stay the same. To charge no tax at all, turn off the new Calculate tax setting.
- The separate export page with a start and end date is gone. Use the date filter on the order overview and the Export menu. See Control Panel
- The Permissions page in the CP is for Super Admins only.
After the update
- Run Sync stats once: the stats now use the days of the site's timezone instead of UTC. See Control Panel
- Clear your template caches: a form with product modifiers rendered before the update refuses the modifiers until the page is reloaded.
- The notify URLs you configured at your payment providers keep working. The CP shows the new and the old notify URL of a gateway. See Installation
For developers
When you have your own add-on or custom code that uses the Store:
- Every action has its own action URL (
?ACT=<id>) instead of?ACT=<id>&method=<action>. The old URLs keep working. - The tables are created by migrations, and the actions and hooks are registered by ExpressionEngine. The unused
cp_js_endhook andtestaction are removed. - When a webhook completes an order, the
reinos_store_checkout_endandreinos_store_payment_endhooks are called (before, this only happened when the customer returned to the site). They are called once per order and can run without the customer's session. See Hooks reinos_store_order_createdis called once for every new order, also for an order created in the CP, and its second argument is the ID of the order instead of the next order ID. See Hooksreinos_store_format_shipping_statusgets a$format(htmlortext). See Hooksreinos_store_shipping_tax_calculationgets the cart or order the shipping is for as a third argument.reinos_store_cart_items_startruns once, when the cart is calculated, instead of on every cart tag of a page.- The delete_cart_item tag calls the
reinos_store_cart_item_update_startandreinos_store_cart_item_update_endhooks, like setting the quantity to 0 in the cart. - The sort direction of the orders tag is the
sortparam. The oldorderparam still works. See Orders tag
