Jump to content

GLWalker

♥Ambassador
  • Content count

    842
  • Joined

  • Last visited

  • Days Won

    37

Posts posted by GLWalker


  1. The above code has a small flaw.

     

    in checkout_shipping.php :

    /* WS5 Wholesale - skip free shipping */  
      if (tep_session_is_registered('wholesale_customers_id')) {
    	$free_shipping = false;
      } else {
        $free_shipping = true;
      }
      /* end WS5 Wholesale */
    

    Should be:

    /* WS5 Wholesale - skip free shipping */  
      if (tep_session_is_registered('wholesale_customers_id')) {
    	$free_shipping = false;
      }
      /* end WS5 Wholesale */
    

    In case of @@xChrysalisx set up, it would work as it was, but if one wants to charge shipping to retail customers, then they need to use the updated snippet above. Otherwise the free shipping will always be triggered for retail.

     

    @@xChrysalisx I still recommend changing yours to the above snippet in case you start charging retail shipping in the future. Its too easy to forget making small changes then wondering why something doesn't work later :)


  2. Sorry for the delay.

     

    Ive checked out how your setup on my local, and this is what I came up with.

     

    Set up your flat rate shipping quote for any price you want (in fact I think you could also switch to table or any other method in the future)

     

    Next - set up your free shipping order_total module to allow free shipping for 0.00 in your case.

     

    Now open checkout_shipping.php; around line 101 find:

    // process the selected shipping method
      if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken) ) {
    

    Above that add:

      /* WS5 Wholesale - skip free shipping */  
      if (tep_session_is_registered('wholesale_customers_id')) {
    	$free_shipping = false;
      } else {
        $free_shipping = true;
      }
      /* end WS5 Wholesale */
    

    Next open includes/modules/order_total/shipping.php and around line 40 find:

            if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
              $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
              $order->info['total'] -= $order->info['shipping_cost'];
              $order->info['shipping_cost'] = 0;
            }
    

    Replace with this:

      /* WS5 Wholesale - skip free shipping */  
    	if (!tep_session_is_registered('wholesale_customers_id')) {
    
            if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
              $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
              $order->info['total'] -= $order->info['shipping_cost'];
              $order->info['shipping_cost'] = 0;
            }
          }
      /* end WS5 Wholesale */
    

    The change in  checkout_shipping.php file will set the free shipping quotes to false if logged in as a wholesale customer.

    The order_total module change will keep the free shipping quote from triggering on the checkout confirmation page.

     

     

    This should work for any store that does not want to give out free shipping VIA order_total module.


  3. Thanks for your feedback.

     

    I set a new weight option to help deal with different shipping cost. Having free for retail and a price for wholesale could be worked out a few different ways, a lot depends on how you currently are set up to offer the retail free price.

     

    Using the wholesale session is the key though, if it exist - do this, if not then default action.

     

    It does make me think that many selling in bulk may also not want to offer free shipping for orders over a set amount that retail orders enjoy, so that would be a fairly straightforward change in checkout_shipping, looking for a wholesale session.

     

    Helpful snippets for varoius procedures that do not fall too far outside the boundaries of a default set up would be good to post here.

     

    Leave more details about how you are currently setup and we'll see what can be done.


  4. @@burt

     

    Tested on local, looks as your screenshot does, performs as expected. Just need the whole row to select the radio when when clicked.

     

    I think I pasted some code for the shipping and payment method tables somewhere a zillion pages back in this thread. I'll have to see if I can find it.

     

    I think that's about the time you said we were not going back to tables, though we are dealing with tabular data. (w00t)


  5. directed to my Original site, but if he is browsing from a phone he will be directed to the responsive site?

     

    Obviously the database would be the same database as would be the admin.

     

    Just asking............

     

    You could probably rip the mobile recognition out of the osc mobile build that has been around for a while now, and use that to redirect to your other folder, or just find another mobile detection script that is available, Ive seen lots of them in the past before responsive frameworks became popular.

     

    But you already know you'll need to make any contribution changes to the bootstrap version as you did your main site, especially if its a mod that involves certain keys being present in the database.

     

    Why not use a compare program and merge your current work into the bootstrap version? Theres nothing changed in the admin, so you'll be in good shape with your old one.


  6. @@burt

     

     

     

    Could you look again please, i really think now all is 100% working as it should.

     

    Looks and performs well on iPhone 5

     

    The only thing I can see would make it a better mobile experience is to make the complete LI row clickable, could probably be done using a data-attributte or simple css rule displaying the a element as block. Not a big deal though.


  7. @@joli1811

     

    Its not showing the full option value because the dropdown has a style attribute coded into it:

    <select name="id[5]" style="width: 200px;" class="form-control"><option value="10">Download: Windows - English</option><option value="13">Box: Windows - English</option></select>
    

     

    Just a matter of removing that, but then BootStrap will take over and make it full width of its containing element.


  8. I have a few more issues to address, Im going to make another fork - as I tend to just rape, plunder and bring mine to a totally hard to follow place -

     

    1) Pagination - there is a bug where you can click on the disabled previous or next link and it sets the URI differently yet reloads the page with the same content.

    2) New Products Module - I know its came up a lot, and Ive just been waiting - but I need to apply the same grid only elements to it that the grid/list view uses. No option for list view, only grid. But it should share the same markup and css for consistency.

     

    @@burt

     

    3? - not sure about this one, but checkout_shipping_address.php - If a different shipping address is already selected, the row of addresses to select from, still displays the default address as selected (only that row under the details) <--- should that not be swiched from $customers_default_address to $sendto? and the same goes for checkout_payment_address.php


  9. @@wHiTeHaT

     

    I agree that something different, more elegant, should happen, but without having to implement another 3rd party script.

     

    I can see the accordion working well, if it can be laid the right way.

     

    I too had extended the category_tree class about the same time as Matt, and found the same issues that came up here - I had to add in an extra link inside the dropdown to navigate to the category root, and saw its weakness handling deeper levels.

     

    I *thought bootstrap 2.XX handled unlimited nesting?


  10. Are you really using 2.2 version? 2.3.4 is the current most secure version, and easier to modify (imo).

     

    Sounds like you already added some weight fields to the attributes? You also have to make changes to the shopping_cart class file to push the weight to the product @ checkout. There is an existing contribution that works just fine for any very version, I think it is called more products weight? No sure though, but its out there.


  11. I don't like to re-introduce tables into the checkout, it's not tabular data (well I suppose it is in a way, but...blah blah).

    Oh no, you didn't just go there did you? The age old debate continues --

    How about using listview/listgroup, http://getbootstrap.com/components/#list-group , and placing the radio before the text instead of after.

    I think that the list groups would actually work out very well. Its not that much to change a table to an unordered list.

     

    I will convert over what I have redone and posy again.


  12. <?php echo $confirmation['title']; ?>

     

    Where does that come from ? In the standard osc tables layout, that consists of nothing so the td is "collapsed"...

     

    I can't recall where that is set in osc

     

    I can find it in checkout_confirmation.php on any release I search on my local, and it's on Harald's latest release on GitHub line 238, https://github.com/haraldpdl/oscommerce2/blob/master/catalog/checkout_confirmation.php

     

    But I cannot find any payment module that uses it, its just $confirmation['fields'][$i]['title'];

     

    Maybe its very dated?


  13. @@grandpaj

     

    I built one that works, (Ive used it for various clients for a few years now) you can see it in my demo if you look at my post just a few up.

     

    When this build is released I will add it as a contribution, but as a general precaution, something like that would not be advisable for a core release for at least couple of reasons -

     

    1) It's more info to capture in one shot, which can cause conflicts under certain situations, and more maintenance.

     

    2) A lot of shops don't even use the checkout shipping page, if they sell virtual products, then that page can be bypassed completely. I coded my page not to display shipping methods/address at all if products are virtual, but really so no need to serve up more overhead if its not needed.

     

    So if it fits a shops needs, its great, but only a small portion of shops would really benefit from it.


  14. here is code snippet for checkout payment selection area :

     

     <!-- payment methods -->
     <div id="payment-select" class="row">
       <div class="col-md-12">
      <div class="panel panel-default">
        <div class="panel-heading"><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></div>
        <?php
    	 $selection = $payment_modules->selection();
    	 if (sizeof($selection) > 1) {
    	 ?>
    	   <div class="panel-body">
    		 <p><?php echo TEXT_SELECT_PAYMENT_METHOD ; ?></p>
    	   </div>
    	 <?php
    	 } elseif ($free_shipping == false) {
    	 ?>
    	   <div class="panel-body">
    		 <p><?php echo TEXT_ENTER_PAYMENT_INFORMATION; ?></p>
    	   </div>
    	 <?php
    	 }
      ?>
    	 <table class="table table-striped table-condensed">
    
    	 <?php
    	 $radio_buttons = 0;
    	 for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
    	 ?>
    
    	   <?php
    	   if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) {
    		 echo '	  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
    	   } else {
    		 echo '	  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
    	   }
    	   ?>
    	    <th class="col-md-11"><?php echo $selection[$i]['module']; ?></th>
    	    <td align="col-md-1">
    		  <?php
    		  if (sizeof($selection) > 1) {
    		    echo tep_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $payment),'required');
    		  } else {
    		    echo tep_draw_hidden_field('payment', $selection[$i]['id']);
    		  }
    		  ?>
    
    	    </td>
    	  </tr>
    	  <?php
    	  if (isset($selection[$i]['error'])) {
    	  ?>
    	    <tr>
    		  <td class="error" colspan="2"><?php echo $selection[$i]['error']; ?></td>
    	    </tr>
    	  <?php
    	  } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
    	  ?>
    	    <tr>
    		  <td colspan="2"><table style="border:none;">
    		  <?php
    		  for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
    		  ?>
    		    <tr>
    			  <td style="border:none;"><?php echo $selection[$i]['fields'][$j]['title']; ?></td>
    			  <td style="border:none;"><?php echo $selection[$i]['fields'][$j]['field']; ?></td>
    		    </tr>
    		  <?php
    		  }
    		  ?>
    		  </table></td>
    	    </tr>
    	  <?php
    	  }
    	  ?>
        <?php
        $radio_buttons++;
        }
        ?>
        </table>
      </div>
       </div>
     </div>
     <!-- payment methods -->
    


  15. @@burt

     

    Any reason why this portion of code was left out of the checkout_payment area?

     

    <?php
       } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
    ?>
      <tr>
        <td colspan="2"><table border="0" cellspacing="0" cellpadding="2">
    <?php
      for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
    ?>
    	  <tr>
    	    <td><?php echo $selection[$i]['fields'][$j]['title']; ?></td>
    	    <td><?php echo $selection[$i]['fields'][$j]['field']; ?></td>
    	  </tr>
    <?php
      }
    ?>
    

     

    Also, have noticed when using a credit cart with input on checkout_confirmation, the area is split into two columns, on the left is a blank alert alert-danger div and the right is the alert alert-info div with the CC fields


  16. Also, without the old school select radio onclick javascript function, I can foresee some customers having difficulties selecting a method. Theres always that one who cant seem to click a radio button, but I think for accessibility reasons the customer needs to be able to click anywhere in the row and have that method selected.

     

    I'm just going off of customer service experience Ive seen in the past after changing such things for shop owners.

     

    Ive bypassed the onclick script in favor of labels with the for attribute before, but that only works when your using a method that offers various choices, for something like table or per item, there is no optional choice to wrap a label around, and if they click on the price, the radio wont be selected.

     

    If anyone wants to see it live, http://wsfive.com/bs-master login with test@@Tester.com test1

     

    You can see it on checkout_shipping page right now, Ive yet to do the payment details yet.

     

    You can also use just the link with checkout.php to see a whole different page :thumbsup: <-- again, payment select is not redone. (And the comments travel from page to page without loosing content)


  17. Wow- been away a few days and look how much longer the thread grew! Good deal.

     

    So, looking further into the checkout process, I fell the actual process of selecting shipping and payment type is a bit clunky, I'm afraid real customers will become confused - as Ive seen the real customers become confused over the smallest little things.

     

    I redid the layout of the shipping methods, it uses tables again, but that is simply to give the end user a well defined area to make their choice from. Its not a bad table, it will still fit nicely in the various view ports, and it has been marked up with bootstrap.

     

    If anyone who has a version up could take this markup and place it in their checkout_shipping.php page, and give feedback, that would be great. I'll have it up in my demo site soon. Then I'll do the same for payment.

     

     <!-- shipping methods -->
     <div id="shipping-quotes" class="row">
       <div class="col-md-12">
      <div class="panel panel-default">
        <div class="panel-heading"><?php echo TABLE_HEADING_SHIPPING_METHOD; ?></div>
    
    
        <?php
        if ( (sizeof($quotes) > 1 && sizeof($quotes[0]) > 1) && ($free_shipping == false) ) {
     ?>
    	  <div class="panel-body">
    	    <p><?php echo TEXT_CHOOSE_SHIPPING_METHOD ; ?></p>
    	  </div>
        <?php
        } elseif ($free_shipping == false) { ?>
    	  <div class="panel-body">
    	    <p><?php echo TEXT_ENTER_SHIPPING_INFORMATION; ?></p>
    	  </div>
        <?php
     }
     ?>
    
    
        <table class="table table-striped table-condensed">
    	  <?php
    	  if ($free_shipping == true) {
       ?>
    	 <tr class="success">
    		  <th colspan="3"><?php echo FREE_SHIPPING_TITLE; ?> <?php echo $quotes[$i]['icon']; ?></th>
    	    </tr>
    	    <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, 0)">
    		  <td><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?></td>
    	    </tr>
    
    	    <?php 
      } else {
    		  $radio_buttons = 0;
    		  for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
    	    ?>
    		 <tr class="info">
    		   <th colspan="3"><?php echo $quotes[$i]['module']; ?> <span class="pull-right" style="margin-right:15%;"><?php if (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon'])) { echo $quotes[$i]['icon']; } ?></span></th>
    		 </tr>
    	   <?php if (isset($quotes[$i]['error'])) { ?>
    		  <tr class="error">
    		    <td colspan="3"><?php echo $quotes[$i]['error']; ?></td>
    		  </tr>
    	    <?php  } else {
    		  for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
    		    // set the radio button to be checked if it is the method chosen
    		    $checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false);
    			 if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {
    			   echo '	  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
    			 } else {
    			   echo '	  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
    			 }
     ?>
    
     <td class="col-md-9"><?php echo $quotes[$i]['methods'][$j]['title']; ?></td>
    <?php
    	    if ( ($n > 1) || ($n2 > 1) ) {
    ?>
    		  <td class="col-md-2"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></td>
    		  <td  class="col-md-1 text-right"><?php echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'], $checked); ?></td>
    <?php
    	    } else {
    ?>
    		   <td class="col-md-3 text-right" colspan="2"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?></td>
    <?php
    	    }
    ?>
    	  </tr>	
    <?php
    	    $radio_buttons++;
    	  }
        }
      }
       }
    ?>
        </table>
      </div>
       </div>
     </div>
     <!-- shipping methods -->
    


  18. @@Ken44

     

    Thanks Ken

     

    I still have to wrap the new products module itself in the same markup as the products_listing, then everything will blend and perform the same - ( but no list option on new products )

     

    The existing addons are a bit too resource intensive. The new category_tree class cuts down on SQL queries and loads much faster than anything that has ever been part of the osC stock build. In building a menu I have to keep that in mind and make sure that it does not pull extra overhead that doesn't need to be there.

     

    Henry's last code looks like its going to be the best to go with in that route, without having to make changes to the category_tree. I'll use it to make a horizontal menu and then let Gary decide if he wants to push it or not. If it makes it, great, if not it will be an addon - so its a win- win either way.

×