democmscustomfields17

Demo cms custom field PS 17

Stars
4
Committers
1

democmscustomfields17

Demo cms custom field PS 17

This module is an architectural skeleton for module developers, who want to add custom fields in the cms page on the backoffice. It's a base, you have to adapt it to your needs ... This will save you a lot of time!

Requirements

  • Prestashop >= 1.7.x
  • composer >= 1.10.1

Install

BO Install

DEV install

How to use ?

  • 1 : Update DB schema

Update the table schema (add or remove fields the custom fields) see here

NOTE : put the multilang fields in democmscustomfields17_lang table.

  • 2 : Update the model

Update the model (add or remove fields the custom fields) see here

  • 3 : Update the Form

Update the form (add or remove fields the custom fields) see here

  • 4 : Acces data in FRONT

JS

console.log(prestashop.modules.democmscustomfields17.your_field_name);

Smarty

{$modules.democmscustomfields17.your_field_name}

NOTE : this data is accessible only in the cms pages controller. You can access them outside this controller as follows


<?php


$params = [
  'id_cms' => 10,
  'id_lang' => 1,
  'id_shop' => 3,
];

$myCmsCustomDatas = (new \PrestaShop\Module\Democmscustomfields17\Form\Cms\FormDataHandler())->getData($params);