Coder Social home page Coder Social logo

grouporder's Introduction

Group Order

This Module allow you to create group orders

Installation

Manually

  • Copy the module into <thelia_root>/local/modules/ directory and be sure that the name of the module is GroupOrder.
  • Activate it in your thelia administration panel

Composer

Add it in your main thelia composer.json file

composer require thelia/group-order-module:~0.0.1

Usage

During register or in back office you have the possibility to create Main Customers. A main customer can create sub-customers and can fill the cart of the sub-customer.

A sub-customer can connect via the login and password set by the main customer, they have restricted right, they can add items to their cart and once they decide to validate their cart, the cart is sent to the cart of the main-customer.

Hook

Front

  • register.form-bottom is used to add the main customer checkbox on the register page
  • account.additional and account.javascript-initialization is used to add the new panel allowing a main customer to create sub customers
  • main.footer-bottom, main.stylesheet and main.javascript-initialization is used to display the sticky window for main customers
  • login.main-bottom is used to add the login form for sub customers connections

Back

  • customer.edit-js is used to add the main customer checkbox on the customer edit page

Loop

[group_order_sub_customer]

Input arguments

Argument Description
id id of a sub customer
main_customer id of the main customer
login login of a sub customer

Output arguments

Variable Description
$ID id of the sub customer
$MAIN_CUSTOMER_ID id of the main customer
$FIRSTNAME first name of the sub customer
$LASTNAME last name of the sub customer
$EMAIL email of the sub customer
$ADDRESS1 address of the sub customer
$ADDRESS2 address2 of the sub customer
$ADDRESS3 address3 of the sub customer
$CITY city of the sub customer
$ZIPCODE zip code of the sub customer
$COUNTRY_ID id of the country
$LOGIN login of the sub customer

Exemple

<ul>
    {loop type="group_order_sub_customer" name="my_group_order_sub_customer_loop" main_customer=$mainCustomerId}
        <li>{$FIRSTNAME} {$LASTNAME}</li>
    {/loop}
</ul>

[group_order_main_customer]

Input arguments

Argument Description
id id of a main customer
sub_customer_id id of a sub customer linked to a main customer
customer_id id of a customer linked to a main customer
active if the main customer is active or not

Output arguments

Variable Description
$ID id of the main customer
$CUSTOMER_ID id of the customer linked to this main customer

Exemple

{loop type="group_order_main_customer" name="main_customer_loop" customer_id=$customer_id active=true}
    {assign "isMainCustomer" 1}
{/loop}

[group_order_sub_order]

Input arguments

Argument Description
id id of a sub order
sub_customer id of a sub customer
group_order id of the main order

Output arguments

Variable Description
$ID id of the sub order
$SUB_CUSTOMER_ID id of the sub customer
$GROUP_ORDER_ID id of the main order
$PRODUCT_IDS ids of the product of this sub order
$ORDER_NUMBER Ref of the main order
$DATE Creation date
$AMOUNT total price of this sub order

Example

Add a complete exemple of your loop

Smarty plugin

groupOrderSubCustomerName

Input arguments

Argument Description
item_id id of a cart item
order_product_id id of an order product

Output arguments

Variable Description
$subCustomerName first name and last name of a sub customer

grouporder's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.