Once DyaPress UUID and DOLAPIKEY have been configured correctly as well as country of the activities you can really start using the plugin :
- For selling services or products online using OPC (One Page Checkout where registration and payment are made together) purchase form ;
- For registration form only.
In both case, if the user is not yet authentified on your website, its account creation is delayed until its mail is validated.
The country of activities need to be configured in order the VAT to be calculated correctly, VAT calculation are kept simple and only generic cases are taken into account, in you sell boat in europe for example, you will need to hook the appropriate action dyapress_premium_product_vat in order to change the VAT calculation according to product and thirdparty (thirdparty may not refer to a complete thirdparty but a partial one, having only a country and a VAT number). Please note DyaPress e-Commerce will check VAT Number automatically with VIES VAT Number validation from European commission and keep result in transient for 7 days.
In case a purchase form is used with Stripe, the payment is not yet captured when the user complete the form : you first need to accept the payment by capturing the fund, and this action can be done by two different approach :
- a manuel approach by checking the order(s) in DyaPress Premium > Orders and by applying the global action “Capture payment and prepare orders” on them ;
- an automatic approach by adding a callback function to dyapress_premium_process_order action which will call the dyapress_premium()->prepare_order() on it to capture fund, and once the contract is fullfilled, a call to dyapress_premium()->complete_order() to finalize the order and generate the invoice associated, this approach is used for selling tokens on this website.
The actual release of DyaPress e-Commerce does not handle yet delivery automatically (it is planned in a future version) so once your have prepared orders of products, you may need to prepare the delivery from the ERP (taking the stock of the right warehouse, maybe taking care of product batchs as well) and once you send the products (supposed your site is an online shop of physical product) then you can go back to your WordPress website in order to check the orders manually again in DyaPress Premium > Orders and to apply the global action “Complete orders and create invoices“.
Completing order will cause DyaPress Premium to send multiple request to your ERP so that :
- the order in the ERP is marked invoiced and closed
- an invoice is created from the order and validated
- a payment of the invoice is created if both payment type ID and payment account ID are not empty (You have defined them from the Stripe configuration)
In all cases, the ERP will be synced as for example no invoices are created by DyaPress e-Commerce plugin directly, but by the ERP you use behind.
How to sell products in DyaPress e-Commerce using OPC purchase form
You currently need to use a shortcode called dyapress_ecommerce_registration_purchase which accept the following options to choose products :
- products to get the list of product id separated by a “;”,
for example products=”AAA;BBB;CCC;DDD;EEE” to display a purchase form of the products AAA, BBB, CCC, DDD and EEE ; - products_quantity to define the quantity of products min and max for each product, where by default min is 1 and max is unlimited,
for example products_quantity=”EEE=30-;BBB=2;CCC=2-5;DDD=-10″ to have quantity form for BBB to 2 only, CCC to bet chosen between 2 and 5, DDD is up to 10 and EEE is at least 30 ; - products_label to choose a specific label in products table,
for example product_label=”AAA=Number of AAA product;BBB=BBB Count” to update products table label to “Number of AAA product” for product AAA and “BBB Count” for product BBB ; - products_post to link a post to each product according to post_id or post_name,
for example products_post=”AAA=12;CCC=product-ccc” to get a link to post 12 for product AAA and a link to post having post_name “product-ccc” for CCC ; - products_hidden to hide some products,
for example products_hidden=”BBB” to disable display of product BBB
A product id like AAA, BBB, CCC, DDD or EEE can be a comma “,” separated list of UUID:ID where UUID is a DyaPress UUID and ID a way to identify a product :
- an integer of no more than 11 digits which is the ID of the product in the connected ERP ;
- an integer of 12 or 13 digits which is the barcode of the product (an UPC or EAN13) in the connected ERP ;
- a string : the reference of the product in the connected ERP.
For example, here is the complete shortcode used for this website to sell DyaPress tokens which are using reference DYAPRESS_TOKEN in both TEST and LIVE DyaPress ERP/CRM :
[ dyapress_ecommerce_registration_purchase products_label=”DYAPRESS_TOKEN=Number of DyaPress Premium token to purchase” products_quantity=”DYAPRESS_TOKEN=30-” ]