Jump to content

customer-form.tpl gives error!


compsoul.dev

Recommended Posts

Hello, I try to adjust my template to Presta Shop 8 and I have a error in order-confirmation.tpl
 


Notice: Undefined index: register_form in /home/compsoul/domains/skate.compsoul.pl/public_html/var/cache/dev/smarty/compile/compsoullayouts_template_tpl/91/50/d1/9150d13fc66061b4c60a819fde7ab3e8e28f495d_2.file.order-confirmation.tpl.php on line 225

Notice: Trying to get property 'value' of non-object in /home/compsoul/domains/skate.compsoul.pl/public_html/var/cache/dev/smarty/compile/compsoullayouts_template_tpl/91/50/d1/9150d13fc66061b4c60a819fde7ab3e8e28f495d_2.file.order-confirmation.tpl.php on line 225

Fatal error: Uncaught Error: Call to a member function setTemplate() on null in /home/compsoul/domains/skate.compsoul.pl/public_html/config/smartyfront.config.inc.php:97 Stack trace: #0 /home/compsoul/domains/skate.compsoul.pl/public_html/classes/Smarty/SmartyLazyRegister.php(81): smartyRender(Array, Object(SmartyDevTemplate)) #1 /home/compsoul/domains/skate.compsoul.pl/public_html/var/cache/dev/smarty/compile/compsoullayouts_template_tpl/91/50/d1/9150d13fc66061b4c60a819fde7ab3e8e28f495d_2.file.order-confirmation.tpl.php(225): SmartyLazyRegister->__call('smartyRender', Array) #2 /home/compsoul/domains/skate.compsoul.pl/public_html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php(248): Block_1338262457639cb848208f26_63031466->callBlock(Object(SmartyDevTemplate)) #3 /home/compsoul/domains/skate.compsoul.pl/public_html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php(184): Smarty_Internal_Runtime_Inheritance->callBlock(Object(Block_1338262457639cb848208f26_63031466), Ob in /home/compsoul/domains/skate.compsoul.pl/public_html/config/smartyfront.config.inc.php on line 97

There is a code of this block:
 

        {block name='customer_registration_form'}
          {if $customer.is_guest}
            <div id="registration-form" class="order-form">
              <h3 class="order-form-heading">{l s='Save time on your next order, sign up now' d='Shop.Theme.Checkout'}</h3>
              {render file='customer/_partials/customer-form.tpl' ui=$register_form}
            </div>
          {/if}
        {/block}

Fun fact:
The customer form during registration works correctly? Can anyone help me?

Link to comment
Share on other sites

Like I wrote, I use default PS 8 modules. There is a template code:
 

{block name='customer_form'}
  {block name='customer_form_errors'}
    {include file='_partials/form-errors.tpl' errors=$errors['']}
  {/block}

<form action="{block name='customer_form_actionurl'}{$action}{/block}" id="customer-form" class="module-form js-customer-form" method="post">
  {block "form_fields"}
    {foreach from=$formFields item="field"}
      {block "form_field"}
        {form_field field=$field}
      {/block}
    {/foreach}
    {$hook_create_account_form nofilter}
  {/block}

  {block name='customer_form_footer'}
    <footer class="form-nav">
      <input type="hidden" name="submitCreate" value="1">
      {block "form_buttons"}
        <button class="form-button button-second" data-link-action="save-customer" type="submit">
          {l s='Save' d='Shop.Theme.Actions'}
        </button>
      {/block}
    </footer>
  {/block}

</form>
{/block}

This is exactly the same code which I used in 1.7 version but in 8.0 it does not wanna run. This is a default code, so I send the same parameters like everyone.
On this shop working: shop.compsoul.pl
On this one does not working: skate.compsoul.pl

You Can check by order something without account.

Link to comment
Share on other sites

After change PHP version to 8.1 I have a error in the same place:
 


Fatal error: Uncaught Error: Call to undefined function proc_open() in /home/compsoul/domains/skate.compsoul.pl/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:291 Stack trace: #0 /home/compsoul/domains/skate.compsoul.pl/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(54): Swift_Transport_StreamBuffer->establishProcessConnection() #1 /home/compsoul/domains/skate.compsoul.pl/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(143): Swift_Transport_StreamBuffer->initialize() #2 /home/compsoul/domains/skate.compsoul.pl/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php(50): Swift_Transport_AbstractSmtpTransport->start() #3 /home/compsoul/domains/skate.compsoul.pl/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(65): Swift_Transport_SendmailTransport->start() #4 /home/compsoul/domains/skate.compsoul.pl/public_html/classes/Mail.php(627): Swift_Mailer->send() #5 /home/compsoul/domains/skate.compsoul.pl/public_html/modules/ps_emailalerts/ps_emailalerts.php(529): MailCore::send() #6 /home/compsoul/domains/skate.compsoul.pl/public_html/classes/Hook.php(968): Ps_EmailAlerts->hookActionValidateOrder() #7 /home/compsoul/domains/skate.compsoul.pl/public_html/classes/Hook.php(407): HookCore::coreCallHook() #8 /home/compsoul/domains/skate.compsoul.pl/public_html/classes/Hook.php(903): HookCore::callHookOn() #9 /home/compsoul/domains/skate.compsoul.pl/public_html/classes/PaymentModule.php(558): HookCore::exec() #10 /home/compsoul/domains/skate.compsoul.pl/public_html/modules/ps_wirepayment/controllers/front/validation.php(63): PaymentModuleCore->validateOrder() #11 /home/compsoul/domains/skate.compsoul.pl/public_html/classes/controller/Controller.php(308): Ps_WirepaymentValidationModuleFrontController->postProcess() #12 /home/compsoul/domains/skate.compsoul.pl/public_html/classes/Dispatcher.php(503): ControllerCore->run() #13 /home/compsoul/domains/skate.compsoul.pl/public_html/index.php(28): DispatcherCore->dispatch() #14 {main} thrown in /home/compsoul/domains/skate.compsoul.pl/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php on line 291

Edited by compsoul.pl (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...
On 12/17/2022 at 2:29 AM, compsoul.pl said:
        {block name='customer_registration_form'}
          {if $customer.is_guest}
            <div id="registration-form" class="order-form">
              <h3 class="order-form-heading">{l s='Save time on your next order, sign up now' d='Shop.Theme.Checkout'}</h3>
              {render file='customer/_partials/customer-form.tpl' ui=$register_form}
            </div>
          {/if}
        {/block}

Modify to:

  {if !$registered_customer_exists}
    {block name='account_transformation_form'}
      <div class="card">
        <div class="card-block">
          {include file='customer/_partials/account-transformation-form.tpl'}
        </div>
      </div>
    {/block}
  {/if}

customer/_partials/account-transformation-form.tpl

The content is:

{block name='account_transformation_form'}
  <h4>{l s='Save time on your next order, sign up now' d='Shop.Theme.Checkout'}</h4>
  <ul>
    <li> - {l s='Personalized and secure access' d='Shop.Theme.Customeraccount'}</li>
    <li> - {l s='Fast and easy checkout' d='Shop.Theme.Customeraccount'}</li>
    <li> - {l s='Easier merchandise return' d='Shop.Theme.Customeraccount'}</li>
  </ul>
  <form method="post">
    <div class="form-group">
      <label class="form-control-label required" for="field-email">
        {l s='Set your password:' d='Shop.Forms.Labels'}
      </label>
      <input type="password" class="form-control" data-validate="isPasswd" required name="password" value="">
    </div>
    <footer class="form-footer">
      <input type="hidden" name="submitTransformGuestToCustomer" value="1">
      <button class="btn btn-primary" type="submit">{l s='Create account' d='Shop.Theme.Actions'}</button>
    </footer>
  </form>
{/block}

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...