Giter VIP home page Giter VIP logo

rentmanforcraft's Introduction

Rentman for Craft

Automatically import Rentman products to Craft. It lets visitors create orders. Orders are automatically sent to Rentman as project requests.

Screenshot Screenshot Screenshot Screenshot

Requirements

This plugin requires Craft CMS 4.2.0 or later, and PHP 8.0.2 or later.

Installation

You can install this plugin from the Plugin Store or with Composer.

From the Plugin Store

Go to the Plugin Store in your project’s Control Panel and search for “Rentman for Craft”. Then press “Install”.

With Composer

Open your terminal and run the following commands:

# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require furbo/rentman-for-craft

# tell Craft to install the plugin
./craft plugin/install rentman-for-craft

Craft Setup Example

  1. Go to Settings > Plugins > Rentman for Craft > Main settings
  2. Add the API URL, usually https://api.rentman.net/
  3. Add the API Key, more infos here: https://support.rentman.io/hc/en-us/articles/360013767839-The-Rentman-API
  4. Add a cron job that executes the php script httpdocs/craft rentman-for-craft/rentman/update-all (adapt the path to your installation) for example once a day
  5. Choose the templates and urls for products, categories and projects
  6. Click on the Customisation tab: here you can choose your own templates and settings for generated emails and pdfs

Code Examples

Get a single product

{% set product = craft.rentman.getProductById(2550) %}
{{product.displayname}}

Get products by category

<ul>
{% for product in craft.rentman.getProductsByCategory(3207) %}
    <li><a href="{{product.getUrl()}}">{{product.displayname}}</a></li>
{% endfor %}
</ul>

Get all products

<ul>
{% for product in craft.rentman.getAllProducts() %}
    <li><a href="{{product.getUrl()}}">{{product.displayname}}</a></li>
{% endfor %}
</ul>

Get main categories

<ul>
{% for mainCategory in craft.rentman.getCategories() %}
    <li><a href="{{mainCategory.getUrl()}}">{{mainCategory.displayname}}</a></li>
{% endfor %}
</ul>

Get categories first two levels

<ul>
{% for mainCategory in craft.rentman.getCategories() %}
    <li><a href="{{mainCategory.getUrl()}}">{{mainCategory.displayname}}</a></li>
    {% if mainCategory.hasChildren() %}
        <ul>
        {% for child in mainCategory.getChildren().all() %}
            <li><a href="{{child.getUrl()}}">{{child.displayname}}</a></li>
        {% endfor %}
        </ul>
    {% endif %}
{% endfor %}
</ul>

Get all categories in an array (recursive)

{% set categories = craft.rentman.getCategoriesRecursive(0) %}  

Print full categories tree

{{craft.rentman.printCategoryTree(true)|raw}}

Print full categories tree with active category

{{craft.rentman.printCategoryTree(true, 3162)|raw}}

Print partial categories tree with active category

{{craft.rentman.printCategoryTree(false, 3193)|raw}}

Complete twig pages - examples

JavaScript API

The Rentman Plugin for CraftCMS provides a JavaScript API to manage projects and perform associated actions. Here is a detailed guide on how to use this API.

Translations

You can copy the rentman-for-craft.php translations files from the plugin's translations folder to your site's translations folder and translate them there.

Support

If you have any issues with this plugin, please create an issue on GitHub or contact us at Furbo.

rentmanforcraft's People

Contributors

tonioseiler avatar paolocoppo avatar

Watchers

 avatar

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.