Contact us about product form

  • Posts: 221
  • Thank you received: 6
  • Hikashop Business
1 year 4 months ago #354063

-- HikaShop version -- : 4.7.5

The product page usually has "CONTACT_US_FOR_INFO" button.
After clicking on this button, a contact form will open.
How to add the user's phone field on the form?

Last edit: 1 year 4 months ago by Bender.

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 4 months ago #354070

Hi,

There is no easy way to use the telephone field from the default billing or shipping address of the user there.
However, you can create a custom field of the table "contact" via the menu Display>Custom fields to ask a phone number to the user when filling the form.

Please Log in or Create an account to join the conversation.

  • Posts: 221
  • Thank you received: 6
  • Hikashop Business
1 year 4 months ago #354414

How to do the same to be displayed on the form product / waitlist.php ?

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 4 months ago #354416

What do you mean ?
You want to add a custom field to the waitlist form ?
There is no such mechanism in place there.
You could directly add the input field in the view file:

Telephone: <input type="text" name="waitlist_telephone" class="<?php echo HK_FORM_CONTROL_CLASS; ?>" size="40" <?php echo $attributes;?> />
However, you also need to create a new column in the hikashop_waitlist table in your database, and develop a small Joomla plugin of the group "hikashop" implementing the onBeforeWaitlistCreate(&$element, &$do) event to set $element->xxx (where xxx is the name of the column in the table) with the value from
$_POST['waitlist_telephone']
Then, in the waitlist email in System>Emails, you can use $data->xxx to retrieve the information from the database in order to add the value to the notification email to the customer. For the notification to the admin, you can use:the value from
<?php echo $_POST['waitlist_telephone']; ?>

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum