Results 1 to 6 of 6
  1. #1
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default INSTRUCTIONS: Convert Ask a Question Link to a Button

    add this to the includes/languages/english/your_template/button_names.php (putting them in alphabetically in the correct sections makes sense to me) If you don't have this in that directory, pull the default file from includes/english/

    PHP Code:
    define('BUTTON_IMAGE_ASK_QUESTION','button_ask_question.gif');
    define('BUTTON_ASK_QUESTION_ALT','Ask a Question About This Product'); 
    If you are going to use a button instead of the CSS, don't forget to create one!

    in includes/templates/your_template/templates/product_info.php, change
    HTML Code:
    <span id="productQuestions" class="biggerText">
    <b><?php echo '<a href="' . zen_href_link(FILENAME_ASK_A_QUESTION, 'pid=' . $_GET['products_id'], 'SSL') . '">' . ASK_A_QUESTION . '</a>'; ?></b>
    </span>
    to this
    <span id="productQuestions" class="buttonRow back">
    <?php echo '<a href="' . zen_href_link(FILENAME_ASK_A_QUESTION, 'pid=' . $_GET['products_id'], 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_ASK_QUESTION, BUTTON_ASK_QUESTION_ALT) . '</a>'; ?>
    </span>

    Note the removal of the <b></b> (who left that in?) This looks way better and no longer fades into the page.
    Last edited by swguy; 28 Jun 2021 at 07:32 PM.
    The full-time Zen Cart Guru. WizTech4ZC.com

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,151
    Plugin Contributions
    11

    Default Re: INSTRUCTIONS: Convert Ask a Question Link to a Button

    Sorry if I am missing something here.

    To what version of 1.5.7 does this apply? Asking as none of this matches my basic 1.5.7c and these items are already in the default folder of includes/languages/english/button_names.php of the 1.5.7c I'm using.

    Doesn't seem to be any lingering <b> tags in the product_info_display.php in the template_default or responsive_classic although on different lines in each.

  3. #3
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default Re: INSTRUCTIONS: Convert Ask a Question Link to a Button

    My downloaded version zen-cart-v1.5.7c-03052021.zip does have the template_default product_info_display with the <b> still in it.

    Button_names does have define('BUTTON_IMAGE_ASK_A_QUESTION', 'button_ask_a_question.gif'); but no alt in the file. I didn't realize the gif was in that file but it was still incomplete if you are using CSS buttons which I would hope folks realize is best practice. The actual button does exist as it turns out. So my instructions were not completely correct. Still a need for my post in the end.
    The full-time Zen Cart Guru. WizTech4ZC.com

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

    Default Re: INSTRUCTIONS: Convert Ask a Question Link to a Button

    For those who might be looking at other templates, the Bootstrap template renders Ask a Question as a button.

    https://vinosdefrutastropicales.com/...products_id=23
    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.

  5. #5
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,151
    Plugin Contributions
    11

    Default Re: INSTRUCTIONS: Convert Ask a Question Link to a Button

    You are correct on the <b>. I was looking at a recent install and the customer removed the tag. And, I agree it should have been left to CSS to style it as needed.

    The ALT define is in the default button_names.php (line 109) but far away from the gif define at line 55. Adding an ALT define after the gif will unfortunately not ever show anything but line 109's 'Ask a Question'. Any desired change to the ALT wording would best be done on line 109.

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

    Default Re: INSTRUCTIONS: Convert Ask a Question Link to a Button

    Don't forget or if you didn't know it, when editing the button_names.php file, be sure that are using the template override file if it exists, e.g. includes/languages/english/your_template/button_names.php *AND* that the file includes all of the defines/information of the core version of the file. Unlike other language files, this is one that is either loaded from the override (if exists) or the core version (if override doesn't exist). Others more typically loaded with override followed by core to where both files are loaded.

    Not carrying over defines from the core/base file to the override will result in missing definitions at the time/point of need.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Adding Product ID to a link - Ask A Question Addon?
    By hsart in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 28 May 2010, 10:37 AM
  2. Ask a question mod, button moving
    By mcpisik in forum General Questions
    Replies: 0
    Last Post: 9 Apr 2010, 07:56 PM
  3. Replies: 2
    Last Post: 4 Oct 2006, 03:17 PM
  4. Adding button to ask a question mod
    By ctcentralinfo in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 8 Sep 2006, 12:52 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