Download the PHP package tigron/skeleton-package-delivery without Composer
On this page you can find all versions of the php package tigron/skeleton-package-delivery. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download tigron/skeleton-package-delivery
More information about tigron/skeleton-package-delivery
Files in tigron/skeleton-package-delivery
Download tigron/skeleton-package-delivery
More information about tigron/skeleton-package-delivery
Files in tigron/skeleton-package-delivery
Vendor tigron
Package skeleton-package-delivery
Short Description Tigron Skeleton Delivery functionality
License MIT
Package skeleton-package-delivery
Short Description Tigron Skeleton Delivery functionality
License MIT
Please rate this library. Is it a good library?
Informations about the package skeleton-package-delivery
skeleton-package-delivery
Description
Gives delivery functionality of products in Skeleton
Installation
Installation via composer:
composer require tigron/skeleton-package-delivery
Howto
Create a module in your application that extends from Skeleton\Package\Web\Module\Crud
<?php
/**
* Module Crud
*
* @author Christophe Gosiau <[email protected]>
* @author Gerry Demaret <[email protected]>
* @author David Vandemaele <[email protected]>
*/
use Skeleton\Package\Web\Module\Delivery
class Web_Module_Deliver extends Delivery {
/**
* The template
*
* @access public
*/
public $template = 'delivery.twig';
}
Create a template for your module that injects the generated templates into your layout
{% extends "_default/layout.base.twig" %}
{% block header_js %}
{% embed "@skeleton-package-crud/javascript.twig" %}{% endembed %}
{% endblock header_js %}
{% block header_css %}
{% embed "@skeleton-package-crud/css.twig" %}{% endembed %}
{% endblock header_css %}
{% block content %}
{% embed "@skeleton-package-crud/content.twig" %}{% endembed %}
{% endblock content %}
Create a route in your application Config.php
/**
* Routes
*/
'routes' => [
'web_module_deliver' => [
'$language/deliver'
],
]
Now make sure you implement the following classes:
Deliverable
<?php
/**
* Deliverable interface
*
*
* @author Gerry Demaret <[email protected]>
* @author Christophe Gosiau <[email protected]>
* @author David Vandemaele <[email protected]>
*/
namespace Skeleton\Package;
interface Deliverable {
/**
* Get name
*
* @access public
* @return string $name
*/
public function get_name();
/**
* Get weight
*
* @access public
* @return double $weight (in kg)
*/
public function get_weight();
}
Delivery\Recipient
<?php
/**
* Recipient interface
*
*
* @author Gerry Demaret <[email protected]>
* @author Christophe Gosiau <[email protected]>
* @author David Vandemaele <[email protected]>
*/
namespace Skeleton\Package\Delivery;
interface Recipient {
/**
* Get firstname
*
* @access public
* @return string $firstname
*/
public function get_firstname();
/**
* Get lastname
*
* @access public
* @return string $lastname
*/
public function get_lastname();
/**
* Get company
*
* @access public
* @return string $company
*/
public function get_company();
/**
* Get street
*
* @access public
* @return string $street
*/
public function get_street();
/**
* Get housenumber
*
* @access public
* @return string $housenumber
*/
public function get_housenumber();
/**
* Get zipcode
*
* @access public
* @return string $zipcode
*/
public function get_zipcode();
/**
* Get city
*
* @access public
* @return string $city
*/
public function get_city();
/**
* Get country
*
* @access public
* @return Country $country
*/
public function get_country();
/**
* Get phone
*
* @access public
* @return string $phone
*/
public function get_phone();
/**
* Get fax
*
* @access public
* @return string $fax
*/
public function get_fax();
/**
* Get vat
*
* @access public
* @return string $vat
*/
public function get_vat();
/**
* Get email
*
* @access public
* @return string $email
*/
public function get_email();
}
Courier
<?php
/**
* Shipping method interface
*
* @author Christophe Gosiau <[email protected]>
* @author Gerry Demaret <[email protected]>
* @author David Vandemaele <[email protected]>
*/
namespace Skeleton\Package;
interface Courier {
/**
* Get name
*
* @abstract
* @access public
* @param Basket $basket
* @return string $name
*/
public function get_name();
/**
* Validate shipment
*
* @access public
* @param Shipment $shipment
* @return array $errors
*/
public function validate_shipment(\Skeleton\Package\Shipment $shipment);
/**
* Handle a shipment
*
* @access public
* @param \Skeleton\Package\Shipment $shipment
*/
public function handle(\Skeleton\Package\Shipment $shipment);
/**
* Is traceable
*
* @access public
* @return bool $traceable
*/
public function is_traceable();
/**
* Trace
*
* @access public
* @return array $trace
*/
public function trace(\Skeleton\Package\Delivery\Shipment $shipment);
/**
* Has label
*
* @access public
* @return bool $has_label
*/
public function has_label();
/**
* Get label
*
* @access public
* @return File $label
*/
public function get_label(\Skeleton\Package\Delivery\Shipment $shipment);
}
Now start creating deliveries:
$delivery = new \Skeleton\Package\Delivery();
$delivery->set_trigger($my_class);
$delivery->set_delivery_recipient($my_shipping_address); // Delivery Recipient
$delivery->set_courier($this->shipping_method->shipping_method_courier); // Courier
$delivery->save();
foreach ($this->get_order_items() as $order_item) {
$delivery->add_deliverable($order_item->product); // Deliverable
}All versions of skeleton-package-delivery with dependencies
PHP Build Version
Package Version
Requires
bower-asset/bootstrap Version
5.1.*
bower-asset/tigron-confirm-modal Version *
tigron/skeleton-package-crud Version *
bower-asset/tigron-confirm-modal Version *
tigron/skeleton-package-crud Version *
The package tigron/skeleton-package-delivery contains the following files
Loading the files please wait ...