Extend Schema.org Header Tag with SKU and ASIN per product

Open to all! Ask other shopowners for help.
Post Reply
Denzel
Member
Posts: 87
Joined: Sat Oct 31, 2020 7:22 pm
Phoenix Version:
Has thanked: 9 times
Been thanked: 15 times

Extend Schema.org Header Tag with SKU and ASIN per product

Post by Denzel »

With this addon, database fields for SKU and ASIN can be added to the product. If the Product Schema JSON-LD Header Tag Module is installed and activated, this data is added to the source code.
Schema data for your local business will also be added.
You need to customize the schemaExtend.php file in templates/default/includes/hooks/shop/product_info/ according to your needs.

To add the database fields to your product table, it is necessary to execute the following SQL statement in phpMyAdmin or use the Databasetool by @zipurman:

Code: Select all

ALTER TABLE `products` ADD `products_sku` CHAR(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL AFTER `products_gtin`, ADD `products_asin` CHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL AFTER `products_sku`;
After altering your databasetable, just upload the three files of the zip archive. No files will be overwritten.

!!! needs ht_product_schema.php from Phoenix v1.0.8.21 !!!

v1.0.0 for Phoenix v1.0.8.21
php8.x TESTED

Now uploaded to the addons section. You may get the required ht_product_schema.php from here.

Regards,
Denzel
You do not have the required permissions to view the files attached to this post.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4550
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Extend Schema.org Header Tag with SKU and ASIN per product

Post by burt »

Always place hooks outside the template structure, unless it is a hook specifically for the template.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply