Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2009
    Location
    Essex, UK
    Posts
    446
    Plugin Contributions
    0

    application error Related Products 1.5

    Hi

    I am using https://www.zen-cart.com/downloads.php?do=file&id=1065 on my website and so far it looks great. However on one page I have only 2 related products to add https://shaftdirect.com/office-seati...air-p-112.html

    The width are set to 50% as default but this results in the products showing vertically instead of horizontally. I have tried to locate any margin or padding and nothing seems to work.

    When I set the width to 49% it appears how it should.

    Please could anyone advise how I can override this issue? For example if theres 2 columns set the width to 49% not 50%?

    I welcome any help.

    Kind regards
    Debbie Harrison
    DVH Design | Web Design blog

  2. #2
    Join Date
    Jan 2019
    Location
    New Zealand
    Posts
    38
    Plugin Contributions
    0

    Default Re: Related Products 1.5

    Hi dharrison,
    Have you tried to change the styleshet.css
    HTML Code:
    .centerBoxContentsRelatedProduct{float:left;}
    so they can stack beside each other?
    Regards raptar

  3. #3
    Join Date
    Mar 2009
    Location
    Essex, UK
    Posts
    446
    Plugin Contributions
    0

    Default Re: Related Products 1.5

    Thanks @raptar. That does remedy the issue. However now I have this issue: https://shaftdirect.com/the-deluxe-m...ress-p-38.html

    If I could just adjust the width in this case then it should work. 3 columns is set to 33% so I have no issue there.
    Last edited by dharrison; 20 Aug 2019 at 01:40 PM. Reason: seems like I cannot spell either
    Debbie Harrison
    DVH Design | Web Design blog

  4. #4
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Related Products 1.5

    In includes/modules/related_products.php, if you add the $col_width assignment just below the existing assignment for both cases (the first around line 43), it seems as if you may get the desired results:
    Code:
    if ($num_products_count == 2) {
      $col_width = 49;
    }
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

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

    Default Re: Related Products 1.5

    FYI, when I went to the page of the most recent product, there was a mixed content notification. Suggest resolving that in addition to whatever you're working on.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Mar 2009
    Location
    Essex, UK
    Posts
    446
    Plugin Contributions
    0

    Default Re: Related Products 1.5

    Thanks mc

    I tried that

    Code:
    // show only when 1 or more
    if ($num_products_count > 0) {
      if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS == 0) {
        $col_width = floor(100/$num_products_count);
    
    if ($num_products_count == 2) {
      $col_width = 49;
    }
    	
      } else {
        $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS);
      }
      while (!$featured_products->EOF) {
    But no joy.

    When you say "Mixed content" what do you mean? I haven't seen that
    Debbie Harrison
    DVH Design | Web Design blog

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

    Default Re: Related Products 1.5

    Quote Originally Posted by dharrison View Post
    Thanks mc

    I tried that

    Code:
    // show only when 1 or more
    if ($num_products_count > 0) {
      if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS == 0) {
        $col_width = floor(100/$num_products_count);
    
    if ($num_products_count == 2) {
      $col_width = 49;
    }
    	
      } else {
        $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS);
      }
      while (!$featured_products->EOF) {
    But no joy.

    When you say "Mixed content" what do you mean? I haven't seen that
    What's the value of SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS?

    Mixed content, displaying/linking to https: type items while also doing so to http: type items. Like script source code accessing http: while other script code referencing http:.

    For example, the following is specifically causing this plus any others that might be on the page:
    Code:
    <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js" type="text/javascript"></script>
    On the issue of the previous file, did it get installed into the template override folder?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Mar 2009
    Location
    Essex, UK
    Posts
    446
    Plugin Contributions
    0

    Default Re: Related Products 1.5

    Hi mc

    What's the value of SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS?
    3 which is the default. so is the SHOW_PRODUCT_INFO_COLUMNS_RELATED_PRODUCTS

    For example, the following is specifically causing this plus any others that might be on the page:
    Code:

    <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js" type="text/javascript"></script>
    OK I have changed this to https://. But only really saw this as a potential issue. http is referencing other sites in a few cases of my code but I cannot see how this would have any affect on the rest of my code. Plus not all websites are https:// yet.

    I have tried the code again and using https://shaftdirect.com/office-seati...air-p-110.html as an example, it hasn't worked.
    Debbie Harrison
    DVH Design | Web Design blog

  9. #9
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Related Products 1.5

    Quote Originally Posted by dharrison View Post
    Thanks mc

    I tried that

    Code:
    // show only when 1 or more
    if ($num_products_count > 0) {
      if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS == 0) {
        $col_width = floor(100/$num_products_count);
    
    if ($num_products_count == 2) {
      $col_width = 49;
    }
        
      } else {
        $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS);
      }
      while (!$featured_products->EOF) {
    But no joy.

    When you say "Mixed content" what do you mean? I haven't seen that
    There is still something "not right" here... I am looking at the code that is provided with the module and looking at the result on the site. With the above suggested code, given that SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS == 3, $num_products_count == 2, this means that the first section of the if statement is expected to be followed and therefore initially $col_width would be set to 50. But, then because $num_products_count == 2, the next inner code is expected to be executed which sets $col_width == 49. There is no code that follows modifying $col_width therefore when the html is assembled for the product the width:49% should be applied.

    This brings me back to the question of if includes/modules/winchester_responsive/related_products.php exists. If it does, then the change recommended above about using the if ($num_products_count == 2) … should be applied to that file. Otherwise, verify that the file has been saved and/or that it is not write protected in trying to save it.

    Quote Originally Posted by dharrison View Post
    Hi mc



    3 which is the default. so is the SHOW_PRODUCT_INFO_COLUMNS_RELATED_PRODUCTS



    OK I have changed this to https://. But only really saw this as a potential issue. http is referencing other sites in a few cases of my code but I cannot see how this would have any affect on the rest of my code. Plus not all websites are https:// yet.

    I have tried the code again and using https://shaftdirect.com/office-seati...air-p-110.html as an example, it hasn't worked.
    There are some "nuances" about what can/can not begin with http: For example a straight out clickable link, depending on the browser, could begin with http:, but an image or a script's "src=" should not be different than the presented page. Some ways around the "concern" of one or the other includes using no prefix and just beginning with the double forward slash followed by the domain name and remainder of the address, otherwise to use say $request_type to identify whether it should begin with https: or http: respectfully (if $request_type == 'SSL' then https: should be used otherwise http:).

    Anyways, I also now see that there are 2 console issues identified when using Microsoft Edge and that there appear to be four unmatched end tags which could play a factor in how things are displayed (ie. could be the cause of your problem and all this "math" stuff may not be necessary.

    Suggest running the page through an HTML validator in some way or fashion to be sure that the template and page are formatted correctly and then work on the display issues.
    Last edited by mc12345678; 21 Aug 2019 at 03:15 AM. Reason: Remove formatting applied by Microsoft Edge when pasting
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #10
    Join Date
    Jan 2019
    Location
    New Zealand
    Posts
    38
    Plugin Contributions
    0

    Default Re: Related Products 1.5

    Try changing
    HTML Code:
    .centerBoxContentsRelatedProduct { display: inline-block;}
    to
    HTML Code:
    .centerBoxContentsRelatedProduct {display: inline-table;}

 

 

Similar Threads

  1. Related Products
    By stueyuk in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 2 Mar 2014, 08:55 PM
  2. Related Products
    By cs_jono in forum General Questions
    Replies: 1
    Last Post: 2 Apr 2010, 10:46 AM
  3. Related Products?
    By wforeman in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 21 Mar 2010, 01:52 PM
  4. Related Products????
    By ibit-matt in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 12 Sep 2008, 08:14 AM
  5. Related products
    By shaunbarton in forum Setting Up Specials and SaleMaker
    Replies: 3
    Last Post: 3 Aug 2007, 02:28 AM

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