This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

vansebas

  • ***
  • 35 posts
Send image with reaction on listing
« on: February 28, 2021, 12:05:27 PM »
On the listing page you see the green button to send a reaction to the listing poster.
Here you can add a phone number and the message itself (if you are logged in) otherwise you have to fill in your name and email.

Would it also be possible to upload a picture to it and send this picture with the reaction to it as a attachment?

*

MB Themes

Re: Send image with reaction on listing
« Reply #1 on: March 17, 2021, 02:40:39 PM »
@vansebas
You can enable attachments in contact form in listing settings.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

vansebas

  • ***
  • 35 posts
Re: Send image with reaction on listing
« Reply #2 on: March 18, 2021, 03:49:07 PM »
I already enabled that option and in the contact form on the contact page I see the attachement field.
Only when I open a listing and click on the green to send a e-mail to the person the send a message field show but there is no attachment field (see attached image), this happend with the Gamma theme.

*

MB Themes

Re: Send image with reaction on listing
« Reply #3 on: March 18, 2021, 04:33:01 PM »
In item-send-friend.php find this line:
Code: [Select]
            <div class="row">
              <label for="message"><span><?php _e('Message''gamma'); ?></span><span class="req">*</span></label>
              <?php ContactForm::your_message(); ?>
            </div>

Bellow it add this code:
Code: [Select]
            <?php if(osc_item_attachment()) { ?>
              <div class="row">
                <label for="attachment"><?php _e('Attachment''gamma'); ?>:</label>
                <div class="input-box"><?php ContactForm::your_attachment(); ?></div>
              </div>
            <?php ?>

Form submit without reload (Ajax) - should be disabled, as file cannot be uploaded and sent via ajax.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

vansebas

  • ***
  • 35 posts
Re: Send image with reaction on listing
« Reply #4 on: March 19, 2021, 09:18:08 PM »
With that code I now see indeed the attachment field, only when I send the email I receive the email in my mailbox but without any attachment.

And AJAX send form option is disabled in the settings.

*

MB Themes

Re: Send image with reaction on listing
« Reply #5 on: March 20, 2021, 07:32:52 AM »
Will test it.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

vansebas

  • ***
  • 35 posts
Re: Send image with reaction on listing
« Reply #6 on: March 29, 2021, 07:08:17 PM »

Marked as best answer by frosticek on April 09, 2021, 08:30:03 PM
*

vansebas

  • ***
  • 35 posts
Re: Send image with reaction on listing
« Reply #7 on: April 09, 2021, 08:21:25 PM »
I solved it!

I replaced this code of the adding attachment field with the same code from the contact page (so the looks are the same)
Code: [Select]
            <?php if(osc_item_attachment()) { ?>
              <div class="row">
                <label for="attachment"><?php _e('Attachment''gamma'); ?>:</label>
                <div class="input-box"><?php ContactForm::your_attachment(); ?></div>
              </div>
            <?php ?>

And to the form tag  I added a code.
Default form tag is:
Code: [Select]
<form target="_top" action="<?php echo osc_base_url(true) ; ?>" method="post" name="contact_form" id="contact_form" class="fw-box" style="display:block;">
I changed it to:
Code: [Select]
<form target="_top" action="<?php echo osc_base_url(true) ; ?>" method="post" name="contact_form" <?php if(osc_contact_attachment()) { ?>enctype="multipart/form-data"<?php ?> id="contact_form" class="fw-box" style="display:block;">
And now when I send a reaction the attachment is added to the email!

*

MB Themes

Re: Send image with reaction on listing
« Reply #8 on: April 09, 2021, 08:30:37 PM »
Good work  ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots