Examples

Below are a couple of examples to quick start with the Maps module

Add to Cart example

{exp:channel:entries channel="products"}
    <div class="col-sm">
        <div class="card" style="width: 18rem;">
            <img class="card-img-top" src="http://via.placeholder.com/640x360" alt="Card image cap">
            <div class="card-body">
                <h5 class="card-title">{title} - {exp:reinos_mollie:format}{product_price}{/exp:reinos_mollie:format}</h5>
                <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
                {exp:reinos_mollie:add_to_cart
                    entry_id="{entry_id}"
                    sku="{entry_id}"
                    product_name="{title}"
                    product_price="{product_price}"
                    disable_shipping="{product_disable_shipping}"
                    return_url="store/index"
                    custom_fields:your_custom_field="a custom field value for your options for example"
                    custom_fields:another_custom_field="a custom field value for your options for example"
                }
                    <div class="row">
                        <div class="col-12 col-md-6">
                            <div class="input-wrapper">
                                <label for="qty">Aantal</label>
                                <input class="form-control" type="number" id="qty" name="qty" value="1"/><br>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-12 col-md-6">
                            <div class="input-wrapper">
                                <input type="submit" class="btn btn-primary" value="Bestel"/>
                            </div>
                        </div>
                    </div>
                {/exp:reinos_mollie:add_to_cart}
            </div>
        </div>
    </div>
{/exp:channel:entries}

Cart example

{exp:reinos_mollie:cart prefix="cart:" can_update="yes"}
    <h3>Cart</h3>
    {if cart:no_items}
        <p>No cart items</p>
    {if:else}
        <table class="table mt-4 mb-4">
            <thead>
                <tr><th class="text-left">Omschrijving</th><th></th><th class="text-left">Prijs</th></tr>
            </thead>
            <tbody>

                    {cart:items}
                        {exp:channel:entries entry_id="{cart:entry_id}"dynamic="no"}
                            <tr>
                                <td>
                                    <a href="{page_uri}">{title}</a> <small>sku: {cart:sku}</small>
                                    {cart:custom_fields}<br><strong>{custom_fields:label}:</strong> {custom_fields:value}{/cart:custom_fields}
                                </td>
                                <td class="text-right"><input type="number" value="{cart:qty}" name="qty[{items:sku}]"></td>
                                <td>{cart:price_total_plus_tax}</td>
                            </tr>
                        {/exp:channel:entries}
                    {/cart:items}

                    <tr><td></td><td class="text-right"><strong>Subtotaal</strong></td><td>{cart:subtotal_plus_tax}</td></tr>
                    <tr><td></td><td class="text-right"><strong>BTW</strong></td><td>{cart:tax}</td></tr>
                    {if items:shipping_plus_tax != '€0,00'}<tr><td class="text-right"><strong>Verzending</strong></td><td></td><td>{cart:shipping_plus_tax}</td></tr>{/if}
                    <tr><td></td><td class="text-right"><strong>Totaal</strong></td><td>{cart:total_plus_tax}</td></tr>
            </tbody>
        </table>
        <input type="submit" name="update" value="Update" class="btn btn-primary"/>
        <input type="submit" name="clear" value="Clear cart" class="btn btn-primary"/>
        <a class="btn btn-success" href="#">Afrekenen</a>
    {/if}
{/exp:reinos_mollie:cart}

Order example

<h3 class="mb-4">Your personal data</h3>
{exp:reinos_mollie:checkout
    return_url="store/order"
}
    {if has_field_errors}<div class="text-red"><strong>Not all your fields are filled in.</strong></div>{/if}
    {if has_global_errors}<div class="text-red"><strong>{global_error}</strong></div>{/if}

    <div class="row">
        <div class="col-sm">
            <div class="input-wrapper">
                <label for="customer_first_name">Firstname</label>
                {if customer_first_name:error != ''}<span class="text-red">{customer_first_name:error}</span>{/if}
                <input type="text" class="form-control" id="customer_first_name" name="customer_first_name" value="{customer_first_name:value}" >
            </div>
            <div class="input-wrapper">
                <label for="customer_last_name">Lastname</label>
                {if customer_last_name:error != ''}<span class="text-red">{customer_last_name:error}</span>{/if}
                <input type="text" class="form-control" id="customer_last_name" name="customer_last_name" value="{customer_last_name:value}">
            </div>
            <div class="input-wrapper">
                <label for="customer_email">Email address</label>
                {if customer_email:error != ''}<span class="text-red">{customer_email:error}</span>{/if}
                <input type="email" class="form-control" id="customer_email" name="customer_email" value="{customer_email:value}">
            </div>
            <div class="input-wrapper">
                <label for="customer_phone">Phone</label>
                {if customer_phone:error != ''}<span class="text-red">{customer_phone:error}</span>{/if}
                <input type="text" class="form-control" id="customer_phone" name="customer_phone" value="{customer_phone:value}">
            </div>
            <div class="input-wrapper">
                <label for="customer_company">Company</label>
                {if customer_company:error != ''}<span class="text-red">{customer_company:error}</span>{/if}
                <input type="text" class="form-control" id="customer_company" name="customer_company" value="{customer_company:value}">
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm">
            <h3 class="mb-4">Billing address</h3>
            <div class="input-wrapper">
                <label for="billing_address">Address</label>
                {if billing_address:error != ''}<span class="text-red">{billing_address:error}</span>{/if}
                <input type="text" class="form-control" id="billing_address" name="billing_address" value="{billing_address:value}">
            </div>
            <div class="input-wrapper">
                <label for="billing_address">Address 2</label>
                {if billing_address2:error != ''}<span class="text-red">{billing_address2:error}</span>{/if}
                <input type="text" class="form-control" id="billing_address2" name="billing_address2" value="{billing_address2:value}">
            </div>
            <div class="input-wrapper">
                <label for="billing_zip">Zipcode</label>
                {if billing_zip:error != ''}<span class="text-red">{billing_zip:error}</span>{/if}
                <input type="text" class="form-control" id="billing_zip" name="billing_zip" value="{billing_zip:value}">
            </div>
            <div class="input-wrapper">
                <label for="billing_city">City</label>
                {if billing_city:error != ''}<span class="text-red">{billing_city:error}</span>{/if}
                <input type="text" class="form-control" id="billing_city" name="billing_city" value="{billing_city:value}">
            </div>
            <div class="input-wrapper">
                <label for="billing_country">Country</label>
                {if billing_country:error != ''}<span class="text-red">{billing_country:error}</span>{/if}
                {exp:reinos_mollie:country_list type="billing" class="form-control" value="{billing_country:value}"}
            </div>
        </div>
        <div class="col-sm">
            <h3 class="mb-4">Shipping address</h3>
            <div class="input-wrapper">
                <input type="checkbox" value="1" checked id="billing_same_as_shipping" name="billing_same_as_shipping">
                <label for="billing_same_as_shipping">Shipping is the samee as billing</label>
            </div>
            <div id="shipping_address_wrapper" style="display: none;">
                <div class="input-wrapper">
                    <label for="shipping_address">Address</label>
                    {if shipping_address:error != ''}<span class="text-red">{shipping_address:error}</span>{/if}
                    <input type="text" class="form-control" id="shipping_address" name="shipping_address" value="{shipping_address:value}">
                </div>
                <div class="input-wrapper">
                    <label for="shipping_address">Address 2</label>
                    {if shipping_address2:error != ''}<span class="text-red">{shipping_address2:error}</span>{/if}
                    <input type="text" class="form-control" id="shipping_address2" name="shipping_address2" value="{shipping_address2:value}">
                </div>
                <div class="input-wrapper">
                    <label for="shipping_zip">ZipCode</label>
                    {if shipping_zip:error != ''}<span class="text-red">{shipping_zip:error}</span>{/if}
                    <input type="text" class="form-control" id="shipping_zip" name="shipping_zip" value="{shipping_zip:value}">
                </div>
                <div class="input-wrapper">
                    <label for="shipping_city">City</label>
                    {if shipping_city:error != ''}<span class="text-red">{shipping_city:error}</span>{/if}
                    <input type="text" class="form-control" id="shipping_city" name="shipping_city" value="{shipping_city:value}">
                </div>
                <div class="input-wrapper">
                    <label for="shipping_country">Country</label>
                    {if shipping_country:error != ''}<span class="text-red">{shipping_country:error}</span>{/if}
                    {exp:reinos_mollie:country_list type="shipping" class="form-control" value="{shipping_city:value}"}
                </div>
            </div>
        </div>
    </div>

    <button type="submit" class="btn btn-primary">Checkout</button>

    <script>
        $(function(){
            $('#billing_same_as_shipping').change(function(){
                if($(this).is(':checked')) {
                    $('#shipping_address_wrapper').hide();
                } else {
                    $('#shipping_address_wrapper').show();
                }
            });
        });
    </script>
{/exp:reinos_mollie:checkout}

Order example

<div class="container">
    <div class="row">
        <div class="col-sm">
            {exp:reinos_mollie:order hash="{segment_3}"}
                {if no_results}
                    No order found
                {/if}

                {if order:status == 'open' }
                    <div class="alert alert-warning" role="alert">
                        Your order is not yet payed, finish your order by clicking <a href="{order:payment_url}">here</a>.
                    </div>
                {/if}

                <div class="row color-invoice">
                    <div class="col-md-12">
                        <div class="row">
                            <div class="col-sm-7">
                                <h4>Order</h4>
                                <b>Order ID:</b> #{order:order_id}  <br>
                                <b>Order Date:</b> {order:time format="%d %M %Y"}<br>
                                <b>Transaction ID: </b> {order:transaction_id} <br>
                                <b>Status: </b> {order:status}

                                <br>
                                <br>
                                <h4>Your personal data</h4>
                                {if order:customer_company}{order:customer_company}<br>{/if}
                                {order:customer_first_name} {order:customer_last_name}<br>
                                {order:customer_email}<br>
                                {order:customer_phone} <br><br>

                            </div>
                            <div class="col-sm-5">
                                <strong>Custom Company</strong><br>
                                Custom street 6
                                <br>8985 KO Your-city
                                <br>2589-8987588
                                <br>info@customcompany.com

                                <br>

                            </div>
                        </div>
                        <hr/>
                        <div class="row">
                            <div class="col-sm-7">
                                <br>
                                <h4>Billing address</h4>
                                {order:billing_address} {order:billing_address2}<br>
                                {order:billing_zip}, {order:billing_city}<br>
                                {exp:reinos_mollie:country}{order:billing_country}{/exp:reinos_mollie:country}<br>
                                <br>
                            </div>
                            <div class="col-sm-5">
                                <br>
                                <h4>Shipping address</h4>
                                {order:shipping_address} {order:shipping_address2}<br>
                                {order:shipping_zip}, {order:shipping_city}<br>
                                {exp:reinos_mollie:country}{order:shipping_country}{/exp:reinos_mollie:country}<br>
                                <br>
                            </div>
                        </div>

                        <hr/>
                        <div class="row">
                            <div class="col-lg-12 col-md-12 col-sm-12">
                                <div class="table-responsive">
                                    <table class="table table-striped">
                                        <thead>
                                        <tr>
                                            <th width="55%">Item</th>
                                            <th class="text-center" width="15%">Aantal</th>

                                            <th class="text-center" width="15%">BTW</th>

                                            <th class="text-right" width="15%">Prijs</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {order:items}
                                            <tr>
                                                <td>
                                                    {order:items:name}
                                                    {order:items:custom_fields}<br><strong>{custom_fields:label}:</strong> {custom_fields:value}{/order:items:custom_fields}
                                                </td>
                                                <td class="text-center">
                                                    {order:items:qty}                                                  
                                                </td>

                                                <td class="text-center">
                                                    {order:items:price_plus_tax}
                                                </td>

                                                <td class="text-right">
                                                    {order:items:price_total_plus_tax}
                                                </td>
                                            </tr>
                                        {/order:items}
                                        </tbody>
                                    </table>
                                </div>

                                <div>
                                    <table class="table borderless">

                                        <tr>
                                            <td class="text-right"><b>Subtotaal: {order:subtotal_plus_tax} </b></td>
                                        </tr>

                                        <tr>
                                            <td class="text-right"><b>Verzendkosten: {order:shipping_plus_tax} </b></td>
                                        </tr>

                                        <tr>
                                            <td class="text-right"><b>BTW: {order:tax} </b></td>
                                        </tr>

                                        <tr>
                                            <td class="text-right"><b>Totaal: {order:total_plus_tax} </b></td>
                                        </tr>
                                    </table>
                                </div>
                                <hr>
                            </div>
                        </div>
                    </div>
                </div>

            {/exp:reinos_mollie:order}

        </div>
    </div>
</div>