I pass a variable in preprocess_page to the template files, so I think.
$vars['merk']=$merk;
It works fine when I call the variable in page.tpl.php . But when I call that variable in commerce-product-title.tpl.php it does not load, it returns null. I cannot find how to pass that variable to this tpl.php file.
Presuming that template is only used when displaying a product, which is a different entity to a page.
Try altering the vars in the product hook instead:
function hook_preprocess_commerce_product(&$vars) {
$vars['merk']=$merk;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.