List of Custom Hooks

From NeuCart Documentation
Jump to: navigation, search

This page provides a list of custom hooks that are available in the system. Custom hooks exist to allow custom functionality of the NeuCart application without rewriting NeuCart-provided code; in short, these hooks allow stores to provide their own code to meet their individual needs. Custom hooks are, by default, upgradeable to newer versions because the files do not get overwritten during upgrades.

Source code project 1171.svg
This article discusses
a custom hook that is
provided by the system.
Binary-icon.png
This article discusses a
technical topic that may not be
intended for all readers.

List

Shipping

There are three different custom shipping files. Only one of these would apply to any single store.

custom_ship.php
This is the most frequently-used custom hook. This file includes only one function, do_custom_shipping(). Store owners use this custom hook to provide their own shipping rates.
custom_ship_adjust.php
This file includes three functions — do_ship_pp_adjustments(), do_ship_sd_adjustments(), do_ship_customer_chooses_adjustments() — but only one of these would be used in a single store. The purpose for these functions is to adjust the calculated shipping rate; as an example, a store may use this hook to prevent shipping from going over a certain value.
custom_shipping_types.php
This file includes one function, alter_shipping_type_list(). This hook is used when the shipping behavior is configured as "customer chooses". This function allows a store owner to modify the list of shipping choices before the list is presented to the customer.
custom_delivery_charge.php
This file includes one function, do_custom_delivery_calc(). Like the Custom Shipping Adjustments file, this file would be used to alter the delivery charge after its initial calculation.

Checkout

custom_cart_validation.php
This file includes one function, check_cart_validity(). This function is used during checkout to enforce store-specific rules about what makes the cart valid or invalid. One store uses this feature to ensure that a very large product cannot be shipped internationally.
custom_tax.php
This file is used to provide store-specific tax calculations.

Discounts and Payments

custom_discounts.php
This file includes only one function, add_auto_discount(), and its purpose is to apply discounts to an order automatically (without user interaction), based on store-specific criteria. This function is used only in Standard Checkout Mode.
custom_spc_discounts.php
This file is also used to add discounts to an order automatically, but it is used in Single-Page Checkout mode. The three functions in this file, spc_disc_initial(), spc_disc_after_q_change(), and spc_disc_after_lock_address(), are called during different events of the Single-Page Checkout process.
custom_payments.php
This file allows a store owner to present additional payment methods to a customer. To date, there is no known usage of this hook.

Digital Files

custom_watermark.php
This file includes only one function, add_custom_watermark(). The purpose of this code is to add to the PDF Watermark process. By default, watermarks can include the customer name and order ID. This function allows additional parameters to be added to the watermark.

Email

custom_email.php
This file includes only one function, configure_email_params(), and its purpose is to allow a store to add server-specific parameters to an email object. This functionality is necessary for servers that have specific SMTP parameters or other security precautions for sending emails.
custom_store_notify.php
This file includes only one function, custom_store_notification(), and it is used to send emails to different people based on store-specific rules.

Customer Experience

custom_js.js
The only custom javascript file, this is called from the document.ready function of the application. The functions in this file are used when the store has a non-standard customer experience.

See also

Technical topics

Need a question answered about the List of Custom Hooks article? Want to offer a suggestion or correction? Click here to discuss this page.