{"id":52082894,"url":"https://github.com/bacoords/woo-example-product-templates","last_synced_at":"2026-08-03T21:01:30.619Z","repository":{"id":370275965,"uuid":"1292868226","full_name":"bacoords/woo-example-product-templates","owner":"bacoords","description":null,"archived":false,"fork":false,"pushed_at":"2026-07-08T17:19:14.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-08T19:21:43.057Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bacoords.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-07-07T23:23:44.000Z","updated_at":"2026-07-08T17:20:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bacoords/woo-example-product-templates","commit_stats":null,"previous_names":["bacoords/woo-example-product-templates"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/bacoords/woo-example-product-templates","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bacoords%2Fwoo-example-product-templates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bacoords%2Fwoo-example-product-templates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bacoords%2Fwoo-example-product-templates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bacoords%2Fwoo-example-product-templates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bacoords","download_url":"https://codeload.github.com/bacoords/woo-example-product-templates/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bacoords%2Fwoo-example-product-templates/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36251377,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-08-03T02:00:06.975Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-08-03T21:01:29.757Z","updated_at":"2026-08-03T21:01:30.596Z","avatar_url":"https://github.com/bacoords.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Woo Example Product Templates\n\nExample WooCommerce plugin that registers category-specific block templates for single product pages.\n\nThis is meant as tutorial code, not a complete template-management product. It keeps the configuration in PHP so developers can see the moving parts clearly.\n\n\u003cimg width=\"3508\" height=\"2382\" alt=\"SCR-20260707-petb\" src=\"https://github.com/user-attachments/assets/84064ba2-f710-49db-8224-0df1a2b9b891\" /\u003e\n\n## What it does\n\n- Registers one single product block template per configured product category slug.\n- Uses the current site's `single-product` block template as the default content for each category template.\n- Adds matching category templates into WordPress's single product template hierarchy.\n- Lets Site Editor customizations win over the registered defaults.\n\nFor example, the configured `music` category slug registers this template:\n\n```text\nsingle-product-category-music\n```\n\nIf a product belongs to the `music` category, WordPress checks that category template after product-specific templates and before the normal `single-product` fallback.\n\n## Configure categories\n\nEdit `CATEGORY_SLUGS` in `woo-example-product-templates.php`:\n\n```php\nconst CATEGORY_SLUGS = array(\n\t'clothing',\n\t'decor',\n\t'music',\n);\n```\n\nUse exact top-level product category slugs from your site. Products assigned to child categories can route through a configured ancestor category. For example, a product in `tshirts` can use the `clothing` template if `clothing` is listed.\n\n## Template behavior\n\nThe plugin does not ship HTML template files. Each registered category template starts with the site's current `single-product` block template content.\n\nOnce a category template is edited in the Site Editor, WordPress stores it as a `wp_template` post for the active theme. That saved template takes precedence over the plugin's registered default.\n\n## Requirements\n\n- WordPress with block template support.\n- WooCommerce active.\n- A block theme or theme support for block templates.\n\n## Notes\n\nTemplate slugs are derived from category slugs, matching normal WordPress template hierarchy conventions. If a category slug changes, the derived template slug changes too.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbacoords%2Fwoo-example-product-templates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbacoords%2Fwoo-example-product-templates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbacoords%2Fwoo-example-product-templates/lists"}