Jump to content

carriercompare module


Recommended Posts

hi,

 

I would like to change the layout of the module estimate shipping in the resume cart page (carriercompare) 
yet the module displays three columns
 
carrier | Information | Price 
 
I would like to come together two columns like this: 
 
carrier & information [prices 
 
anyone know what tpl file must be changed?
 
thanks
 
 
Link to comment
Share on other sites

Here it is if this is what you are searching for.

		<div id="availableCarriers">
			<table cellspacing="0" cellpadding="0" id="availableCarriers_table" class="std">
				<thead>
					<tr>
						<th class="carrier_action first_item"></th>
						<th class="carrier_name item">{l s='Carrier' mod='carriercompare'}</th>
						<th class="carrier_infos item">{l s='Information' mod='carriercompare'}</th>
						<th class="carrier_price last_item">{l s='Price' mod='carriercompare'}</th>
					</tr>
				</thead>
				<tbody id="carriers_list">
					
				</tbody>
			</table>
		</div>
Link to comment
Share on other sites

I get this code in the carriercompare.js

var query = $.ajax({
			type: 'POST',
			headers: { "cache-control": "no-cache" },
			url: baseDir + 'modules/carriercompare/ajax.php' + '?rand=' + new Date().getTime(),
			data: 'method=getCarriers&id_country=' + $('#id_country').val() + '&id_state=' + $('#id_state').val() + '&zipcode=' + $('#zipcode').val(),
			dataType: 'json',
			success: function(json) {
				if (json.length)
				{
					var html  = '';
					$.each(json, function(index, carrier)
					{
						html += '<tr class="'+(index % 2 ? 'alternate_' : '')+'item">'+
									'<td class="" width="64px">'+
										'  <input type="radio" name="carrier_price_value" value="'+ ((displayPrice == 1) ? carrier.price_tax_exc : carrier.price) +'" id="id_carrier'+carrier.id_carrier+'" '+(id_carrier == carrier.id_carrier ? 'checked="checked"' : '')+'/>'+
									'</td>'+
									'<td class="carrier_name">'+
										'<label for="id_carrier'+carrier.id_carrier+'">'+
										(carrier.img ? '<img src="'+carrier.img+'" alt="'+carrier.name+'" />' : carrier.name)+
										'</label>'+
									'</td>'+
									'<td class="carrier_infos">'+
										((carrier.delay != null) ? carrier.delay : '') +
									'</td>'+
									'<td class="carrier_price">';

										if (carrier.price)
										{
											html += '<span class="price">'+(displayPrice == 1 ? formatCurrency(carrier.price_tax_exc, currencyFormat, currencySign, currencyBlank) : formatCurrency(carrier.price, currencyFormat, currencySign, currencyBlank))+'</span>';
										}
										else
										{
											html += txtFree;
										}

						html += 	'</td>'+
								'</tr>';
					});
					$('#carriers_list').append(html);

I think the table construction for carrier compare in the resume cart page is here

but when i remvove balise <td> at the line of information of carreir not wot in front office

have you an idea ?

 

thanks

Link to comment
Share on other sites

Try this:

var query = $.ajax({
			type: 'POST',
			headers: { "cache-control": "no-cache" },
			url: baseDir + 'modules/carriercompare/ajax.php' + '?rand=' + new Date().getTime(),
			data: 'method=getCarriers&id_country=' + $('#id_country').val() + '&id_state=' + $('#id_state').val() + '&zipcode=' + $('#zipcode').val(),
			dataType: 'json',
			success: function(json) {
				if (json.length)
				{
					var html  = '';
					$.each(json, function(index, carrier)
					{
						html += '<tr class="'+(index % 2 ? 'alternate_' : '')+'item">'+
									'<td class="" width="64px">'+
										'  <input type="radio" name="carrier_price_value" value="'+ ((displayPrice == 1) ? carrier.price_tax_exc : carrier.price) +'" id="id_carrier'+carrier.id_carrier+'" '+(id_carrier == carrier.id_carrier ? 'checked="checked"' : '')+'/>'+
									'</td>'+
									'<td class="carrier_name">'+
										'<label for="id_carrier'+carrier.id_carrier+'">'+
										(carrier.img ? '<img src="'+carrier.img+'" alt="'+carrier.name+'" />' : carrier.name)+
										'</label>'+' '+
										((carrier.delay != null) ? carrier.delay : '') +
									'</td>'+
									'<td class="carrier_price">';

										if (carrier.price)
										{
											html += '<span class="price">'+(displayPrice == 1 ? formatCurrency(carrier.price_tax_exc, currencyFormat, currencySign, currencyBlank) : formatCurrency(carrier.price, currencyFormat, currencySign, currencyBlank))+'</span>';
										}
										else
										{
											html += txtFree;
										}

						html += 	'</td>'+
								'</tr>';
					});
					$('#carriers_list').append(html);

and of course remove one <th> in tpl file to achieve this:

		<div id="availableCarriers">
			<table cellspacing="0" cellpadding="0" id="availableCarriers_table" class="std">
				<thead>
					<tr>
						<th class="carrier_action first_item"></th>
						<th class="carrier_name item">{l s='Carrier' mod='carriercompare'}</th>
						<th class="carrier_price last_item">{l s='Price' mod='carriercompare'}</th>
					</tr>
				</thead>
				<tbody id="carriers_list">
					
				</tbody>
			</table>
		</div>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...