Jump to content

PS 1.6 bulk action select all in States in Countries


Recommended Posts

Still haven't resolved this issue

 

Nobody actually aware of this? or am i the only one who had this problem? or am i dumb enough that i can't find "Select All" menu?..

 

I wanted my shop ship and register locally, and clicking on hundreds of states and countries to disable / delete them one by one is not a very impressive experience.

Edited by rickzmond (see edit history)
Link to comment
Share on other sites

  • 1 month later...

You are not alone, I am also trying to do the same - select all states and delete them. But I have to manually click every select box to accomplish this.

 

To do this, I used one hacky solution - executing javascript from my browser's console (I am using Chrome) with the following content:

var getInputs = document.getElementsByTagName("input");
for (var i = 0, max = getInputs.length; i < max; i++){
    if (getInputs[i].type === 'checkbox' && getInputs[i].name === 'stateBox[]')
        getInputs[i].checked = true;
}

and pressing Enter.

Edited by o15a3d4l11s2 (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Hello everyone.

I had the same problem. Here is my solve: Add this code:

	<div class="col-lg-8">
		{if $bulk_actions}
		<div class="btn-group bulk-actions">
			<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
				{l s='Bulk actions'} <span class="caret"></span>
			</button>
			<ul class="dropdown-menu">
				<li>
					<a href="#" onclick="javascript:checkDelBoxes($(this).closest('form').get(0), '{$table}Box[]', true);return false;">
						<i class="icon-check-sign"></i> {l s='Select all'}
					</a>
				</li>
				<li>
					<a href="#" onclick="javascript:checkDelBoxes($(this).closest('form').get(0), '{$table}Box[]', false);return false;">
						<i class="icon-check-empty"></i> {l s='Unselect all'}
					</a>
				</li>
				<li class="divider"></li>
				{foreach $bulk_actions as $key => $params}
				<li{if $params.text == 'divider'} class="divider"{/if}>
					{if $params.text != 'divider'}
					<a href="#" onclick="{if isset($params.confirm)}if (confirm('{$params.confirm}')){/if}sendBulkAction($(this).closest('form').get(0), 'submitBulk{$key}{$table}');">
						{if isset($params.icon)}<i class="{$params.icon}"></i>{/if} {$params.text}
					</a>
					{/if}
				</li>
				{/foreach}
			</ul>
		</div>
		{/if}
	</div>

for states selection in file admin\themes\default\template\controllers\states\helpers\list\list_footer.tpl after </div> on line 43

for countries selection in admin\themes\default\template\controllers\countries\helpers\list\list_footer.tpl after </div> on line 41

  • Like 4
Link to comment
Share on other sites

  • 3 months later...

Hello everyone.

I had the same problem. Here is my solve: Add this code:

	<div class="col-lg-8">
		{if $bulk_actions}
		<div class="btn-group bulk-actions">
			<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
				{l s='Bulk actions'} <span class="caret"></span>
			</button>
			<ul class="dropdown-menu">
				<li>
					<a href="#" onclick="javascript:checkDelBoxes($(this).closest('form').get(0), '{$table}Box[]', true);return false;">
						<i class="icon-check-sign"></i> {l s='Select all'}
					</a>
				</li>
				<li>
					<a href="#" onclick="javascript:checkDelBoxes($(this).closest('form').get(0), '{$table}Box[]', false);return false;">
						<i class="icon-check-empty"></i> {l s='Unselect all'}
					</a>
				</li>
				<li class="divider"></li>
				{foreach $bulk_actions as $key => $params}
				<li{if $params.text == 'divider'} class="divider"{/if}>
					{if $params.text != 'divider'}
					<a href="#" onclick="{if isset($params.confirm)}if (confirm('{$params.confirm}')){/if}sendBulkAction($(this).closest('form').get(0), 'submitBulk{$key}{$table}');">
						{if isset($params.icon)}<i class="{$params.icon}"></i>{/if} {$params.text}
					</a>
					{/if}
				</li>
				{/foreach}
			</ul>
		</div>
		{/if}
	</div>

for states selection in file admin\themes\default\template\controllers\states\helpers\list\list_footer.tpl after </div> on line 43

for countries selection in admin\themes\default\template\controllers\countries\helpers\list\list_footer.tpl after </div> on line 41

Excellent!

Link to comment
Share on other sites

×
×
  • Create New...