Thread: Ask A Question

Page 36 of 40 FirstFirst ... 263435363738 ... LastLast
Results 351 to 360 of 399
  1. #351
    Join Date
    Feb 2016
    Location
    Canada
    Posts
    143
    Plugin Contributions
    0

    Default Re: Ask A Question

    mc12345678.. You truly are Totally Zenned, Thank you!

  2. #352
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Re: Ask A Question

    ...since I hacked this up over 5 years ago, I make no excuses for it...I've never looked at it since so I've no doubt it could and should be done better. In fact Conor-Ceon was integrating this functionality into Back in Stock for me when he passed, so it almost got done "properly".
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  3. #353
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: Ask A Question

    Quote Originally Posted by torvista View Post
    ...since I hacked this up over 5 years ago, I make no excuses for it...I've never looked at it since so I've no doubt it could and should be done better. In fact Conor-Ceon was integrating this functionality into Back in Stock for me when he passed, so it almost got done "properly".
    Noted a few things that should be done with more sanitization, but certainly there are "features" that can reduce store owner headache (spam) and parts of the code that require other "outside" information to add some bot detection methodologies of use.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #354
    Join Date
    May 2007
    Posts
    124
    Plugin Contributions
    0

    Default Re: Ask A Question

    ZC-1.5.5e, PHP 5.6.32, Database patch level 1.5.5

    Is there any way of including an image of the product the 'ask a question' is about in the email to the webmaster?

    thanks in advance

  5. #355
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: Ask A Question

    Quote Originally Posted by mikebr View Post
    ZC-1.5.5e, PHP 5.6.32, Database patch level 1.5.5

    Is there any way of including an image of the product the 'ask a question' is about in the email to the webmaster?

    thanks in advance
    Course its possible just depends on how you want it included. Can be attached to the document/email by adding another parameter to the zen_mail function that has either the full path to the image or just the relative path to the image or could "build" the file(s) that are to be attached. Another way is to incorporate the image into the email body message generating a link to the image that uses the full uri to reach it.

    The image information is already included in the sql return, just need to use it for the desired effect.

    To include as an attachment around line 103 change:
    Code:
        zen_mail($send_to_name, $send_to_email, EMAIL_SUBJECT, $text_message, $name, $email_address, $html_msg,'contact_us');
    to:
    Code:
        zen_mail($send_to_name, $send_to_email, EMAIL_SUBJECT, $text_message, $name, $email_address, $html_msg,'contact_us', DIR_FS_CATALOG . DIR_WS_IMAGES . $product_info->fields['products_image']);
    To incorporate in the email as part of the "text" recommended methods have been to build an html image tag with the image referenced within the tag as if to get to it via URL: ie. https: // your store . com/ images / my-email-img.jpg

    This can be done with zen_href_link to build the address and some additional text in either/both the text version and the html version of the email. Then for the html version it may just be better to create a separate variable to be populated instead of "cramming" in with text and the added difficulty of manipulating it, but to each their own.

    Incorporating the image into the plain text message (at least the uri is generated) would be by changing:
    Code:
        // Prepare Text-only portion of message
        $text_message = OFFICE_FROM . "\t" . $name . "\n" .
        OFFICE_EMAIL . "\t" . $email_address . "\n" .
        PROD_NAME . "\t" . $product_info->fields['products_name'] . "\n" .  
        zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$_GET['products_id']) .
        "\n\n" .  
    
        '------------------------------------------------------' . "\n\n" .
        strip_tags($_POST['enquiry']) .  "\n\n" .
        '------------------------------------------------------' . "\n\n" .
        $extra_info['TEXT'];
    To:
    Code:
        // Prepare Text-only portion of message
        $text_message = OFFICE_FROM . "\t" . $name . "\n" .
        OFFICE_EMAIL . "\t" . $email_address . "\n" .
        PROD_NAME . "\t" . $product_info->fields['products_name'] . "\n" .  
        zen_image(($request_type == 'SSL' ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG) . DIR_WS_IMAGES . $product_info->fields['products_image'], $product_info->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . "\n" .
        zen_href_link(zen_get_info_page((int)$_GET['products_id']), 'products_id=' . (int)$_GET['products_id']) .
        "\n\n" .  
    
        '------------------------------------------------------' . "\n\n" .
        strip_tags($_POST['enquiry']) .  "\n\n" .
        '------------------------------------------------------' . "\n\n" .
        $extra_info['TEXT'];
    The HTML email message could be modified as follows (or any other way as well):
    from:
    Code:
        // Prepare HTML-portion of message
        $html_msg['EMAIL_MESSAGE_HTML'] = '<b>Product: </b><a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$_GET['products_id']) . '">' . $product_info->fields['products_name'] . '</a><br />' . strip_tags($_POST['enquiry']);
    To:
    Code:
        // Prepare HTML-portion of message
        $html_msg['EMAIL_MESSAGE_HTML'] = '<b>Product: </b><a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$_GET['products_id']) . '">' . $product_info->fields['products_name'] . zen_image(($request_type == 'SSL' ?  HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG) .  DIR_WS_IMAGES . $product_info->fields['products_image'],  $product_info->fields['products_name'], SMALL_IMAGE_WIDTH,  SMALL_IMAGE_HEIGHT) . '</a><br />' . strip_tags($_POST['enquiry']);
    This puts the image after (may end up below or to the right of) the product's name. Include additional surrounding html tags to support improved/easier css handling.

    Hope that helps. Note, images are not likely to be displayed in the non-html version of the email... Afterall, supposed to be plain text right? to generate just the link, well, would use:
    Code:
        // Prepare Text-only portion of message
        $text_message = OFFICE_FROM . "\t" . $name . "\n" .
        OFFICE_EMAIL . "\t" . $email_address . "\n" .
        PROD_NAME . "\t" . $product_info->fields['products_name'] . "\n" .  
          ($request_type == 'SSL' ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG  : HTTP_SERVER . DIR_WS_CATALOG) . DIR_WS_IMAGES .  $product_info->fields['products_image'] . "\n" .
        zen_href_link(zen_get_info_page((int)$_GET['products_id']), 'products_id=' . (int)$_GET['products_id']) .
        "\n\n" .  
    
        '------------------------------------------------------' . "\n\n" .
        strip_tags($_POST['enquiry']) .  "\n\n" .
        '------------------------------------------------------' . "\n\n" .
        $extra_info['TEXT'];($request_type == 'SSL' ?  HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG) .  DIR_WS_IMAGES . $product_info->fields['products_image']
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #356
    Join Date
    May 2007
    Posts
    124
    Plugin Contributions
    0

    Default Re: Ask A Question

    Thanks so much
    the attachment method works great.

  7. #357
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: Ask A Question

    Quote Originally Posted by mikebr View Post
    Thanks so much
    the attachment method works great.
    Thanks for the update/report. Glad that method resolves the concern. Were any of the other methods attempted and if so issues found that need to be corrected?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #358
    Join Date
    Jan 2018
    Posts
    165
    Plugin Contributions
    4

    Default Re: Ask A Question

    This works great only problem I am having is showing the image of the button. I am using responsive classic template on 1.5.5f

    I uploaded button_ask_question.gif to includes/templates_default/buttons/English

    I uploaded ask_a_question_defines.php to includes/languages/English

    and button displays but not the image I wanted. What am I doing wrong?

  9. #359
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,696
    Plugin Contributions
    123

    Default Re: Ask A Question

    Right click on the button and use your browser's "Open Image in New Tab" function (this is what it's called in Chrome; might be different in your browser.) Then you'll see where the image is being pulled from. This will help you narrow down what's happening.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  10. #360
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default Re: Ask A Question

    Quote Originally Posted by tmccaff View Post
    This works great only problem I am having is showing the image of the button. I am using responsive classic template on 1.5.5f

    I uploaded button_ask_question.gif to includes/templates_default/buttons/English

    I uploaded ask_a_question_defines.php to includes/languages/English

    and button displays but not the image I wanted. What am I doing wrong?
    Quote Originally Posted by swguy View Post
    Right click on the button and use your browser's "Open Image in New Tab" function (this is what it's called in Chrome; might be different in your browser.) Then you'll see where the image is being pulled from. This will help you narrow down what's happening.
    As answered in the other posting of this issue, the button-image is not being displayed because the store is set up to use CSS buttons.

 

 
Page 36 of 40 FirstFirst ... 263435363738 ... LastLast

Similar Threads

  1. Ask A Question module
    By okibi in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 18 Apr 2007, 01:55 PM
  2. Ask a question 1.7
    By Kodam in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 4 Apr 2007, 11:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR