PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, June 30, 2022

[FIXED] How to hide update button from shipping and billing address in checkout page in prestashop

 June 30, 2022     prestashop, prestashop-1.6, smarty     No comments   

Issue

enter image description here

I am looking to hide "update" button and "Choose delivery address option" on checkout page in prestashop. which file i need to edit to do it?


Solution

You have two way to hide those buttons.

First: CSS
Edit addresses.css placed in your template folder, I guess it's default template in your case, so the file is prestashop/themes/default-bootstrap/css/addresses.css. Add this line of code:

/* 
 * We have to add #order (or #order-opc) selector to avoid to hide buttons 
 * in addresses page that is in my account area 
*/
/* This is for 5 step checkout */
#order .address li.address_update {
    display: none;
}
#order #id_address_delivery {
    display: none;
}

/* This is for one page checkout (opc) */
#order-opc .address li.address_update {
    display: none;
}
#order-opc #id_address_delivery {
    display: none;
}

Second: Smarty/TPL
Edit order-address.tpl of your template (if you have 5 step checkout) otherwise order-opc.tpl, in your case prestashop/themes/default-bootstrap/order-address.tpl or prestashop/themes/default-bootstrap/order-opc.tpl

Search this select:

<select name="id_address_delivery" id="id_address_delivery" class="address_select form-control">
    {foreach from=$addresses key=k item=address}
        <option value="{$address.id_address|intval}"{if $address.id_address == $cart->id_address_delivery} selected="selected"{/if}>{$address.alias|escape:'html':'UTF-8'}</option>
    {/foreach}
</select>

And comment it (how to comment in smarty)

In bottom of the file comment this two lines of code:

{*{capture}<a class="button button-small btn btn-default" href="{$smarty.capture.addressUrlAdd}" title="{l s='Update' js=1}"><span>{l s='Update' js=1}<i class="icon-chevron-right right"></i></span></a>{/capture}*}
{*{addJsDefL name=liUpdate}{$smarty.capture.default|@addcslashes:'\''}{/addJsDefL}*}

I guess there is a third way, with JS, but I think it's useless. Cheers ;)



Answered By - marsaldev
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing