Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Jul 2020
    Location
    USA
    Posts
    68
    Plugin Contributions
    0

    Default Extras Record Companies Image

    ZC 157c

    I am trying to get the record companies image to appear at the bottom of product pages. It would be centered with a place to put a sentence or two to the right of the label image.

    Using the following code, that I took from part of a code from post #11 from this thread: https://www.zen-cart.com/showthread....t=artist+image


    PHP Code:
    <!--bof record company url and image -->
    <?php
    if (zen_not_null($products_record_company_url)) {
    if (
    $flag_show_product_music_info_record_company == 1) {
    ?>
    <p id="productInfoLink" class="productMusic centeredContent">For more information, you can visit the <a href=<?php echo sprintf(TEXT_RECORD_COMPANY_URLzen_href_link(FILENAME_REDIRECT'action=url&goto=' urlencode($products_record_company_url), 'NONSSL'truefalse)); ?> >webpage</a> of manufacturer.</p>
    <?php
    }// $flag_show_product_info_record_company
    }
    ?>
    <?php 
    echo sprintf('<a href="' TEXT_RECORD_COMPANY_URLzen_href_link(FILENAME_REDIRECT'action=url&goto=' urlencode($products_record_company_url), 'NONSSL'truefalse) . '">' zen_image(DIR_WS_IMAGES $record_company->fields['record_company_image']) . '</a>'); ?>
    And that gives me this, which you can see at the bottom of this page. https://fuzztrip.com/lp-c-1/bonzai-s...-lp-p-215.html

    Name:  Capture.jpg
Views: 62
Size:  22.2 KB

    So, I would need text in the red and would like the image to link to https://fuzztrip.com/index.html?type...company_id=119 (or whatever the ID is).

    This is beyond my ability and any push in the right direction would be great. Thanks!

  2. #2
    Join Date
    Jul 2020
    Location
    USA
    Posts
    68
    Plugin Contributions
    0

    Default Re: Extras Record Companies Image

    If nothing else can anybody tell how/where the link would go, or to remove the link completely? Everything I try produces a blank page or has no effect. Thanks!

  3. #3
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    8,079
    Plugin Contributions
    9

    Default Re: Extras Record Companies Image

    First of all, you put this inside a form. Not the best way to go as you have to really munge the form to control the image and its associated items.

    If you right-click on the Made of Stone image and select inspect, you'll see that you placed the new info between <! -- eof Product date added/available and <! -- bof Product URL.

    And, you are ending the addition with <! -- eof Product URL --> versus <! -- eof record company url and image -->. It should probably be the latter.

    I would add a div to surround the code.
    Code:
    <!--bof record company url and image --><div id="fuzzRecord">
    CODE you developed here
    </div>
    <!--eof record company url and image -->
    And place it AFTER the closing </div> for
    Code:
    <div class="centerColumn" id="productMusicDisplay" style>
    BTW, that should not have the style alone in the div.

    You may finde the right line of the document by using the Developers Tool Kit to search for <!--bof Form close--> and putting the code after the following </div>

    Since the div would be that last in the center column, that gives ultimate control to all facets of that display without having to mess with any other aspect of the page.

    Your code is incorrect as it produces this link
    Code:
    <a href="See all titles available from this label<a href="https://fuzztrip.com/index.php?main_page=redirect&amp;action=url&amp;goto="><img src="images/made_of_stone_recordings.jpg" alt="" width="250" height="250" /></a>" rel="noreferrer noopener" target="_blank">webpage</a>
    Note that the tag seems to begin with an alt tag embedded where the URL should be. Then, it starts over with the actual link BUT, it's still in the first href.

    I'm thinking that 13 year old code is just not gonna work.

    I don't know what happened to the original "For more information, you can visit the " That was in front of this in the original code.

    Nor, can I figure out where you got the noreferrer and _blank. Obviously, added since you inserted the code.

    Perhaps you can use line 249 of includes/templates'responsive+classic/templates/tpl_product_music_info_display.php to get closer to what you want. As a minimum, the original code is probably missing the double quotes.
    Code:
    <p id="productInfoLink" class="productMusic centeredContent">For more information, you can visit the <a href="<?php echo sprintf(TEXT_RECORD_COMPANY_URL, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_record_company_url), 'NONSSL', true, false)); ?>">webpage</a> of manufacturer.</p>
    Did you read the posting tips?!?
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free Domain, SSL, and Magic Thumb with Semi-Annual or longer plan.

  4. #4
    Join Date
    Jul 2020
    Location
    USA
    Posts
    68
    Plugin Contributions
    0

    Default Re: Extras Record Companies Image

    I've managed to clean it up so only the image appears. I still can't figure out how to completely remove the link from the image without producing a blank page.

    I think this is the line I need to edit
    PHP Code:
    <?php echo sprintf('' TEXT_RECORD_COMPANY_URLzen_href_link(FILENAME_REDIRECT'action=url&goto=' urlencode($products_record_company_url), 'NONSSL'truefalse) . '">' zen_image(DIR_WS_IMAGES $record_company->fields['record_company_image']) . '</a>'); ?>
    but I don't know what to do with it. Thanks!

  5. #5
    Join Date
    Jul 2020
    Location
    USA
    Posts
    68
    Plugin Contributions
    0

    Default Re: Extras Record Companies Image

    I just saw this. I'll get on it and get back. Thank you!

  6. #6
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    8,079
    Plugin Contributions
    9

    Default Re: Extras Record Companies Image

    You've got to fit everything into the standard a <a href listing.
    Code:
    <a href="url">link text</a>
    You are basically missing the two double quotes.

    Then, you need to make sure the code that takes the place of url is correct.

    After that's correct, you can add the alt tag and any other extras as needed.
    Last edited by dbltoe; 19 Jul 2021 at 10:55 PM. Reason: more info
    Did you read the posting tips?!?
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free Domain, SSL, and Magic Thumb with Semi-Annual or longer plan.

  7. #7
    Join Date
    Jul 2020
    Location
    USA
    Posts
    68
    Plugin Contributions
    0

    Default Re: Extras Record Companies Image

    I have put the original code back to where it started. Then added

    PHP Code:
    <!--bof Product URL -->
    <?php
      
    if (zen_not_null($products_record_company_url)) {
        if (
    $flag_show_product_music_info_record_company == 1) {
    ?>
        <p id="productInfoLink" class="productMusic centeredContent"><?php echo sprintf(TEXT_RECORD_COMPANY_URLzen_href_link(FILENAME_REDIRECT'action=music_record_company&record_company_id=' zen_output_string_protected($music_extras->fields['record_company_id']), 'NONSSL'truefalse)); ?></p>
    <?php
        
    // $flag_show_product_info_record_company
      
    }
    ?>
    <!--eof Product URL -->
    and

    PHP Code:
    <!--bof record company url and image -->
    <div id="fuzzRecord">
    <?php
    if (zen_not_null($products_record_company_url)) {
    if (
    $flag_show_product_music_info_record_company == 1) {
    ?>
    <p id="productInfoLink" class="productMusic centeredContent">For more information, you can visit the <a href=<?php echo sprintf(TEXT_RECORD_COMPANY_URLzen_href_link(FILENAME_REDIRECT'action=url&goto=' urlencode($products_record_company_url), 'NONSSL'truefalse)); ?> >webpage</a> of manufacturer.</p>
    <?php
    //$flag_show_product_info_record_company
    }
    ?>
    <?php 
    echo sprintf('' TEXT_RECORD_COMPANY_URLzen_href_link(FILENAME_REDIRECT'action=url&goto=' urlencode($products_record_company_url), 'NONSSL'truefalse) . '">' zen_image(DIR_WS_IMAGES $record_company->fields['record_company_image']) . '</a>'); ?>

    </div>

    <!--eof record company url and image -->

    All of this was copied from the code found in post#11 here https://www.zen-cart.com/showthread....t=artist+image with no changes, but with this part left out.

    PHP Code:
    <!--bof Product artists url and image -->
    <?php if ($flag_show_product_music_info_artist == or $flag_show_product_music_info_genre == or $flag_show_product_music_artist == 1) { ?>
    <ul id="productDetailsList" class="floatingBox back">
    <?php echo (($flag_show_product_music_info_artist == and !empty($products_artist_name)) ? '<li>' TEXT_ARTIST_URL $products_artist_name '</li>' '') . "\n"?>
    <?php
    // $flag_show_product_info_record_company
    ?>
    </ul>
    <br class="clearBoth" />
    <?php
    }
    ?>
    <?php 
    echo sprintf('<a href="' TEXT_ARTIST_IMAGE_URLzen_href_link(FILENAME_REDIRECT'action=url&goto=' urlencode($products_artist_url), 'NONSSL'truefalse) . '">' zen_image(DIR_WS_IMAGES $record_artists->fields['artists_image']). '</a>'); ?>

    <!--eof Product artists url and image -->
    I also created the div fuzzRecord

    I don't know how to proceed from here as this is a little over my head. Ideally I would like to be able to click the image and have all products from that record company come up, but I don't know where the link should go, or how to code it. I would be satisfied just removing the link completely for now but can't figure that out. I appreciate the help

  8. #8
    Join Date
    Jul 2020
    Location
    USA
    Posts
    68
    Plugin Contributions
    0

    Default Re: Extras Record Companies Image

    I also removed the code from <form></form> and put below.

  9. #9
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    8,079
    Plugin Contributions
    9

    Default Re: Extras Record Companies Image

    A simple addition of #fuzzRecord{text-align:center;} will center your logo but, that's not the heart of the problem.

    Your code is still messed up. This is what the code generates.
    Code:
    <!--bof record company url and image --><div id="fuzzRecord">
     <a href="https://fuzztrip.com/index.php?main_page=redirect&amp;action=url&amp;goto="><img src="images/made_of_stone_recordings.jpg" alt="" width="250" height="250" /></a>  </a>
    </div>
    
    
    
    
    <!--eof record company url and image -->
    The first two lines are fine.

    Line three has no where to go. Something needs to tell it that this item is going to https://YOUR_SITE/?main_page=index&t...company_id=119

    Line three also has an extra " </a>" on the end.

    Line three has no alt tag which can be taken care of after the code is correct.

    Lines four and five should not render as blank lines.

    Let's see if we can get a link without the image for now. Make your code
    Code:
    <!--bof record company url and image --><div id="fuzzRecord">
    <?php
    if (zen_not_null($products_record_company_url)) {
    if ($flag_show_product_music_info_record_company == 1) {
    ?>
    <?php echo sprintf(TEXT_RECORD_COMPANY_URL, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_record_company_url), 'NONSSL', true, false); ?>
    </div>
    <!--eof record company url and image -->
    I would hazard a guess that your "Friendly URL" generator is contributing to the problem. Perhaps turning it off for a test.
    Did you read the posting tips?!?
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free Domain, SSL, and Magic Thumb with Semi-Annual or longer plan.

  10. #10
    Join Date
    Jul 2020
    Location
    USA
    Posts
    68
    Plugin Contributions
    0

    Default Re: Extras Record Companies Image

    I have copied and pasted the code you supplied

    PHP Code:
    <!--bof record company url and image --><div id="fuzzRecord">
    <?php
    if (zen_not_null($products_record_company_url)) {
    if (
    $flag_show_product_music_info_record_company == 1) {
    ?>
    <?php 
    echo sprintf(TEXT_RECORD_COMPANY_URLzen_href_link(FILENAME_REDIRECT'action=url&goto=' urlencode($products_record_company_url), 'NONSSL'truefalse); ?>
    </div>
    <!--eof record company url and image -->
    It produces a blank center page and blank right sidebox. I put it back to the way it was for now.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h Record companies on product page
    By doooomed in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 8 Dec 2012, 08:24 PM
  2. record companies shows zeros (Image attached)
    By fadi21 in forum Customization from the Admin
    Replies: 4
    Last Post: 21 Aug 2010, 05:37 PM
  3. Record Companies side box
    By Sushigal in forum General Questions
    Replies: 4
    Last Post: 14 Jul 2009, 12:39 PM
  4. Replies: 1
    Last Post: 19 Jun 2006, 12:12 AM

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