furbo / rentman-for-craft
Automatically Import Rentman Products to Craft. Let visitors create orders. Orders are automatically send to rentman as a project request.
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:craft-plugin
Requires
- php: >=8.0.2
- craftcms/cms: ^4.2.0
- dompdf/dompdf: ^2.0
- guzzlehttp/guzzle: ^7.5
- nesbot/carbon: ^2.66
Requires (Dev)
- craftcms/ecs: dev-main
README
Rentman for Craft
Automatically import Rentman products to Craft. It lets visitors create orders. Orders are automatically sent to Rentman as project requests.
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
- Go to Settings > Plugins > Rentman for Craft > Main settings
- Add the API URL, usually
https://api.rentman.net/
- Add the API Key, more infos here: https://support.rentman.io/hc/en-us/articles/360013767839-The-Rentman-API
- 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 - Choose the templates and urls for products, categories and projects
- 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.