Remove the invoice section from Prestashop 1.6 (addresses.tpl file?) - prestashop-1.6

I'm trying to remove the customer invoice address section in my Prestashop 1.6 cart summary page in the customer checkout (see image).
I have a tip that i 'need to comment out/remove the box from addresses.tpl file? in the theme folder. Also that i need to know html, to avoid breaking stuff'.
Ive been busy reading html and php books but have not found what i have to do. I just don't know enough to know what specifically to comment or add or maybe its altogether the wrong file to edit.
Can anyone help please?
Here's the code from my addresses.tpl file:
{capture name=path}
{l s='My account'}
<span class="navigation-pipe">{$navigationPipe}</span>
<span class="navigation_page">{l s='My addresses'}</span>
{/capture}
<h1 class="page-heading">{l s='My addresses'}</h1>
<p>{l s='Please configure your default billing and delivery addresses when placing an order. You may also add additional addresses, which can be useful for sending gifts or receiving an order at your office.'}</p>
{if isset($multipleAddresses) && $multipleAddresses}
<div class="addresses">
<p><strong class="dark">{l s='Your addresses are listed below.'}</strong></p>
<p class="p-indent">{l s='Be sure to update your personal information if it has changed.'}</p>
{assign var="adrs_style" value=$addresses_style}
<div class="bloc_adresses row">
{foreach from=$multipleAddresses item=address name=myLoop}
<div class="col-xs-12 col-sm-6 address">
<ul class="{if $smarty.foreach.myLoop.last}last_item{elseif $smarty.foreach.myLoop.first}first_item{/if}{if $smarty.foreach.myLoop.index % 2} alternate_item{else} item{/if} box">
<li>
<h3 class="page-subheading">{$address.object.alias}</h3>
</li>
{foreach from=$address.ordered name=adr_loop item=pattern}
{assign var=addressKey value=" "|explode:$pattern}
<li>
{foreach from=$addressKey item=key name="word_loop"}
<span {if isset($addresses_style[$key])} class="{$addresses_style[$key]}"{/if}>
{$address.formated[$key|replace:',':'']|escape:'html':'UTF-8'}
</span>
{/foreach}
</li>
{/foreach}
<li class="address_update">
<a class="btn btn-success btn-sm" href="{$link->getPageLink('address', true, null, "id_address={$address.object.id|intval}")|escape:'html':'UTF-8'}" title="{l s='Update'}">
<span>
{l s='Update'}
<i class="fa fa-refresh right"></i>
</span>
</a>
<a class="btn btn-danger btn-sm" href="{$link->getPageLink('address', true, null, "id_address={$address.object.id|intval}&delete")|escape:'html':'UTF-8'}" onclick="return confirm('{l s='Are you sure?' js=1}');" title="{l s='Delete'}">
<span>
{l s='Delete'}
<i class="fa fa-times right"></i>
</span>
</a>
</li>
</ul>
</div>
{if $smarty.foreach.myLoop.index % 2 && !$smarty.foreach.myLoop.last}
</div>
<div class="bloc_adresses row">
{/if}
{/foreach}
</div>
</div>
{else}
<p class="alert alert-warning">{l s='No addresses are available.'}
{l s='Add a new address'}
</p>
{/if}
<div class="clearfix main-page-indent">
<a href="{$link->getPageLink('address', true)|escape:'html':'UTF-8'}" title="{l s='Add an address'}" class="btn btn-default btn-md icon-right">
<span>
{l s='Add a new address'}
</span>
</a>
</div>
<ul class="footer_links clearfix">
<li>
<a class="btn btn-default btn-sm icon-left" href="{$link->getPageLink('my-account', true)|escape:'html':'UTF-8'}" title="{l s='Back to your account'}">
<span>
{l s='Back to your account'}
</span>
</a>
</li>
<li>
<a class="btn btn-default btn-sm icon-left" href="{$base_dir}" title="{l s='Home'}">
<span>
{l s='Home'}
</span>
</a>
</li>
</ul>

The correct file you are looking for is in folder "themes/default-bootstrap" called "shopping-cart.tpl".
And a good solution for you would be this at line 516:
{foreach from=$formattedAddresses key=k item=address}
{if $k eq 'invoice'}
{else}
<div class="col-xs-12 col-sm-6"{if $k == 'delivery' && !$have_non_virtual_products} style="display: none;"{/if}>
<ul class="address {if $address#last}last_item{elseif $address#first}first_item{/if} {if $address#index % 2}alternate_item{else}item{/if} box">
<li>
<h3 class="page-subheading">
{if $k eq 'invoice'}
{l s='Invoice address'}
{elseif $k eq 'delivery' && $delivery->id}
{l s='Delivery address'}
{/if}
{if isset($address.object.alias)}
<span class="address_alias">({$address.object.alias})</span>
{/if}
</h3>
</li>
{foreach $address.ordered as $pattern}
{assign var=addressKey value=" "|explode:$pattern}
{assign var=addedli value=false}
{foreach from=$addressKey item=key name=foo}
{$key_str = $key|regex_replace:AddressFormat::_CLEANING_REGEX_:""}
{if isset($address.formated[$key_str]) && !empty($address.formated[$key_str])}
{if (!$addedli)}
{$addedli = true}
<li><span class="{if isset($addresses_style[$key_str])}{$addresses_style[$key_str]}{/if}">
{/if}
{$address.formated[$key_str]|escape:'html':'UTF-8'}
{/if}
{if ($smarty.foreach.foo.last && $addedli)}
</span></li>
{/if}
{/foreach}
{/foreach}
</ul>
</div>
{/if}
{/foreach}

The solution (or maybe rather hack) to removing the invoice box from the cart summary was to add some code to the blockpermanentlinks.css file.
#block-order-detail .col-xs-12.col-sm-6 .address.item.box,
.order_delivery .col-xs-12.col-sm-6 .address.alternate_item{display:none}
.col-xs-12.col-sm-6 #address_invoice,
.checkbox.addressesAreEquals{visibility:hidden}

Related

Thymeleaf start new row every n elements

So I am trying to create a Thymeleaf loop where have a list of n elements. Every fourth (starting at the first) I create a parent element, and each one gets added to that until a new parent is created.
So the idea is
for e : elements {
if index % 4 = 0 {
create new parent
}
add e to parent
}
I am trying to implement this in Thymeleaf and cannot get anything working. Here is the closest I think I have gotten (that inner loop causes "IllegalStateException: No index"):
<div th:each="metric, rowStatus : ${metrics}"
class="row tile_count" th:if="${rowStatus.index % 4} == 0">
<div th:each="i: ${#numbers.sequence(rowStatus.index , rowStatus.index +4)}"
th:replace="layouts/template.html :: metricCard(name=${metrics[i].name}, value=${metrics[i].value},description=${metrics[i].description}, severity=${metrics[i].severity})"></div>
</div>
The desired html is something in the ball park of:
<div class="row tile_count">
<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-user"></i> Total HR1 Files</span>
<div class="count">17</div>
<span class="count_bottom"><i class="green"><i class="fa"></i></i> Same as last Week</span>
</div>
<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-user"></i> Total Transactions</span>
<div class="count green"> 7,353</div>
<span class="count_bottom"><i class="green"><i class="fa fa-sort-asc"></i>34% </i> From last Week</span>
</div>
<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-clock-o"></i> Average Processing Time</span>
<div class="count">43 sec</div>
<span class="count_bottom"><i class="green"><i class="fa fa-sort-asc"></i>3% </i> From last Week</span>
</div>
<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-user"></i> Total Failed Transactions</span>
<div class="count">0</div>
<span class="count_bottom"><i class="red"><i class="fa fa-sort-desc"></i>12% </i> From last Week</span>
</div>
<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-user"></i> Total Loaded Transactions</span>
<div class="count">7,353</div>
<span class="count_bottom"><i class="green"><i class="fa fa-sort-asc"></i>21% </i> From last Week</span>
</div>
</div>
<div class="row tile_count">
<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-user"></i> Total HR2 Files</span>
<div class="count">05</div>
<span class="count_bottom"><i class="green"><i class="fa"></i></i> Same as last Week</span>
</div>
<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-user"></i> Total Transactions</span>
<div class="count green">5,421</div>
<span class="count_bottom"><i class="green"><i class="fa fa-sort-asc"></i>10% </i> From last Week</span>
</div>
<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-clock-o"></i> Average Processing Time</span>
<div class="count">10 sec</div>
<span class="count_bottom"><i class="green"><i class="fa fa-sort-asc"></i>3% </i> From last Week</span>
</div>
<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-user"></i> Total Failed Transactions</span>
<div class="count">2</div>
<span class="count_bottom"><i class="red"><i class="fa fa-sort-desc"></i>12% </i> From last Week</span>
</div>
<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-user"></i> Total Loaded Transactions</span>
<div class="count">5,419</div>
<span class="count_bottom"><i class="green"><i class="fa fa-sort-asc"></i>10% </i> From last Week</span>
</div>
</div>
You can try th:remove like this:
<th:block th:each="metric, iterStat : ${metrics}">
<div class="row tile_count" th:remove="${iterStat.index % 4 == 0 ? none : tag}">
<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
...
</div>
</div>
</th:block>
You can also try the following:
<div class="row pt-5" th:remove="${status.index%4 == 0} ? none : tag">
<div class="col">...</div>
<th:block th:if="${status.index eq 4}" th:utext="'</div>'" />
I used this, cause the remove "tag" feature don't delete the closing div from my row.

wp-bootstrap-nav walker collapse is not working on ipad

Bootstrap navbar collapse is not working. The issue is that it shows a collapsing menu but on click, it is not collapsed.
I have provided my full code so that it can help you to suggest or help me to sort out the issue
<header class="head-image">
<nav id="nav-top" class="navbar hidden-xs hidden-sm" style="margin-bottom: 0px;">
<div class="container text-center">
<div class="col-md-4 col-md-offset-8">
<div class="search-box">
<?php echo do_shortcode('[smart_search id="1"]'); ?>
</div>
</div>
</div>
</nav>
<section id="main-header">
<div class="container">
<div class="pull-left">
<a href="<?php echo esc_url(home_url('/')); ?>" title="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>" rel="home">
<img src="<?php header_image(); ?>" width="213" height="117" alt="">
</a>
</div>
<div class="pull-right hidden-xs hidden-sm">
<div class="row text-right">
<div class="col-xs-12">
<span class="text-white">Order hotline</span>
</div>
<div class="col-xs-12">
<span class="nav-phone">
<i class="fa fa-phone" aria-hidden="true"></i>
<a class="text-white nav-phone" href="tel:+"></a>
</span>
</div>
</div>
<div class="row n-m hidden-xs hidden-sm">
<div class="col-sm-6 col-xs-12 border-brown relative">
<div class="col-xs-3">
<i class="fa fa-user" aria-hidden="true"></i>
</div>
<div class="col-xs-9">
<div class="row">
Login/Register </div>
<div class="row ">
<span class="text-white">
My Account
</span>
</div>
</div>
</div>
<div class="col-sm-5 col-xs-12 border-brown relative">
<div class="col-xs-3">
<a href="<?php echo wc_get_cart_url(); ?>">
<i class="fa fa-shopping-bag" aria-hidden="true"></i>
</a>
</div>
<div class="col-xs-9">
<div class="row">
Shopping bag
</div>
<div class="row">
<span class="text-white">
<?php echo WC()->cart->get_cart_contents_count(); ?> Items <span class="price">(<?php echo WC()->cart->get_cart_total(); ?>)
</span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<nav class="navbar" id="main-menu">
<div class="container">
<div class="navbar-header hidden-md hidden-lg">
<div class="col-xs-6">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="text-white hidden-lg hidden-md" data-toggle="collapse" data-target="#main-menu-collapse">Menu</span>
</div>
<div class="col-xs-6 pull-right border-brown text-center hidden-lg hidden-md relative">
<div class="row">
<div class="col-xs-4">
<i class="fa fa-shopping-bag" aria-hidden="true"></i>
</div>
<div class="col-xs-8 text-white">
<span class="text-white">
<?php echo WC()->cart->get_cart_contents_count(); ?> Items
<span class="text-white">
(<?php echo WC()->cart->get_cart_total(); ?>)
</span>
</span>
</div>
</div>
</div>
</div>
<div id="main-menu-collapse" class="collapse navbar-collapse">
<?php
wp_nav_menu(array(
'theme_location' => 'primary',
'depth' => 2,
'container' => 'div',
'menu_class' => 'nav navbar-nav',
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
'walker' => new WP_Bootstrap_Navwalker(),
));
?>
<div class="row border-top hidden-lg hidden-md">
<div class="col-xs-3">
Contact
</div>
<div class="col-xs-9">
<a href="tel:">
<i class="fa fa-phone" aria-hidden="true"></i>
<span class="text-white"></span>
</a>
</div>
</div>
<div class="row border-top hidden-lg hidden-md">
<div class="col-xs-3">
Login/ register
</div>
<div class="col-xs-9">
<a href="<?php echo get_permalink(get_option('woocommerce_myaccount_page_id')); ?>">
<i class="fa fa-user" aria-hidden="true"></i>
<span class="text-white">My account</span>
</a>
</div>
</div>
</div>
</div>
</nav>
<nav class="navbar" id="menu-shortcut">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav col-lg-12 text-center">
<li class="col-lg-4 col-md-4 text-left">text</li>
<li class="col-lg-4 col-md-4">text</li>
<li class="col-lg-4 col-md-4 text-right"><a class="toggle-modal" href="javascript:void(0);">Sign up </a></li>
</ul>
</div>
</div>
</nav>
</header>
I am also using Jquery the code is below, there is no jquery conflict in my code everything working perfectly only getting the issue when I am browsing form iPad
$('#main-menu .navbar-header .col-xs-6:first-child, #main-menu .navbar-header button').click(function()
{
if($(this).children('button').attr('class') == "navbar-toggle collapsed")
{
$(this).parents('.container').children('#main-menu-collapse').addClass('in');
$(this).parents('.container').children('#main-menu-collapse').slideDown('fast', function() {
});
$(this).children('button').html("");
$(this).children('button').css({
'min-width' : '44px',
'min-height' : '34px'
});
$(this).children('button').attr('aria-expanded', 'true');
$(this).children('button').removeClass('collapsed');
}else
{
$(this).children('button').addClass('collapsed');
$(this).parents('.container').children('#main-menu-collapse').slideDown('fast', function() {
});
$(this).parents('.container').children('#main-menu-collapse').css('display', 'none');
$(this).children('button').attr('aria-expanded', 'false');
$(this).parents('.container').children('#main-menu-collapse').removeClass('in');
$(this).children('button').css({
"margin-top" : "11px",
'background' : 'none'
});
$(this).children('button').html('<span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span>');
}
});
.click() does not happen in Safari unless the element it is bound on is a legitimate click event receiver (target) in Apple's own implementation of web standard (which differs from current web standard).
The simplest way to make any element become a "legitimate" click event target is to add
cursor: pointer;
to it.
Other workarounds include using different events, such as touchstart, tap or input, depending on case.
So, in your case, a fix would be to add this to your CSS:
#main-menu .navbar-header .col-xs-6:first-child,
#main-menu .navbar-header button {
cursor: pointer;
}
Or to change the wrapper to:
$('#main-menu .navbar-header .col-xs-6:first-child, #main-menu .navbar-header button')
.on('click touchstart', function(){
// your code here
})
In my opinion, you should remove wordpress, wordpress-theming and wp-nav-walker from the question as they are irrelevant to the bug and perhaps add safari, ios and/or ipad to it.

Kendo toolbar misbehave

I'm having a problem implementing a toolbar for kendo grid. The problem is a partial view used to load a left-sided menu for a specific module in the website application.
So far, I have not been able to work around this, thus I'm asking here for help.
This is what the grid looks like without the left menu:
This is what the grid looks like with the left menu:
So far, this is what the menu code has:
<nav class="navbar navbar-default navbar-left" style="margin:0px; padding:0px; border-color:lightgray;">
<div class="collapse navbar-collapse" style="margin:0px; padding:0px;">
<ul class="nav navbar-">
#if (Request.IsAuthenticated)
{
<li>
<a href="#Url.Action("Index", "FicheiroIdqa")">
<span class="fa fa-circle" style="font-size:8px; vertical-align:middle;"></span> Ficheiros Idqa
</a>
</li>
<li>
<a href="#Url.Action("Index", "ZaPe")">
<span class="fa fa-circle" style="font-size:8px; vertical-align:middle;"></span> ZaPes
</a>
</li>
<li>
<a href="#Url.Action("Index", "LocalColheita")">
<span class="fa fa-circle" style="font-size:8px; vertical-align:middle;"></span> Locais Colheita
</a>
</li>
<li>
<a href="#Url.Action("Index", "FamiliaParametro")">
<span class="fa fa-circle" style="font-size:8px; vertical-align:middle;"></span> Famílias Parâmetro
</a>
</li>
<li>
<a href="#Url.Action("", "")">
<span class="fa fa-circle" style="font-size:8px; vertical-align:middle;"></span> Editais
</a>
</li>
<li>
<a href="#Url.Action("Index", "Resultados")">
<span class="fa fa-circle" style="font-size:8px; vertical-align:middle;"></span> Export. Resultados
</a>
</li>
}
</ul>
</div>
And this is the code in the view, where I am calling the partial with the menu:
#model List<INL.InLabLimsAqua.OnlineResults.WebApp.ViewModels.FicheiroIdqaViewModel>
#{ ViewBag.Title = "Ficheiros Idqa"; }
<h5>#Html.ActionLink("Ersar", "Index", "Ersar") > #ViewBag.Title</h5>
<hr />
<div class="col-md-2" style="padding-left:0px; width:200px;">
#Html.Partial("~/Views/Ersar/_ErsarMenu.cshtml")
</div>
<div class="col-md-offset-1" style="padding-left:95px;">
...
grid configuration
...
</div>
I think the problem resides in the fact that the toolbar is being loaded in the same row as the left menu, and it pushes it down with its height.
Any help to fix this would be much appreciated.

ui-bootstrap accordion header trigger

I'm trying to get ui-bootstrap accordion to only trigger (expand) on a div within the accordion-header. I've tried setting the is-open to false but no luck. The idea is that I simply want all kinds of ng-click's on the accordion-header but only one that will expand it.
<accordion-group class="panel-default">
<accordion-heading>
// ****** I'd like this to be one of the things that expands the accordion
<span class="editable">
<span class="glyphicon glyphicon-cloud-download" ></span>
{{product.name}}
</span>
// ****** but not this..
<span class="editable">
<span is-open="false" ng-click="editProduct(item)" class="glyphicon glyphicon-pencil"></span>
</span>
<span class="pull-right" >
<span class="badge access_group" ng-click="fetchMembers(product)" ng-show="product.members_count > 0">
<span class="glyphicon glyphicon-user">
</span>
{{product.members_count}}
</span>
// ****** but this should as well...
<span class="badge access_group editable" ng-click="fetchServiceProducts(product)" ng-show="product.children_products_count > 0">
<span class="glyphicon glyphicon-cloud-download">
</span>
{{product.children_products_count}}
</span>
</span>
</accordion-heading>
{{product.description}}
<accordion>
<div ng-repeat="product in product.products" ng-include="'product_renderer.html'"></div>
</accordion>
</accordion-group>
If there is something I'm missing please let me know.

create csv from html

I have the code, I need it to get a csv file with the following contents.
src of img.myImg; content of EAN: Z88799010290
I tried, but no luck how merge two foreach:
foreach($html->find('img.myImg') as $e)
echo $e->src . '<br>;';
foreach($html->find('div.EANN') as $ean)
echo $ean. ';<br>';
<div id="wybr_45" alt="-8204" class="listProduct"><div id="d4b">
<div class="fl fotoimage">
<div class="listLink1"> <a href="#" onclick="changeData('popshop','Mainframe','showModuleNew','DeepProductSelect',1234,1234);" >
<img src="http://example/script.php?a=87x112&t=B2B.BSDTrade&i=-441" class="myImg" alt="w"/> </a>
</div>
</div>
<div class="fl descriptionColumn">
<div class="lpTitle2 listName"><b> GATTA: MICHELLE LOVE pończochy samonośne wz.03</b></div>
<div class="lpTitle2"><!-- <a href="#" >brak opisu </a> --></div>
<span class="lpTitle2">Kod:</span><b>-8204</b>
<div class="EANN">000245035190</div><div class="lpTitle2 producer">Producent: <a style="font-size: 12px; color: #555;" href="#">GATTA</a></div>
</div>
<div class="marketIndex">
<div class="priceColumn"> <span class="oldPrice1">
</span></div>
<div class="OrderCpl"><span class="addtoOrderL" onclick="deepProductTable_showForProduct(-8204);" >
<span onclick="deepProductTable_showForProduct(-8204);" class="addtobasket"/> </span></div>
</div></div></div>
Result:
http://example/script.php?a=87x112&t=B2B.BSDTrade&i=-723;000937090290

Resources