Jump to content

Edit History

victorweb

victorweb


mas informacion

Gracias @alex222er !!, soy nuevo con esto de presta y de los pocos overrides que he hecho nunca han sido de la parte nueva con Symfony o sería directamente en estos ficheros que indicas?? ... tienes algún tutorial o algo para que vaya metiendo mano al asunto? es para no marearte mucho con esto ..

 

Por ejemplo, he intentado mostrar los datos en el panel de cliente (añadi 2 campos zipcode y phonemobile se llaman igual en la tabña ps_customer) : 

1 - public_html/src/Core/Domain/Customer/QueryResult/PersonalInformation.php 

he añadido a la clase :

class PersonalInformation {

/**
* @var string
*/

private $zipcode;

/**
* @var string
*/

private $phonemobile;

    public function __construct(
        $firstName,
        $lastName,
        $zipcode,
        $phonemobile,
        $email,
        $isGuest,
        $socialTitle,
        $birthday,
        $registrationDate,
        $lastUpdateDate,
        $lastVisitDate,
        $rankBySales,
        $shopName,
        $languageName,
        Subscriptions $subscriptions,
        $isActive
    ) {
        $this->firstName = $firstName;
        $this->lastName = $lastName;
        $this->zipcode = $zipcode;
        $this->phonemobile = $phonemobile;
        $this->email = $email;
        $this->isGuest = $isGuest;
        $this->socialTitle = $socialTitle;
        $this->birthday = $birthday;
        $this->registrationDate = $registrationDate;
        $this->lastUpdateDate = $lastUpdateDate;
        $this->lastVisitDate = $lastVisitDate;
        $this->rankBySales = $rankBySales;
        $this->shopName = $shopName;
        $this->languageName = $languageName;
        $this->subscriptions = $subscriptions;
        $this->isActive = $isActive;
    }

    /**
     * @return string
     */
    public function getzipcode()
    {
        return $this->zipcode;
    }

    /**
     * @return string
     */
    public function getphonemobile()
    {
        return $this->phonemobile;
    }



}

 

2- public_html/src/Adapter/Customer/QueryHandler/GetCustomerForViewingHandler.php

final class GetCustomerForViewingHandler implements GetCustomerForViewingHandlerInterface
{
 private function getPersonalInformation(Customer $customer)
    {
        $customerStats = $customer->getStats();

        $gender = new Gender($customer->id_gender, $this->contextLangId);
        $socialTitle = $gender->name ?: $this->translator->trans('Unknown', [], 'Admin.Orderscustomers.Feature');

        if ($customer->birthday && '0000-00-00' !== $customer->birthday) {
            $birthday = sprintf(
                $this->translator->trans('%1$d years old (birth date: %2$s)', [], 'Admin.Orderscustomers.Feature'),
                $customerStats['age'],
                Tools::displayDate($customer->birthday)
            );
        } else {
            $birthday = $this->translator->trans('Unknown', [], 'Admin.Orderscustomers.Feature');
        }

        $registrationDate = Tools::displayDate($customer->date_add, null, true);
        $lastUpdateDate = Tools::displayDate($customer->date_upd, null, true);
        $lastVisitDate = $customerStats['last_visit'] ?
            Tools::displayDate($customerStats['last_visit'], null, true) :
            $this->translator->trans('Never', [], 'Admin.Global');

        $customerShop = new Shop($customer->id_shop);
        $customerLanguage = new Language($customer->id_lang);

        $customerSubscriptions = new Subscriptions(
            (bool) $customer->newsletter,
            (bool) $customer->optin
        );

        return new PersonalInformation(
            $customer->firstname,
            $customer->lastname,
            $customer->zipcode,
            $customer->phonemobile,
            $customer->email,
            $customer->isGuest(),
            $socialTitle,
            $birthday,
            $registrationDate,
            $lastUpdateDate,
            $lastVisitDate,
            $this->getCustomerRankBySales($customer->id),
            $customerShop->name,
            $customerLanguage->name,
            $customerSubscriptions,
            (bool) $customer->active
        );
    }
}

3 -  public_html/src/PrestaShopBundle/Resources/views/Admin/Sell/Customer/Blocks/View/personal_information.html.twig

<div class="card customer-personal-informations-card">
  <h3 class="card-header">
    <i class="material-icons">person</i>
    {{ customerInformation.personalInformation.firstName }}
    {{ customerInformation.personalInformation.lastName }}
    {{ customerInformation.personalInformation.zipcode }}
    {{ customerInformation.personalInformation.phonemobile }}
    ......

y no he conseguido que se muestre en el panel de control ...

 

panelcontrol.jpg

victorweb

victorweb


mas informacion

Gracias @alex222er !!, soy nuevo con esto de presta y de los pocos overrides que he hecho nunca han sido de la parte nueva con Symfony o sería directamente en estos ficheros que indicas?? ... tienes algún tutorial o algo para que vaya metiendo mano al asunto? es para no marearte mucho con esto ..

 

Por ejemplo, he intentado mostrar los datos en el panel de cliente: 

1 - public_html/src/Core/Domain/Customer/QueryResult/PersonalInformation.php 

he añadido a la clase :

class PersonalInformation {

/**

* @var string

*/

private $zipcode;

/**

* @var string

*/

private $phonemobile;

    public function __construct(
        $firstName,
        $lastName,
        $zipcode,
        $phonemobile,
        $email,
        $isGuest,
        $socialTitle,
        $birthday,
        $registrationDate,
        $lastUpdateDate,
        $lastVisitDate,
        $rankBySales,
        $shopName,
        $languageName,
        Subscriptions $subscriptions,
        $isActive
    ) {
        $this->firstName = $firstName;
        $this->lastName = $lastName;
        $this->zipcode = $zipcode;
        $this->phonemobile = $phonemobile;
        $this->email = $email;
        $this->isGuest = $isGuest;
        $this->socialTitle = $socialTitle;
        $this->birthday = $birthday;
        $this->registrationDate = $registrationDate;
        $this->lastUpdateDate = $lastUpdateDate;
        $this->lastVisitDate = $lastVisitDate;
        $this->rankBySales = $rankBySales;
        $this->shopName = $shopName;
        $this->languageName = $languageName;
        $this->subscriptions = $subscriptions;
        $this->isActive = $isActive;
    }

    /**
     * @return string
     */
    public function getzipcode()
    {
        return $this->zipcode;
    }

    /**
     * @return string
     */
    public function getphonemobile()
    {
        return $this->phonemobile;
    }



}

 

2- public_html/src/Adapter/Customer/QueryHandler/GetCustomerForViewingHandler.php

final class GetCustomerForViewingHandler implements GetCustomerForViewingHandlerInterface
{
 private function getPersonalInformation(Customer $customer)
    {
        $customerStats = $customer->getStats();

        $gender = new Gender($customer->id_gender, $this->contextLangId);
        $socialTitle = $gender->name ?: $this->translator->trans('Unknown', [], 'Admin.Orderscustomers.Feature');

        if ($customer->birthday && '0000-00-00' !== $customer->birthday) {
            $birthday = sprintf(
                $this->translator->trans('%1$d years old (birth date: %2$s)', [], 'Admin.Orderscustomers.Feature'),
                $customerStats['age'],
                Tools::displayDate($customer->birthday)
            );
        } else {
            $birthday = $this->translator->trans('Unknown', [], 'Admin.Orderscustomers.Feature');
        }

        $registrationDate = Tools::displayDate($customer->date_add, null, true);
        $lastUpdateDate = Tools::displayDate($customer->date_upd, null, true);
        $lastVisitDate = $customerStats['last_visit'] ?
            Tools::displayDate($customerStats['last_visit'], null, true) :
            $this->translator->trans('Never', [], 'Admin.Global');

        $customerShop = new Shop($customer->id_shop);
        $customerLanguage = new Language($customer->id_lang);

        $customerSubscriptions = new Subscriptions(
            (bool) $customer->newsletter,
            (bool) $customer->optin
        );

        return new PersonalInformation(
            $customer->firstname,
            $customer->lastname,
            $customer->zipcode,
            $customer->phonemobile,
            $customer->email,
            $customer->isGuest(),
            $socialTitle,
            $birthday,
            $registrationDate,
            $lastUpdateDate,
            $lastVisitDate,
            $this->getCustomerRankBySales($customer->id),
            $customerShop->name,
            $customerLanguage->name,
            $customerSubscriptions,
            (bool) $customer->active
        );
    }
}

3 -  public_html/src/PrestaShopBundle/Resources/views/Admin/Sell/Customer/Blocks/View/personal_information.html.twig

<div class="card customer-personal-informations-card">
  <h3 class="card-header">
    <i class="material-icons">person</i>
    {{ customerInformation.personalInformation.firstName }}
    {{ customerInformation.personalInformation.lastName }}
    {{ customerInformation.personalInformation.zipcode }}
    {{ customerInformation.personalInformation.phonemobile }}
    ......

y no he conseguido que se muestre en el panel de control ...

 

panelcontrol.jpg

victorweb

victorweb


mas informacion

Gracias @alex222er !!, soy nuevo con esto de presta y de los pocos overrides que he hecho nunca han sido de la parte nueva con Symfony o sería directamente en estos ficheros que indicas?? ... tienes algún tutorial o algo para que vaya metiendo mano al asunto? ..

 

Por ejemplo, he intentado mostrar los datos en el panel de cliente: 

1 - public_html/src/Core/Domain/Customer/QueryResult/PersonalInformation.php 

he añadido a la clase :

class PersonalInformation {

/**

* @var string

*/

private $zipcode;

/**

* @var string

*/

private $phonemobile;

    public function __construct(
        $firstName,
        $lastName,
        $zipcode,
        $phonemobile,
        $email,
        $isGuest,
        $socialTitle,
        $birthday,
        $registrationDate,
        $lastUpdateDate,
        $lastVisitDate,
        $rankBySales,
        $shopName,
        $languageName,
        Subscriptions $subscriptions,
        $isActive
    ) {
        $this->firstName = $firstName;
        $this->lastName = $lastName;
        $this->zipcode = $zipcode;
        $this->phonemobile = $phonemobile;
        $this->email = $email;
        $this->isGuest = $isGuest;
        $this->socialTitle = $socialTitle;
        $this->birthday = $birthday;
        $this->registrationDate = $registrationDate;
        $this->lastUpdateDate = $lastUpdateDate;
        $this->lastVisitDate = $lastVisitDate;
        $this->rankBySales = $rankBySales;
        $this->shopName = $shopName;
        $this->languageName = $languageName;
        $this->subscriptions = $subscriptions;
        $this->isActive = $isActive;
    }

    /**
     * @return string
     */
    public function getzipcode()
    {
        return $this->zipcode;
    }

    /**
     * @return string
     */
    public function getphonemobile()
    {
        return $this->phonemobile;
    }



}

 

2- public_html/src/Adapter/Customer/QueryHandler/GetCustomerForViewingHandler.php

final class GetCustomerForViewingHandler implements GetCustomerForViewingHandlerInterface
{
 private function getPersonalInformation(Customer $customer)
    {
        $customerStats = $customer->getStats();

        $gender = new Gender($customer->id_gender, $this->contextLangId);
        $socialTitle = $gender->name ?: $this->translator->trans('Unknown', [], 'Admin.Orderscustomers.Feature');

        if ($customer->birthday && '0000-00-00' !== $customer->birthday) {
            $birthday = sprintf(
                $this->translator->trans('%1$d years old (birth date: %2$s)', [], 'Admin.Orderscustomers.Feature'),
                $customerStats['age'],
                Tools::displayDate($customer->birthday)
            );
        } else {
            $birthday = $this->translator->trans('Unknown', [], 'Admin.Orderscustomers.Feature');
        }

        $registrationDate = Tools::displayDate($customer->date_add, null, true);
        $lastUpdateDate = Tools::displayDate($customer->date_upd, null, true);
        $lastVisitDate = $customerStats['last_visit'] ?
            Tools::displayDate($customerStats['last_visit'], null, true) :
            $this->translator->trans('Never', [], 'Admin.Global');

        $customerShop = new Shop($customer->id_shop);
        $customerLanguage = new Language($customer->id_lang);

        $customerSubscriptions = new Subscriptions(
            (bool) $customer->newsletter,
            (bool) $customer->optin
        );

        return new PersonalInformation(
            $customer->firstname,
            $customer->lastname,
            $customer->zipcode,
            $customer->phonemobile,
            $customer->email,
            $customer->isGuest(),
            $socialTitle,
            $birthday,
            $registrationDate,
            $lastUpdateDate,
            $lastVisitDate,
            $this->getCustomerRankBySales($customer->id),
            $customerShop->name,
            $customerLanguage->name,
            $customerSubscriptions,
            (bool) $customer->active
        );
    }
}

3 -  public_html/src/PrestaShopBundle/Resources/views/Admin/Sell/Customer/Blocks/View/personal_information.html.twig

<div class="card customer-personal-informations-card">
  <h3 class="card-header">
    <i class="material-icons">person</i>
    {{ customerInformation.personalInformation.firstName }}
    {{ customerInformation.personalInformation.lastName }}
    {{ customerInformation.personalInformation.zipcode }}
    {{ customerInformation.personalInformation.phonemobile }}
    ......

y no he conseguido que se muestre en el panel de control ...

 

panelcontrol.jpg

victorweb

victorweb

Gracias @alex222er !!, soy nuevo con esto de presta y de los pocos overrides que he hecho nunca han sido de la parte nueva con Symfony o sería directamente en estos ficheros que indicas?? ... tienes algún tutorial o algo para que vaya metiendo mano al asunto? ..

×
×
  • Create New...