Jump to content

Tsimi

♥Ambassador
  • Content count

    2,353
  • Joined

  • Last visited

  • Days Won

    85

Posts posted by Tsimi


  1. 7 hours ago, ArtcoInc said:

    @Tsimi Lambros, will you be updating this to work with Phoenix? I've already made the changes here, but would rather you get the credit for keeping your code up to date (as well as not introduce my mistakes 🙄 )

    M

    Hi Malcolm

    I don't think I'll be updating any of my add-ons. I'm hanging back a bit and see how things develop. 

    I barely have anything to do with osC or coding in general at the moment. So please go ahead and upload your version. I added you as admin for this add-on so you can upload anytime.

    Thx and regards 

    Lambros


  2. @Rosyweb

    Hi Ros

    You mean you just want to have the parent categories inside the menu without the sub-categories dropdown function right?
    If yes then do the following changes inside the classes/catmenu.php file

    FIND (around line 44)
     

    		  if (isset($this->_data[$category_id]) && ($level != 0)) {
                $result .= '<li class="dropdown dropdown-submenu"><a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">';
                $caret = '';
              } elseif(isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
                $result .= $this->root_start_string;
                $result .= '<a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">';
                $caret =   ' <span class="fas fa-caret-down"></span>';
                			
              } else {
                $result .= $this->child_start_string;
                $result .= '<a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">';           
                $caret = false;
              }

    REPLACE WITH
     

    		/*  if (isset($this->_data[$category_id]) && ($level != 0)) {
                $result .= '<li class="dropdown dropdown-submenu"><a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">';
                $caret = '';
              } elseif(isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
                $result .= $this->root_start_string;
                $result .= '<a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">';
                $caret =   ' <span class="fas fa-caret-down"></span>';
                			
              } else {*/
                $result .= $this->child_start_string;
                $result .= '<a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">';           
                $caret = false;
            //  }

    Now you should only see the parent categories without any dropdown feature. The show image function still works if needed.
    If you use this together with the XS menu, which you shouldn't if you only use parent categories, then you'll have to add the following changes to the classes/catmenu_xs.php file.

    FIND
     

    		  if (isset($this->_data[$category_id]) && ($level != 0)) {
    // HAS MORE SUBCATEGORIES			  
                $result .= '<li><a href="#">';	   
              } elseif(isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
    // PARENT HAS CHILD CATEGORIES			  
                $result .= $this->root_start_string;
                $result .= '<a href="#">';          			
              } else {
    // NO SUBCATEGORIES			  
                $result .= $this->child_start_string;
                $result .= '<a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">';
                $caret = false;
              }
    		  $caret = '';
              $result .= str_repeat($this->spacer_string, $this->spacer_multiplier * $level);
    // CATEGORY NAMES		  
              $result .= $link_title . (($caret != false) ? $caret : null) . '</a>';
    
    		  
              if(isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
                // show parent category link //	    
    			$root_link_title =  '<strong><span class="fas fa-list fa-lg"></span>&nbsp;' . $link_title . '</strong>';
    						
                $result .= $this->parent_start_string;
        // divider added for clarity //            
            if (MODULE_CONTENT_HEADER_CATMENU_XS_DIVIDER == 'True') {
                $result .= '<li style="border-bottom:solid 1px #e5e5e5;"><a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">' . $root_link_title . '</a></li>';
            } else {
                $result .= '<li><a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">' . $root_link_title . '</a></li>';
            }
                $result .= $this->_buildHoz_xs($category_id, $level + 1);
                $result .= $this->parent_end_string;
                $result .= $this->child_end_string;
              } else {
                $result .= $this->root_end_string;
              }

    REPLACE WITH
     

    		 /* if (isset($this->_data[$category_id]) && ($level != 0)) {
    // HAS MORE SUBCATEGORIES			  
                $result .= '<li><a href="#">';	   
              } elseif(isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
    // PARENT HAS CHILD CATEGORIES			  
                $result .= $this->root_start_string;
                $result .= '<a href="#">';          			
              } else {*/
    // NO SUBCATEGORIES			  
                $result .= $this->child_start_string;
                $result .= '<a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">';
                $caret = false;
            //  }
    		//  $caret = '';
             // $result .= str_repeat($this->spacer_string, $this->spacer_multiplier * $level);
    // CATEGORY NAMES		  
              $result .= $link_title . (($caret != false) ? $caret : null) . '</a>';
    
    		  
       /*       if(isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
                // show parent category link //	    
    			$root_link_title =  '<strong><span class="fas fa-list fa-lg"></span>&nbsp;' . $link_title . '</strong>';
    						
                $result .= $this->parent_start_string;
        // divider added for clarity //            
            if (MODULE_CONTENT_HEADER_CATMENU_XS_DIVIDER == 'True') {
                $result .= '<li style="border-bottom:solid 1px #e5e5e5;"><a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">' . $root_link_title . '</a></li>';
            } else {
                $result .= '<li><a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">' . $root_link_title . '</a></li>';
            }
                $result .= $this->_buildHoz_xs($category_id, $level + 1);
                $result .= $this->parent_end_string;
                $result .= $this->child_end_string;
              } else {*/
                $result .= $this->root_end_string;
              //}

     

    That should do it.


  3. @raiwa

     

    Quote

    I do have no plans to update add-ons to EDGE BS4 right now. My plans are to wait for the next stable release, CE BS4 or official BS4

    I didn't mean to put more work into your hands. That was not my intention. Just wanted to check if something is wrong on my end.
    I couldn't agree more. Updating an add-on for various CE versions is becoming a bit of a pain in the rear. Better wait for a release or more close to final version.
     

    Quote

    As a general suggestion I would use the opportunity to remove the ht-module and replace it by  a hook or better by a content module for the checkout_payment page.

    A content module sounds like a winner to me. Adding one line into a file won't give anyone a hard time and is fairly easy to do.
    I thought if it is a simple change of classes inside the javascript code then I could quickly do that but it didn't work for me.

    Quote

    Played with the shopping cart and ht module under EDGE BS4 and got it to show up correct, but couldn't get the validation script to work. I always get unvalidated icon. The same when I tried with your hardcoded solution. Do you have the same issue?

    I do not have those issues.
    When I enter the discount code into the input field the check icon or ban icon show up just fine. Even before I changed them to FontAwesome v5.
    I only have problems to position the input field in the right spot just before the comments input field as it suppose to be.
    I will try to find time during the weekend and reinstall another EDGE BS4 test shop in my local server which btw. runs on PHP 7.1, and give it another try.


  4. Discount Codes v4.4.2 BS works with osC BS4 at least the back end part where you add and register discount codes and the checkout_confirmation part. However it does fail to inject the code from the header tags module into the checkout_payment.php page.
    Not sure if this is an issue only on my side though. Clean Edge BS4 and only Discount Codes 4.4.2 BS installed.

    There is a javascript code inside the header tags file which checks for certain classes and then inject the code before that.

    $('div.contentContainer div.contentText .form-group').parent()

    That is why in the install manual it says

    Quote

    IMPORTANT: Make sure the following original code is present and not altered or uncommented in checkout_payment.php:
               The ht module uses this code as a reference to inject the discount code input field.

    Even if I manually add those classes to the checkout_payment.php file or if I alter the javascript code to match the BS4 classes structure it just won't show anything on the payment page.

    So I added the whole javascript code at the very bottom of the checkout_payment.php file and now we finally can see the input field BUT! it is placed in the wrong position. No matter what classes you add or what you try to do to get it injected it always shows at the same spot right after the HEADING_TITLE part.
    Changing the following code inside  the HT  module does inject the input field but again in the wrong, same, position.

     var $group = 'header_tags';

    to this

     var $group = 'footer_scripts';

    Not sure what the exact issue is. I haven't touched osC code in a while and I am absolutely not familiar with the changes in the latest Edge version.
    I did manage to add the input field by simply hard coding it into the checkout_payment.php file which is as we all know not the best way to do it but until we can figure out why it isn't injecting or injecting in the right place this should do the trick.
    (fixed code to match latest BS4 and FontAwesome standards)

    FIND

      <hr>
     
      <div class="form-group row">
        <label for="inputComments" class="col-form-label col-sm-4 text-sm-right"><?php echo TABLE_HEADING_COMMENTS; ?></label>
        <div class="col-sm-8">
          <?php
          echo tep_draw_textarea_field('comments', 'soft', 60, 5, $comments, 'id="inputComments" placeholder="' . TABLE_HEADING_COMMENTS . '"');
          ?>
        </div>
      </div>


     ADD BEFORE

    <h2><?php echo TEXT_DISCOUNT_CODE; ?></h2>
    <div class="col-xs-6 col-sm-3">
        <div class="form-group row">
            <input type="text" class="form-control" name="discount_code" value="<?php echo isset($sess_discount_code) ? $sess_discount_code : ''; ?>" id="discount_code" />
            <span class="form-control-feedback" id="discount_code_status" style="right:0;"></span>
        </div>
    </div>

    FIND

    <?php
      require('includes/template_bottom.php');
      require('includes/application_bottom.php');
    ?>

    ADD AFTER

    <script type="text/javascript">
        $(document).ready(function () {
            var a = 0;
            discount_code_process();
            $('#discount_code').blur(function () {
                if (a == 0)
                    discount_code_process();
                a = 0
            });
            $("#discount_code").keypress(function (event) {
                if (event.which == 13) {
                    event.preventDefault();
                    a = 1;
                    discount_code_process();
                }
            });
            function discount_code_process() {
                if ($("#discount_code").val() != "") {
                    $("#discount_code").attr("readonly", "readonly");
                    $("#discount_code_status").empty().append('<i class="fas fa-cog fa-spin fa-lg">&nbsp;</i>');
                    $.post("discount_code.php", {discount_code: $("#discount_code").val()}, function (data) {
                        data == 1 ? $("#discount_code_status").empty().append('<i class="fas fa-check fa-lg" style="color:#00b100;"></i>') : $("#discount_code_status").empty().append('<i class="fas fa-ban fa-lg" style="color:#ff2800;"></i>');
                        $("#discount_code").removeAttr("readonly");
                    });
                }
            }
        });
    </script>

    @raiwa

    Do you have this properly running on a Edge BS4 store? I mean including injected HT module?


  5. @Demitry

    Ok, I had a look at my specials code and it is not what you are looking for. Actually it is same as the see more button currently inside the Featured Products BS add-on.
    But I started to do some research and found a solution. It was easier than I thought.

    You need to use a select count(*) query to get the current total amount of featured products and you only want to get the ones that are set to f.status 1
    So this is what I came up with

    Open your index module featured file

    FIND:

    if (tep_db_num_rows($featured_products_query) > 0) { // Show only if we still have products in the array

    ADD BEFORE:

    $featured_count_query = tep_db_query("select count(*) as total from featured WHERE status = '1'");
    $featured_count = tep_db_fetch_array($featured_count_query);


    Now you can use this here to hide/show the button.

    if ($featured_count['total'] > MODULE_CONTENT_INDEX_FEATURED_PRODUCTS_CONTENT_LIMIT) {
    BUTTON CODE HERE
    }

    Let me know if that works for you.


  6. @Rosyweb

    Hi Ros

    1) Yes

    2) Yes

    When you tick for example the check box for Products you will have to choose one or multiple or even all products from the list below that checkbox (small inframe)
    To select multiple products on a Windows PC just keep holding the CTRL button and click the products that you want to allow to apply that coupon code.
    To simply select all products just click the very first product and then scroll all the way down and hold the SHIFT button and click the last product on the list now all products within the list should be selected. Then click the save button.
    If you don't select any product it won't do anything when you click the save button. Same goes for Categories or Manufacturers or Customers.


  7. @raiwa

    As far I know the "exclude specials" feature only worked when you check any other checkbox (products, categories, manufacturers, customers) except for order total. If you apply a discount on order total it does not check what products are inside it only takes the sub-total value.

    I just did a quick test and it does work just fine with let's say checked Products and select all products inside it.
    I am not sure however if the exclude specials feature ever worked with order total in the version that we based this BS on. That would need further investigation but I highly doubt it ever did.

     


  8. @ce7

    Ah! Now I understand.
    Looks like the dropdown is a bit short for your setup.
    Please open the following file

    ../includes/modules/content/header/templates/catmenu.php

    FIND
     

    .menu_custom_width {
     min-width: 200px;
    }

    change the pixel number to something more matching for you. Maybe try 230px or 250px?
    Also please update the font awesome path inside the templates_top.php file

    Look here

×