Developer notes
Overview · Installation · Configuration · Usage · FAQ
- Add-on id
kv_google_customer_reviews, scheme 3.0, PHP 7.4 to 8.3, CS-Cart 4.17.2 to 4.21.x. No core files are changed. - Opt-in:
controllers/frontend/checkout.post.php(modecomplete) builds the data withTygh\Addons\KvGoogleCustomerReviews\OptIn::build($order_info)and assigns it to the view. The template hookindex:scriptsprints a small script that definesrenderOptInand then addshttps://apis.google.com/js/platform.js?onload=renderOptIn. The confirmation page is never served from the full page cache. - Store widget: the
dispatch_before_displayhook assigns the options; the template hookindex:head_scriptsprintshttps://www.gstatic.com/shopping/merchant/merchantwidget.jsandmerchantwidget.start(). The output depends on settings only. - Feed:
index.php?dispatch=kv_google_customer_reviews.feed&token=<token>, streamed in batches of 500 reviews,Content-Type: application/xml,X-Robots-Tag: noindex. Element order followsproduct_reviews.xsd2.4. Review ids:r<product_review_id>(Product reviews) ord<post_id>(Comments and reviews). The feed also answers while the storefront is closed. - Table
?:kv_gcr_optins(order_id, company_id, country, delivery_date, gtins, shown_at, views), listed in the full page cacheignore_cache_tags. Thedelete_orderhook removes rows of deleted orders. - Hooks:
delete_order,dispatch_before_display. Template hooks:index:scripts,index:head_scripts(responsive; Nova and Bright inherit them). - License gate:
Config::isActive()(installed, enabled, licensed). When inactive: no opt-in, no widget, feed 404.