Download the PHP package thelia/predict-module without Composer

On this page you can find all versions of the php package thelia/predict-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package predict-module

Predict

Predict by DPD module ~2.1.0 Works with Thelia >= 2.5.2
If you want to use it with Thelia <= 2.5.2 see Predict ~2.0.0

Installation

Usage

Before using this module you first need to configure your DPD account number, and optionally your cellphone number and check if you have the Predict SMS option. Don't forget to assign the shipping zones to the Predict module and to configure your store's address, it's necessary in order to use this module.

The loops

The Predict module brings you three loops:

Check if the Config folder and the prices.json file are readable and writable

Get every order which are paid and not sent and has Predict as delivery module

Get the prices of a given area

Integration

Front-office: Flexy only (Thelia 3).

The Thelia 2 Smarty hooks order-delivery.stylesheet and order-delivery.extra no longer exist. Hook/PredictHook.php, templates/frontOffice/default/predict.html and its stylesheet were removed during the Thelia 3 migration: the hook had lost its config.xml registration and was never ported to getSubscribedHooks(), so those files had become unreachable — a Smarty theme silently lost the cellphone field at checkout.

The cellphone number is now handled by the theme, through two routes:

Route Purpose
GET /predict/cellphone/value {"cellphone": "…"} — session value, else the customer's default address
POST /predict/cellphone/save Stores the number in session

POST /predict/cellphone/save requires the Thelia CSRF token as _token, and rejects input that is not phone-shaped (digits, spaces, dots, dashes, brackets, optional leading +, 30 characters max). From a Flexy template, take the token from {{ assignToken() }}:

Routes rather than a module-provided Twig function on purpose: a theme template that calls a module function fails to compile when the module is disabled, taking the whole delivery step with it.

Restoring Smarty support would mean adding getSubscribedHooks() to a new front hook and bringing back the two template files — nothing else in the module depends on them.

Back-office

Rendered by the default-twig theme (templates/backOffice/default-twig/Predict/). Form and export errors are reported through the flash bag, which survives the redirect these actions end with — ParserContext does not, and is kept only for a Thelia 2 Smarty back-office.


All versions of predict-module with dependencies

PHP Build Version
Package Version
Requires thelia/installer Version ^1.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package thelia/predict-module contains the following files

Loading the files please wait ...