Hide shipping if there is only one shipping option

Please post any feature requests here

Hide shipping if there is only one shipping option

Postby fototapeti@.....bg » Fri Oct 14, 2016 10:56 pm

Hide shipping if there is only one shipping option
There is such option for payments... why not for shipment too..?
fototapeti@.....bg
 
Posts: 12
Joined: Wed Nov 06, 2013 8:33 pm

Re: Hide shipping if there is only one shipping option

Postby admin » Mon Oct 17, 2016 1:55 pm

hello, you can disable shipping at all if that is an option for you.

here in slovakia and many other EU countries, it is not allowed to set any specific shipping method by default even when it's free. the customer must click the specific shipping method and the default should be "select a shipping method..."

you can however hide the shipping html by wrrapping it in your onepage.unlogged+logged.tpl.php with something like <div style="display: none;">... </div>

example per:
\components\com_onepage\themes\threecolumn_special_blue_css3\onepage.unlogged.tpl.php

Code: Select all
<div class="op_inside" <?php if (!empty($no_shipping) || ($shipping_inside_basket)) echo 'style="display: none;"'; ?>>

   
      
<?php

if ((empty($no_shipping)) && (empty($shipping_inside_basket)))
{

$iter++; echo '<h4>'.$iter.'. '; echo OPCLang::_('COM_VIRTUEMART_ORDER_PRINT_SHIPPING_LBL').'</h4>';
}
?>   
                           
                        <!-- shipping methodd -->
                        <div id="ajaxshipping">
                        <?php echo $shipping_method_html; // this prints all your shipping methods from checkout/list_shipping_methods.tpl.php ?>
                        </div>
                        <br />
                        
                        <!-- end shipping methodd -->

                     
   
   

</div>


with the new wrap:

Code: Select all
<div style="display: none;">
<div class="op_inside" <?php if (!empty($no_shipping) || ($shipping_inside_basket)) echo 'style="display: none;"'; ?>>

   
      
<?php

if ((empty($no_shipping)) && (empty($shipping_inside_basket)))
{

$iter++; echo '<h4>'.$iter.'. '; echo OPCLang::_('COM_VIRTUEMART_ORDER_PRINT_SHIPPING_LBL').'</h4>';
}
?>   
                           
                        <!-- shipping methodd -->
                        <div id="ajaxshipping">
                        <?php echo $shipping_method_html; // this prints all your shipping methods from checkout/list_shipping_methods.tpl.php ?>
                        </div>
                        <br />
                        
                        <!-- end shipping methodd -->

                     
   
   

</div>
</div>


pls do not delete any parts of OPC themes which include "IDs" otherwise the scripts may not work properly. it's always better to hiden them with the display: none;

other OPC themes use similar html, but with different wrappers to style the surrounding html.

best regards, stan, rupostel.com
admin
Site Admin
 
Posts: 2624
Joined: Wed Jan 06, 2010 11:43 pm


Return to Feature Request

cron