Linux 软件免费装
Banner图

Torod Saudi Commerce Tools for ZATCA

开发者 torod
更新时间 2026年11月26日 05:57
PHP版本: 7.4 及以上
WordPress版本: 7.2
版权: GPLv2 or later
版权网址: 版权信息

标签

otp cash on delivery zatca saudi arabia national address

下载

4.1.0

详情介绍:

Torod Saudi Commerce Tools for ZATCA (by Torod, the team behind the SA Commerce Pro service) gives WooCommerce stores in Saudi Arabia the local features shoppers expect, in Arabic and English, on the classic and the block checkout. Short National Address Saudi shoppers know their 8-character short address (for example RRRD2929) better than their full address. ZATCA Phase 1 QR code (free) Sign in with a code Cash on delivery: verify the mobile number Fewer refused cash-on-delivery parcels: before a cash-on-delivery order is placed, the shopper confirms their mobile number with an SMS code. Company VAT number (optional) For business customers: an optional "Company VAT number" field at checkout (classic and block) and in My Account. It checks the Saudi format (15 digits starting and ending with 3, Arabic digits accepted), can be required when a company name is entered (classic checkout), and is shown on the order, in emails and to invoice plugins (order meta _billing_vat_number). Off by default: turn it on under SA Commerce Pro › ZATCA QR code › Business customers. It stays off when another VAT plugin (EU VAT Number, EU VAT Assistant, Germanized Pro) already adds one. Phone-first checkout (optional) A checkout that starts with the mobile number and an SMS code; the email only if the customer wants one. Made for Saudi stores Free and paid features The short address field and the ZATCA QR code are free and work without an account. Address lookup and SMS codes use credits from an SA Commerce Pro plan: connect your store with the site key from your SA Commerce Pro dashboard (https://ext.torod.co › Store Integration). Email sign-in codes and the company VAT number field are free.

安装:

  1. Install and activate the plugin. WooCommerce must be active.
  2. Go to SA Commerce Pro in the admin menu.
  3. National Address: turn on the short address field (and, if you like, make it required).
  4. ZATCA QR code: enter your seller name and your 15-digit VAT number, then turn it on.
  5. Optional: under Store connection, paste the site key from your SA Commerce Pro dashboard (https://ext.torod.co › Store Integration) to turn on address lookup and SMS codes.
  6. Sign in with a code: choose the sign-in options and, if you take cash on delivery, the mobile number check.
  7. Checkout experience (optional): choose a checkout mode (mobile number first) and whether customers signed in with their mobile number must give an email.
  8. Optional: ZATCA QR code › Business customers adds a company VAT number field for B2B buyers.

屏幕截图:

  • The same on the Checkout block: the short address comes right after the name, before the fields it fills in.
  • Cash on delivery: the shopper confirms their mobile number with an SMS code before placing the order.
  • Sign in with a mobile number, an email code or a password.
  • The admin order screen: short address, cash-on-delivery result and the ZATCA QR code (Arabic admin).
  • Overview: connection, plan and features at a glance (Arabic, right-to-left).
  • Sign-in and cash-on-delivery settings, with the SMS balance and a number unlock.
  • ZATCA QR code settings with a live preview.

升级注意事项:

4.1.0 Sign-up only with a code is available under SA Commerce Pro › Sign in with a code. Your current sign-up stays as it is until you switch. 4.0.0 First WordPress.org release. Coming from the old "Saudi Commerce Pro" 3.x plugin: deactivate it when asked. Your site key is kept and saved short addresses are copied in the background.

常见问题:

Do I need an SA Commerce Pro account?

No. The short address field, the ZATCA QR code, email sign-in codes and the company VAT field work without one. An account is needed only for address lookup and SMS codes, which use credits.

Does the QR code make my store fully ZATCA compliant?

It covers the Phase 1 (generation phase) QR code on simplified tax invoices. Phase 2 (integration with ZATCA's FATOORAH platform) needs more steps and will be offered as a separate service.

Which orders get a QR code?

Paid orders (processing or completed) in Saudi riyals, paid on or after the "Add the QR to orders from" date, once you have entered your seller name and VAT number. The date is set to the day you first turn the QR code on; move it back to cover older orders. Stores that used the QR code before this setting existed keep it for all orders. An order that already has a QR always keeps it.

My invoice plugin or template doesn't show the QR code.

The QR is added automatically to "PDF Invoices & Packing Slips for WooCommerce" and "Print Invoice & Delivery Notes for WooCommerce". For any other invoice plugin or a custom template:

  • Shortcode: [sacp_zatca_qr] on the "Order received" or "View order" page, or [sacp_zatca_qr order_id="123"] elsewhere. Options: size="130" (pixels) and details="no" (QR only, without the invoice details). It shows only to staff who can edit orders, the order's own customer, or with the order key (key="…", or ?key= in the page address), so it never shows another customer's invoice.
  • PHP, in an invoice template: do_action( 'sacp_zatca_qr', $order, array( 'size' => 130, 'details' => true ) ); prints the same block (the template decides who sees the document). TorodCo\SACommercePro\Zatca\Zatca_Module::qr_data_uri( $order ) returns just the QR as a PNG data URI.
Both print nothing while the QR code is off or when the order doesn't get one (not paid, not in SAR, or before the "Add the QR to orders from" date). The admin order screen also has a "Download PNG" link.

Does it work with the block checkout?

Yes. The short address field, address lookup and the cash-on-delivery check work on the classic checkout and the Checkout block. The cash-on-delivery check also works on the "Pay for order" page. The phone-first checkout's mobile number step works on both; the optional or hidden email applies to the classic checkout only (the Checkout block always asks for an email).

My existing customers want to sign in with their mobile number. What happens?

For security, a mobile number signs in only after it is verified with a code. If the number is already saved as the billing phone of one customer account, the customer enters the SMS code and then a code sent to that account’s email, and the number is added to the account (SA Commerce Pro › Sign in with a code › “Customers whose number is already on an account”). You can choose “Password only” instead, or treat the number as new. A number saved on more than one account is never linked: those customers sign in with their email or password, then add the number in My Account › Account details.

What happens when my SMS credit runs out?

Sign-in by SMS pauses; customers can still sign in with email codes or their password. Cash-on-delivery orders go through marked "not verified". A daily SMS limit protects your credits; when it is reached, you choose whether cash-on-delivery orders go through or shoppers choose another payment method.

What does the phone-first checkout change for my store?

Nothing until you choose a mode under SA Commerce Pro › Checkout experience. With it on, signed-out shoppers see a mobile number step before the checkout form, and new customers get an account (mobile number, first and last name) when they enter the code. Customers who give no email keep a stand-in address on their orders that is never mailed; they can add a real email later in My Account. If WooCommerce deletes inactive accounts (Accounts & Privacy), accounts created at that step without an order can be deleted after that period.

Can staff sign in with a code?

No. Administrators, shop managers and editors always use their password.

Where is the short address stored?

On the order as _billing_sacp_short_address / _shipping_sacp_short_address, and on the customer as billing_sacp_short_address / shipping_sacp_short_address. Block checkout orders also keep WooCommerce's own field _wc_billing/sa-commerce-pro/short-address.

Does it work with page caching and script optimisers?

Yes. The sign-in page from the shortcode is never cached, and if a cached page holds an expired security token the plugin fetches a fresh one. Its scripts are marked so LiteSpeed, WP Rocket, Perfmatters and Cloudflare Rocket Loader don't delay them. When a setting changes what the sign-in forms show, the plugin clears the page cache of LiteSpeed, WP Rocket, W3 Total Cache, WP Super Cache, SiteGround, Breeze and WP Fastest Cache. After updating the plugin, purge your cache once if your optimiser removes version numbers from script URLs.

My store is behind a proxy or load balancer.

Visitors behind Cloudflare are recognised automatically. For another proxy, add its IP or range with the sacp_trusted_proxies filter, so rate limits count each visitor separately.

Which hooks can developers use?

Sign-in and sign-up:

  • sacp_signup_code_only (filter): keep WooCommerce's own register form on My Account (code-only off).
  • sacp_code_signup_registration_checks (filter): run WooCommerce's registration checks for accounts created after a code (default yes).
  • sacp_is_captcha_error (filter): which refusals count as CAPTCHA refusals (ignored after a verified code).
  • sacp_email_signup_per_hour (filter): store-wide cap on email sign-up codes per hour (default 60).
  • sacp_otp_limit_per_hour (filter): code requests per visitor per hour.
  • sacp_otp_login_roles, sacp_otp_can_login, sacp_otp_before_sign_in (filters): who may sign in with a code alone, and a last refusal for security plugins.
  • sacp_otp_tab_classes, sacp_primary_button_class (filters): reuse the theme's tab and button classes.
  • sacp_phone_linked, sacp_phone_unlinked (actions): a verified mobile number was added to or removed from an account.
  • sacp_cart_merge_notice (filter): turn off the "We added N items saved in your account" notice. Checkout and cash on delivery:
  • sacp_phone_checkout_enforce (filter): refuse signed-out orders that skipped the phone-first checkout's mobile step.
  • sacp_checkout_email_gateways (filter): payment methods that need a real email.
  • sacp_cod_payment_methods (filter): payment methods treated as cash on delivery.
  • sacp_allow_guest_without_cart (filter): let guests use paid features with an empty cart (custom sign-in pages). Address, ZATCA and connection:
  • sacp_lookup_limit_per_hour (filter): address lookups per visitor per hour.
  • sacp_zatca_qr_applies, sacp_zatca_email_image, sacp_zatca_unsupported_invoice_plugins (filters), sacp_zatca_qr (action and shortcode): the QR code on orders, emails and invoice templates.
  • sacp_trusted_proxies, sacp_cloudflare_ranges (filters): proxies whose forwarded visitor IP is trusted.
  • sacp_api_base_url, sacp_api_timeout, sacp_http_transport (filters): service address, timeout and transport (tests).
  • sacp_webhook_plan (action): the plan changed through a signed webhook.
  • sacp_purge_page_cache (action): fires when cached pages must be dropped; hook your page cache here if it isn't LiteSpeed, WP Rocket, W3 Total Cache, WP Super Cache, SiteGround, Breeze or WP Fastest Cache.
  • sacp_debug_log (filter): debug logging.

I copied my store to a staging site.

The connection belongs to the address it was made from. On a copy at another address (or another folder), address lookup and SMS codes stay off, so the copy never uses your credits or texts real customers. Connect the copy with its own site key to test them.

更新日志:

4.1.0 4.0.0