{"id":29020260,"url":"https://github.com/webdna/commerce-bundles","last_synced_at":"2025-06-26T01:05:02.795Z","repository":{"id":48135960,"uuid":"188987477","full_name":"webdna/commerce-bundles","owner":"webdna","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-04T12:19:24.000Z","size":325,"stargazers_count":3,"open_issues_count":4,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-21T14:48:10.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webdna.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-28T08:30:47.000Z","updated_at":"2022-06-10T11:09:22.000Z","dependencies_parsed_at":"2022-08-12T19:31:11.415Z","dependency_job_id":null,"html_url":"https://github.com/webdna/commerce-bundles","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/webdna/commerce-bundles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdna%2Fcommerce-bundles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdna%2Fcommerce-bundles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdna%2Fcommerce-bundles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdna%2Fcommerce-bundles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webdna","download_url":"https://codeload.github.com/webdna/commerce-bundles/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdna%2Fcommerce-bundles/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261978912,"owners_count":23239417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-26T01:04:57.864Z","updated_at":"2025-06-26T01:05:02.727Z","avatar_url":"https://github.com/webdna.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bundles plugin for Craft CMS 3.x\n\nCreate a bundle purchasable of existing commerce products.\n\n## Requirements\n\nThis plugin requires Craft CMS 3.0.0-beta.23 or later.\n\n## Installation\n\nTo install the plugin, follow these instructions.\n\n1. Open your terminal and go to your Craft project:\n\n        cd /path/to/project\n\n2. Then tell Composer to load the plugin:\n\n        composer require webdna/commerce-bundles\n\n3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Bundles.\n\n## Bundles Overview\n\nBundles allows you to create a bundle containing a combination of different products (or a single product with multiple quantities). Set an overall price for the bundle, giving you the option to offer a discount or promotion (for example 3 for 2).\n\n## Configuring Bundles\n\n**Bundle Types**\n\nBundle Types is where you can define the template and URL for bundle. You can add any custom fields to your bundle types.\n\n![Screenshot](resources/screenshots/bundle-types.png)\n\n![Screenshot](resources/screenshots/bundle-type-fields.png)\n\n**Bundles**\n\nHere is where you setup your Bundle, select the products and quantities of the product that make up the Bundle. Similar to Commerce Products add an SKU and price for the Bundle.\n\n![Screenshot](resources/screenshots/bundle.png)\n\n## Using Bundles\n\nYou can access your bundles from your templates using a bundle query:\n\n```twig\n{% set myBundleQuery = craft.bundles() %}\n```\n\nWhen you access a bundle directly via it's URL the `bundle` variable is available.\n\n***\n\n**Available Methods**\n\nOnce you have your bundle there are methods for accessing the bundles products and quanities, and for checking stock.\n\n*Products*\n\n```twig\n{# Returns an array of the bundles products (Commerce Variant object) #}\n\nbundle.getProducts()\n```\n\n*Quantities*\n\n```twig\n{# Returns an array of quantites with the key set to the variantId #}\n\nbundle.getQtys()\n```\n\n*Stock*\n\n```twig\n{# checks to see if all the products in the bundle have stock #}\n\nbundle.hasStock()\n```\n***\n\n**Fields**\n\nBundles also includes a *Bundles* field type.\n\n![Screenshot](resources/screenshots/bundle-field-type.png)\n\n## Example\n\nDisplay a list of products and quantities that make up the bundle.\n\n```twig\n{% for id,qty in bundle.getQtys() %}\n   {{ qty ~ ' x ' ~ craft.variants.id(id).one.description }}\n{% endfor %}\n```\nBrought to you by [webdna](https://webdna.co.uk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdna%2Fcommerce-bundles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebdna%2Fcommerce-bundles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdna%2Fcommerce-bundles/lists"}