问题
I'm currently migrating an old shop in which the fields isDirect
and isMotor
already exist in the ps_product
table.
I added these two fields in the ps_product
table of the new shop.
These two fields are tinyint
type, and their value is 0
or 1
.
Here is my Product
class :
public $isMotor;
public $isDirect;
with following data-structure:
'isMotor' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'isDirect' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
Then when I try to add it in the twig file, nothing appears on the page:
{{ isMotor }}
Do you know how to make it display on the page? The goal would be to do an if else statement on twig (
if (isMotor) {
echo ...;
}
else {
echo ...;
}
来源:https://stackoverflow.com/questions/57523020/displaying-value-from-the-ps-product-table-in-a-twig-file-in-prestashop-1-7-5