Jump to content

Edit History

Janett

Janett

Try

    /**
     * @param array{cookie: Cookie, cart: Cart, altern: int, newCustomer: Customer} $params
     * @see CustomerPersisterCore::create
     */
    public function hookActionCustomerAccountAdd(array $params)
    {
        if (Tools::getValue('chkRecargoEquivalencia') === '1' && Validate::isLoadedObject($params['newCustomer'])) {
            Db::getInstance()->insert(
                'esp_recargo_equivalencia_prueba',
                [
                    'id_customer' => (int) $params['newCustomer']->id,
                ]
            );
        }
    }

 

Janett

Janett

Try

public function hookActionCustomerAccountAdd()
{
	if (Tools::getValue('chkRecargoEquivalencia') === '1' && Validate::isLoadedObject($this->context->customer)) {
		Db::getInstance()->insert('esp_recargo_equivalencia_prueba', ['id_customer' => (int) $this->context->customer->id]);
	}
}

 

Janett

Janett

Try

public function hookActionCustomerAccountAdd()
{
	if (Tools::getValue('chkRecargoEquivalencia') === '1') {
		Db::getInstance()->insert('esp_recargo_equivalencia_prueba', ['id_customer' => (int) $this->context->customer->id]);
	}
}

 

×
×
  • Create New...