We are using OpenCart to setup an ordering system for a client of ours. Managers across the country will be placing orders through our website but all payments will be invoiced at a future time directly to the corporate accounting department. I would like to modify the "Flat Rate" shipping extension to show "N/A" for the price and have a value of "0".
I would want it to look like this:
If I try and set the "Cost" to "N/A" in the shipping extension, it still shows "$0.00" as the cost of shipping on the checkout page. Since we will be charging shipping costs in the final invoice that we create with our other accounting software, I do not want to mislead our client into thinking that shipping is "$0.00". I want it to say "N/A".
Can I adjust the "Cost" parameter to have a text variable instead of a number (i.e. "N/A" instead "0")? I see where I can do this in the database to already placed orders:
How can I make it so that the checkout screen shows "N/A" instead of "$0.00"?
Thanks in advance. I'm totally new to OpenCart and am still trying to wrap my head around it all.
Hi GWeb,
A quick hack would be to edit the template files so that the only thing changed is what the customer sees.
In catalog/view/theme/default/template/checkout/shipping_method.tpl
Find:
Add this on the next line:
In catalog/controller/checkout/confirm.php
Find:
Add this on the next line:
This will display N/A for the flat rate module.
Bear in mind it must be called "Flat Shipping Rate" as in the above line of code. If is is called something else change the above line of code to reflect this. If your site is multilingual you may need to replicate the above line of rode for each language.
jgsw
A quick hack would be to edit the template files so that the only thing changed is what the customer sees.
In catalog/view/theme/default/template/checkout/shipping_method.tpl
Find:
Code: Select all
<?php foreach ($shipping_method['quote'] as $quote) { ?>
Code: Select all
<?php if ($quote['code'] == "flat.flat") { $quote['text'] = "N/A"; } ?>
Find:
Code: Select all
<?php foreach ($totals as $total) { ?>
Code: Select all
<?php if ($total['title'] == "Flat Shipping Rate") { $total['text'] = "N/A"; } ?>
Bear in mind it must be called "Flat Shipping Rate" as in the above line of code. If is is called something else change the above line of code to reflect this. If your site is multilingual you may need to replicate the above line of rode for each language.
jgsw
Quick Edit Admin Panel (40% off!) - CSS Unique (only $10!)
Sticky Admin Menu (Free) - Add Scripts & Styles to head (Free)
Again, thank you for the help jgsw. Worked perfectly. (The path for the second file on my system is catalog/view/theme/default/template/checkout/confirm.tpl. Maybe your setup is different? Regardless, I found the "$totals as $total" line and added your suggestion underneath and it worked!)
A couple quick follow-up questions.
(1) Do you know where I can find where to adjust the variable for the confirmation email that gets sent out?
(2) Is there a way to change what gets added to the database? When I check the database, in the table "cmq_order_total", there is a field titled "text". Do you know where I can adjust the variable that gets sent to that database?
Thanks again!
A couple quick follow-up questions.
(1) Do you know where I can find where to adjust the variable for the confirmation email that gets sent out?
(2) Is there a way to change what gets added to the database? When I check the database, in the table "cmq_order_total", there is a field titled "text". Do you know where I can adjust the variable that gets sent to that database?
Thanks again!
How would this work with a FREE SHIPPING that i renamed to "Shipping quote setting will change after order" . Which are the variable then to change? I see here flat.flat and Flat Shipping Rate .
Sorry for the double post.
In addition to the above, I think you will need to edit the following too :
catalog/view/theme/default/template/mail/order.tpl - For Sent Out Email
catalog/view/theme/default/template/account/order_info.tpl - For Order History / Info
Just sharing
In addition to the above, I think you will need to edit the following too :
catalog/view/theme/default/template/mail/order.tpl - For Sent Out Email
catalog/view/theme/default/template/account/order_info.tpl - For Order History / Info
Just sharing
Hello, how would you do this in Open Cart 3.0.3.2 ? I checked the file and it has considerably changed from what it was in 2013 (Obviously expected)
The file looks like this now:
============
{% if error_warning %}
<div class="alert alert-warning alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}</div>
{% endif %}
{% if shipping_methods %}
<p>{{ text_shipping_method }}</p>
{% for shipping_method in shipping_methods %}
<p><strong>{{ shipping_method.title }}</strong></p>
{% if not shipping_method.error %}
{% for quote in shipping_method.quote %}
<div class="radio">
<label> {% if quote.code == code or not code %}
{% set code = quote.code %}
<input type="radio" name="shipping_method" value="{{ quote.code }}" checked="checked" />
{% else %}
<input type="radio" name="shipping_method" value="{{ quote.code }}" />
{% endif %}
{{ quote.title }} - {{ quote.text }}</label>
</div>
{% endfor %}
{% else %}
<div class="alert alert-danger alert-dismissible">{{ shipping_method.error }}</div>
{% endif %}
{% endfor %}
{% endif %}
<p><strong>{{ text_comments }}</strong></p>
<p>
<textarea name="comment" rows="8" class="form-control">{{ comment }}</textarea>
</p>
<div class="buttons">
<div class="pull-right">
<input type="button" value="{{ button_continue }}" id="button-shipping-method" data-loading-text="{{ text_loading }}" class="btn btn-primary" />
</div>
</div>
The file looks like this now:
============
{% if error_warning %}
<div class="alert alert-warning alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}</div>
{% endif %}
{% if shipping_methods %}
<p>{{ text_shipping_method }}</p>
{% for shipping_method in shipping_methods %}
<p><strong>{{ shipping_method.title }}</strong></p>
{% if not shipping_method.error %}
{% for quote in shipping_method.quote %}
<div class="radio">
<label> {% if quote.code == code or not code %}
{% set code = quote.code %}
<input type="radio" name="shipping_method" value="{{ quote.code }}" checked="checked" />
{% else %}
<input type="radio" name="shipping_method" value="{{ quote.code }}" />
{% endif %}
{{ quote.title }} - {{ quote.text }}</label>
</div>
{% endfor %}
{% else %}
<div class="alert alert-danger alert-dismissible">{{ shipping_method.error }}</div>
{% endif %}
{% endfor %}
{% endif %}
<p><strong>{{ text_comments }}</strong></p>
<p>
<textarea name="comment" rows="8" class="form-control">{{ comment }}</textarea>
</p>
<div class="buttons">
<div class="pull-right">
<input type="button" value="{{ button_continue }}" id="button-shipping-method" data-loading-text="{{ text_loading }}" class="btn btn-primary" />
</div>
</div>
Who is online
Users browsing this forum: No registered users and 72 guests