Developer notes
Data model
Section titled “Data model”Posts are core pages (cscart_pages, page_type = 'B'). Blog Pro never copies them; it keeps its own data next to them.
| Table | Contents |
|---|---|
cscart_kv_blog_categories |
category_id, company_id (Ultimate storefront, 0 = shared), status, position, timestamp |
cscart_kv_blog_category_descriptions |
name, description, page_title, meta_description, meta_keywords per language |
cscart_kv_blog_post_categories |
page_id, category_id, is_main |
cscart_kv_blog_posts |
page_id, author_id, is_featured, toc (D/Y/N), schema_type, publish_at, updated_at, moderation (‘’/P/A/R) |
cscart_kv_blog_post_products |
page_id, product_id, position (“Shop the post”) |
cscart_kv_blog_post_links |
page_id, linked_page_id, position (manual related posts) |
cscart_kv_blog_authors |
author_id (= user_id), company_id, status, social (JSON) |
cscart_kv_blog_author_descriptions |
display_name, job_title, bio per language |
cscart_kv_blog_post_views |
page_id, day, views (popular posts; written only by the view counter) |
- Author photos are image pairs of the object type
kv_blog_author. Post images stay coreblogimage pairs. - Tags are the core Tags add-on (
cscart_tags,cscart_tag_linkswithobject_type = 'A'). - The core link post → user (
cscart_blog_authors) is kept in sync: the core adds every editor of a post; Blog Pro keeps exactly the chosen author. - Scheduling writes the core fields
use_avail_period = 'Y'andavail_from_timestamp(exact time) and sets the post date to the publish time.
| Hook | What Blog Pro does |
|---|---|
get_pages |
Storefront: hides pending and rejected vendor posts in every page list. Own list parameters: kv_posts_only, kv_category_id, kv_tag_id, kv_author_id, kv_featured, kv_product_id, kv_exclude, kv_sort = views |
update_page_post |
Saves the Blog Pro tab (page_data[kv_blog]), keeps one author per post, writes the schedule |
delete_page, clone_page |
Removes or copies the post data |
delete_product_post |
Removes the product from “Shop the post” |
delete_company, post_delete_user |
Removes categories (Ultimate storefront) and author profiles |
delete_tags_post (Tags add-on) |
Removes the SEO names of deleted tags |
seo_is_indexed_page (SEO add-on) |
Index rules of the category, tag and author pages |
dispatch_before_display |
Structured data (after SEO and SEO Pro Suite, add-on priority 3100) |
Controllers: frontend pages.post.php (post and list data, moderation and schedule check), kv_blog.php (category, tag, author, rss, hit); backend pages.post.php (editor tab), kv_blog_pro.php (categories, authors), block_manager.post.php (category list for the block setting).
Template hooks (Responsive, inherited by Nova and other child themes): pages:page_content (pre: header, image, table of contents), pages:page_extra (pre: blog list cards; tags, “Shop the post”, author box and related posts before the core comments), index:meta (RSS links; JSON-LD when the SEO add-on is off), index:styles, index:scripts.
The core blog line (date, author, image) above the description is hidden with CSS :has() when Blog Pro’s header follows it; a small script does the same in browsers without :has().
SEO URLs
Section titled “SEO URLs”schemas/seo/objects.post.php registers three SEO object types: k blog category (kv_blog.category, category_id), j blog tag (kv_blog.tag, tag_id) and w blog author (kv_blog.author, author_id). The core SEO add-on routes them, creates missing names on the fly and handles redirects when a name changes. In CS-Cart (Ultimate) names are per storefront. schemas/seo/canonical_urls.post.php adds canonical, prev and next links to the three pages. Uninstalling removes every SEO name and redirect of these types.
Structured data
Section titled “Structured data”On posts Blog Pro builds a BlogPosting/Article/NewsArticle item with headline, description, url, mainEntityOfPage, datePublished, dateModified, image, author (Person with url, jobTitle, image, sameAs), publisher, articleSection, keywords, wordCount, timeRequired, commentCount and inLanguage. It is stored in the view variable schema_org_markup_items under the key kv_blog_posting, the key SEO Pro Suite uses: with SEO Pro Suite active, its item is replaced (its publisher is kept), so the page has one article item. A BreadcrumbList is added only when neither the core nor SEO Pro Suite added one; author pages get a ProfilePage item. To change the items, hook dispatch_before_display with a priority above 3100 and edit schema_org_markup_items.
Caching and the full page cache
Section titled “Caching and the full page cache”- Every storefront output depends on the URL only. Nothing is printed from the session; pages of guests are cached by the CS-Cart 4.21 full page cache like any blog page.
- The view counter is a
navigator.sendBeaconPOST toindex.php?dispatch=kv_blog.hit(no form token:schemas/security/csrf_validation.post.php), once per post and visitor per day (cookiekv_blog_seen), bots skipped. It writes onlycscart_kv_blog_post_views, which is no cache tag. - The Blog Pro block is cached with the update handlers of pages, our tables, images and tags, the request parameters
page_id,product_id,category_id,author_id,tag_idand a callable key (fn_kv_blog_pro_cache_key: licence state, settings, the day and the last scheduled post that went live). Logged-in customers get it uncached. - No writes to
storage_dataat runtime.
Product cards
Section titled “Product cards”[product id=N] in the text is replaced by addons/kv_blog_pro/components/product_card.tpl. Products are read with fn_get_products (customer visibility, prices) and fn_gather_additional_products_data. “Shop the post” uses the core blocks/list_templates/grid_list.tpl, so the theme’s product cards, labels and add to cart buttons apply. Without a valid license the shortcodes are removed from the text instead of being printed.
File map
Section titled “File map”app/addons/kv_blog_pro/ addon.xml settings, 9 tables, install/uninstall functions, dependency on blog init.php / func.php hooks, block content functions, cache key, install migration, uninstall cleanup layouts.xml layout pages Blog category / Blog tag / Blog author controllers/frontend/pages.post.php post and list data, moderation and schedule check controllers/frontend/kv_blog.php category, tag, author pages, RSS, view counter controllers/backend/pages.post.php Blog Pro tab of the post editor controllers/backend/kv_blog_pro.php Blog categories, Blog authors controllers/backend/kv_blog_pro_license.php "Check now" and licence cron controllers/backend/block_manager.post.php categories for the block setting schemas/seo/objects.post.php, canonical_urls.post.php schemas/block_manager/blocks.post.php, templates.post.php, dispatch_descriptions.post.php schemas/menu/menu.post.php Website > Blog categories, Blog authors schemas/permissions/admin.post.php view_pages / manage_pages schemas/security/csrf_validation.post.php view counter without form token Tygh/Addons/KvBlogPro/ Config.php settings, switches, constants Posts.php post data, save, visibility, reading time, table of contents, shortcodes, related posts, views Categories.php categories Authors.php author profiles Seo.php SEO names of the own objects Markup.php JSON-LD items Rss.php RSS 2.0 feeds License/ domain-bound licence client (generated) Upgrade/ self-healing upgrade synchronizer (generated)design/backend/templates/addons/kv_blog_pro/ hooks/pages/tabs_content.post.tpl the Blog Pro tab views/kv_blog_pro/categories.tpl, category.tpl, authors.tpl, author.tpl components/block_category.tpl block settingvar/themes_repository/responsive/templates/addons/kv_blog_pro/ hooks/pages/page_content.pre.tpl, page_extra.pre.tpl, hooks/index/meta.post.tpl components/ card, list, byline, author box, product card, archive views/kv_blog/category.tpl, tag.tpl, author.tpl blocks/posts_list.tpl, posts_cards.tpl, categories.tpl, tag_cloud.tplvar/themes_repository/responsive/css/addons/kv_blog_pro/styles.lessjs/addons/kv_blog_pro/func.js view counter, fallback for browsers without :has()var/langs/en/addons/kv_blog_pro.poLicense
Section titled “License”The add-on ships the generated License\Client. Gated (switched off without a valid license): every storefront output of Blog Pro: the post enrichments, the list cards, category/tag/author pages, RSS feeds, blocks, the structured data changes and the view counter. Not gated: admin pages and the editor tab, the approval of vendor posts and exact-time scheduling (these hide content and must keep working).