Download the PHP package mothership-ec/cog-mothership-commerce without Composer

On this page you can find all versions of the php package mothership-ec/cog-mothership-commerce. 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 cog-mothership-commerce

Mothership Commerce

The Message\Mothership\Commerce Cogule provides base commerce functionality for Mothership. This forms part of the building blocks for both ECommerce and EPOS.

Installation

Install this package using Composer. The package name is message/cog-mothership-commerce.

You will need to add Message's private package server to the repositories key in composer.json:

{
    "repositories": [
        {
            "type": "composer",
            "url" : "http://packages.message.co.uk"
        }
    ],
    "require": {
        "message/cog-mothership-commerce": "~4.1"
    }
}

Product

A Product object represents a certain product. They provide attributes such as the category and brand as well a prices. Units allow Variants on Products such as "size" and "colour". For this reason, it is usually desirable to use Units over Products when displaying prices to users.

If no prices are provided on a Unit, it will default to the Product prices.

Product\Types

Each product has a Type associated to it. The main use of a Type is to allow different information to be required by different products. For example a MusicProductType requires an Artist to be provided. Types also allow the "display name" to be set into to a different format.

Types provided for use within the admin panel are set in the IoC as the service product.types. Only types registered in the service container may be used when creating products.

Product\Price

The product Pricing object is a group of prices (float) mapped against Currency and Locale. Product and Unit objects have a Pricing object which they use when calling getPrice(), getNetPrice() etc. This object does the legwork of getting the correct price to display based on currency and locale.

Product\Tax

Product taxes are loaded onto the product using an instance of TaxResolverInterface. Net and Gross prices are calculated using these tax rates and an instance of TaxStrategyInterface.

TaxResolver

The TaxResolverInterface is an interface for a class that will take a token and an Address and return a TaxCollection containing all the applicable tax rates for that token/address combination. By default, the TaxResolver is used. This looks within the tax.yml file to resolve taxes.

TaxStrategy

Whilst it is possible to implement the interface to provide further tax strategies, realistically there are only two which will be used. These are Tax Inclusive and Tax Exclusive. These are provided within Commerce.

Product\Stock

General

Product\Stock is responsible for handling stock changes. Every stock change is documented as a stock adjustment(Product\Stock\Movement\Adjustment\Adjustment). Stock adjustments created within the same action(creating a new order/ adjusting stock levels in one request) are surrounded by a stock movement(Product\Stock\Movement\Movement), to give them a reason, authorship, etc.

Stock Manager

The stock manager Product\Stock\StockManager is responsible for creating and saving new stock movements (and adjustments). Please read the detailed readme of Product\Stock for more information!

Movement Iterator

Also there is an Iterator for stock movements, which allows you to iterate over the stock history and get the stock level at any time before or after a movement. Please read the detailed readme of Product\Stock for more information!

Product Page Mapper

The commerce package ships with two implementations of the product page mapper: SimpleMapper and OptionCriteriaMapper. By default the SimpleMapper is aliased to product.page_mapper.

Configuration

To enable the mapper to correctly relate products to pages you must set the valid values for product_content.field_name and product_content.group_name for product pages. Additionally you should set the valid page types. You can change these using:

These default to:

Simple Mapper

The simple mapper just matches a basic product to a page.

Usage

Option Criteria Mapper

The option criteria mapper can additionally apply a filter for a specific product option, for example ['colour' => 'red']. You can pass any number of options: ['colour' => 'red', 'size' => 'medium'].

To enable the option criteria mapper you must alias it to the page mapper in your services:

Usage

In addition to the previous methods, you can also call:

Custom Mappers

When writing a custom mapper you should extend AbstractMapper to ensure compatibility.

Filters

You can optionally pass in filter callbacks that are applied after the results are pulled from the database. Returning false from the callback will remove the object from the results.

Usage

License

Mothership E-Commerce Copyright (C) 2015 Jamie Freeman

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.


All versions of cog-mothership-commerce with dependencies

PHP Build Version
Package Version
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 mothership-ec/cog-mothership-commerce contains the following files

Loading the files please wait ....