Jump to content

Edit "FREE" on Carrier Shipping Option during checkout


Recommended Posts

Hi there,

 

Our new store is PS 1.5.6

 

With regards to shipping costs, my clients first place their orders, then we get back to them with shipping costs. This is because our products are varied and the shipping combinations are endless.
 
On my old 1.2.5 Prestashop website I edited my order_carriers.tpl to reflect : {if $carrier.id_carrier == 10 OR $carrier.id_carrier == 12}{l s='Shipping costs to be confirmed.'}{else}{l s='Free!'}{/if}
 
I tried to put this line in my new Prestashop 1.5.6 but my syntax for the carrier ID is probably incorrect as all 3 carriers are still showing "Free"
 
Any help would be much appreciated.
 
Kind regards,

 

 

 

 

Link to comment
Share on other sites

Figured out the solution to this.

 

The carrier ID syntax has obviously changed since 1.2.5 :)

 

I am running PS 1.5.6

 

I edited:  /theme/order-carrier.tpl

Lline:  182

 

Like so:

<div class="delivery_option_price">
									{if $option.total_price_with_tax && (!isset($free_shipping) || (isset($free_shipping) && !$free_shipping))}
										{if $use_taxes == 1}
											{if $priceDisplay == 1}
												{convertPrice price=$option.total_price_without_tax} {l s='(tax excl.)'}
											{else}
												{convertPrice price=$option.total_price_with_tax} {l s='(tax incl.)'}
											{/if}
										{/if}
									{else}
										{if $carrier.instance->id == 14 OR $carrier.instance->id == 15}{l s='Shipping costs to be confirmed.'}{else}{l s='Free!'}{/if}
									{/if}
								</div>
Link to comment
Share on other sites

The simplest is to go to: /themes/yourtheme/shopping-cart.tpl

 

Depending on your theme, about line 252

 

Find:

<td class="price" id="total_shipping">{l s='Free Shipping!'}</td> 

and change to: 

<td class="price" id="total_shipping">{l s='N/A'}</td> 
Edited by mandrin (see edit history)
Link to comment
Share on other sites

Yip,

 

I did that in Translation instead.

 

However, email now shows Shipping: $0...

 

Any idea on that?

 

 

The simplest is to go to: /themes/yourtheme/shopping-cart.tpl

 

Depending on your theme, about line 252

 

Find:

<td class="price" id="total_shipping">{l s='Free Shipping!'}</td> 

and change to: 

<td class="price" id="total_shipping">{l s='N/A'}</td> 
Link to comment
Share on other sites

Sorry about that :)

 

I will post that in a bit, but I forgot something else.

 

If your client chooses guest checkout, and then checks "guest-tracking" , then the screen that is presented will also show order details with 2 items we don't want. Namely "Weight" and "Shipping Cost".

 

You need to edit the following file:  /themes/yourtheme/order-detail.tpl

 

The latest versions of  Prestahop uses Smarty, so you can easily comment out lines by using " {* " (Curly Bracket Star) at the start of the line/lines, and " *} " (Star Curly Bracket) at the end of the line/lines.

Thus if you want to comment out: " I like Prestashop " , it would then look like this: " {*I like Prestashop*}

 

And if you want to comment out multiple lines:

" I like Prestashop

It is a great shopping cart

It is very popular"

 

It would then look like this:

{*I like Prestashop

It is a great shopping cart

It is very popular*}

 

So then, I commented out lines:  383 and 384 

Like so: 

<th class="first_item">{l s='Date'}</th>
				<th class="item">{l s='Carrier'}</th>
				{*<th class="item">{l s='Weight'}</th>*}
				{*<th class="item">{l s='Shipping cost'}</th>*}
				<th class="last_item">{l s='Tracking number'}</th>

And commented out this whole section from lines 399 to 410

Like so: 

{*<td>
            		<div class="mobile_table_title visible-phone">{l s='Weight'}</div>
                    <div class="mobile_table_content">
                    {if $line.weight > 0}{$line.weight|string_format:"%.3f"} {Configuration::get('PS_WEIGHT_UNIT')}{else}-{/if}
                    </div>
                 </td>
				<td>
            		<div class="mobile_table_title visible-phone">{l s='Shipping cost'}</div>
                    <div class="mobile_table_content">
                    {if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_INC}{displayPrice price=$line.shipping_cost_tax_incl currency=$currency->id}{else}{displayPrice price=$line.shipping_cost_tax_excl currency=$currency->id}{/if}
                    </div>
                </td>*}

As always, backup the files for which you are going to be changing the code. I just rename the original file and put "original" at the end.

"order-detail.tpl"  becomes "order-detailoriginal.tpl" and then I upload the edited file.

Link to comment
Share on other sites

Ok, now the e-mails.

 

If you un-checked things like "discounts" and "gift wrapping" in the back-end, they won't show in the checkout process or the guest tracking screens. What also won't show are the weights and shipping lines you edited.

 

However, the e-mails your clients receive when they placed an order still show everything you un-checked and/or edited out as above

 

So you need to go to: mails/en and edit the following 2 files:

 

In "order-conf.txt" I removed the following lines:

Products: {total_products}
Discounts: {total_discounts}
Shipping: {total_shipping}
Gift-wrapping: {total_wrapping}
 
So I ended up with this:
 
Hi {firstname} {lastname},

Thank you for your order on {shop_name}!

	Order: {order_name} placed on {date}
	Payment: {payment}

	Total paid: {total_paid}

	Carrier: {carrier}

	Delivery address:

	{delivery_block_txt}

	Billing address:

	{invoice_block_txt}

You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

If you have guest account, you can follow your order using this link: {guest_tracking_url}

{shop_url} powered by PrestaShopâ„¢

And in "order-conf.html" I removed the following lines:

 

<tr style="text-align: right;">
<td> </td>
<td style="background-color: #b9babe; padding: 0.6em 0.4em;" colspan="3">Products</td>
<td style="background-color: #b9babe; padding: 0.6em 0.4em;">{total_products}</td>
</tr>
<tr style="text-align: right;">
<td> </td>
<td style="background-color: #ebecee; padding: 0.6em 0.4em;" colspan="3">Discounts</td>
<td style="background-color: #ebecee; padding: 0.6em 0.4em;">{total_discounts}</td>
</tr>
<tr style="text-align: right;">
<td> </td>
<td style="background-color: #ebecee; padding: 0.6em 0.4em;" colspan="3">Gift-wrapping</td>
<td style="background-color: #ebecee; padding: 0.6em 0.4em;">{total_wrapping}</td>
</tr>
<tr style="text-align: right;">
<td> </td>
<td style="background-color: #dde2e6; padding: 0.6em 0.4em;" colspan="3">Shipping</td>
<td style="background-color: #dde2e6; padding: 0.6em 0.4em;">{total_shipping}</td>
</tr>
 
And ended up with this:
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Message from {shop_name}</title>
</head>
<body>
<table style="font-family: Verdana,sans-serif; font-size: 11px; color: #374953; width: 550px;">
<tbody>
<tr>
<td align="left"><a title="{shop_name}" href="{shop_url}"><img style="border: none;" src="{shop_logo}" alt="{shop_name}" /></a></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="left">Hi <strong style="color: {color};">{firstname} {lastname}</strong>,<br /><br />Thank you for shopping with <strong>{shop_name}</strong>!</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td style="background-color: {color}; color: #fff; font-size: 12px; font-weight: bold; padding: 0.5em 1em;" align="left">Order details</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="left">Order: <strong><span style="color: {color};">{order_name}</span> placed on {date}</strong> <br />Payment: <strong>{payment}</strong></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="left">
<table style="width: 100%; font-family: Verdana,sans-serif; font-size: 11px; color: #374953;"><!-- Title -->
<tbody>
<tr style="background-color: #b9babe; text-align: center;">
	<th style="width: 15%; padding: 0.6em 0;">Reference</th>
	<th style="width: 30%; padding: 0.6em 0;">Product</th>
	<th style="width: 20%; padding: 0.6em 0;">Unit price</th>
	<th style="width: 15%; padding: 0.6em 0;">Quantity</th>
	<th style="width: 20%; padding: 0.6em 0;">Total price</th>
</tr>
<tr>
<td colspan="5">
{products}
</td>
</tr>
<tr>
<td colspan="5">{discounts}</td>
</tr>
<tr style="text-align: right; font-weight: bold;">
<td> </td>
<td style="background-color: #f1aecf; padding: 0.6em 0.4em;" colspan="3">Total</td>
<td style="background-color: #f1aecf; padding: 0.6em 0.4em;">{total_paid}</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td style="background-color: {color}; color: #fff; font-size: 12px; font-weight: bold; padding: 0.5em 1em;" align="left">Shipping</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="left">Carrier: <strong>{carrier}</strong></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<table style="width: 100%; font-family: Verdana,sans-serif; font-size: 11px; color: #374953;">
<tbody>
<tr style="background-color: #b9babe; text-transform: uppercase;"><th style="text-align: left; padding: 0.3em 1em;">Delivery address</th><th style="text-align: left; padding: 0.3em 1em;">Billing address</th></tr>
<tr>
<td style="padding: 0.5em 0 0.5em 0.5em; background-color: #ebecee;">{delivery_block_html}</td>
<td style="padding: 0.5em 0 0.5em 0.5em; background-color: #ebecee;">{invoice_block_html}</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="left">You can review your order and download your invoice from the <a style="color: {color}; font-weight: bold; text-decoration: none;" href="{history_url}">"Order history"</a> section of your customer account by clicking <a style="color: {color}; font-weight: bold; text-decoration: none;" href="{my_account_url}">"My account"</a> on our shop.<br /><br /></td>
</tr>
<tr>
<td align="left">If you have a guest account, you can follow your order via the <a style="color: {color}; font-weight: bold; text-decoration: none;" href="{guest_tracking_url}">"Guest Tracking"</a> section on our shop.</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td style="font-size: 10px; border-top: 1px solid #D9DADE;" align="center"><a style="color: {color}; font-weight: bold; text-decoration: none;" href="{shop_url}">{shop_name}</a> powered by <a style="text-decoration: none; color: #374953;" href="http://www.prestashop.com/">PrestaShop™</a></td>
</tr>
</tbody>
</table>
</body>
</html>

I also don't like "Total Paid" so I changed that to just say "Total" :

<td style="background-color: #f1aecf; padding: 0.6em 0.4em;" colspan="3">Total</td>
Link to comment
Share on other sites

×
×
  • Create New...