How to remove the cost label after shipping method? opencart - opencart

How to remove the cost label after shipping method?
I tried to solve but failed
Please help

Try something like
Open File: catalog/view/theme/<your theme>/template/checkout/shipping_method.tpl
Find & remove code:
<td style="text-align: right;"><label for="<?php echo $quote['code']; ?>"><?php echo $quote['text']; ?></label></td>
and then check it.

Related

Angular-xeditable - How to change height of a Textarea as you type in?

Recently I had a request to change the height of a Angular-xeditable TextArea as you type in, I've been trying to do a lot of changes to css but it doesn't work. Any help is highly appreciated.
Here is a solution for this that is to create your own directive on top of Angular-Xeditable. The key thing is when you use that directive and want to inject into Angular-Xeditable, you need to add the prefix "e-". For example, if you directive called "expanding", when you use that directive along with angular-xeditable, the directive name should be "e-expanding"
Have a look at my sample code below. Hope it helps
Link to example code
<h4>Angular-xeditable Textarea (Bootstrap 3)</h4>
<div ng-app="app" ng-controller="Ctrl">
<a href="#" editable-textarea="user.desc" e-expanding >
<pre>{{ user.desc || 'no description' }}</pre>
</a>
</div>

Cross Site Scripting Array Multiple Results

Hello lovely people of StackOverflow,
I built an application to store movies, so i can search for them at a later time. All is working but i'm trying to prevent XSS, I've looked at W3School htmlspecialchars, but the problem i'm running into is that i'm returning multiple fields results such a s"keywords" " category" "Date Saved" "Website".
I can prevent XSS on only one field but then the rest of the fields don't return any data.
Here is the code that echo's the data from the database:
echo "<tr align='center' bgcolor='#0f7ea3'>
<td height='25px'>"
.$results['Website']."</td>
<td>".$results['Keywords']."</td>
<td>".$results['Category']."</td>
<td>".$results['Date Saved']."</td>
<td> <a href='" . $results['Website'] . "'>Click To Access Your Link</a></td>
</tr>" ;
Hopefully I've explained my issue correctly.
Thanks
This is an update to the suggestion provided by "nobody"
The code provided was accurate except with the "." placement. Other than that, the code worked perfect.
Suggested:
<td>"htmlspecialchars(.$results['Date Saved'], ENT_QUOTES)."</td>
Correct Code:
<td>".htmlspecialchars($results['Date Saved'], ENT_QUOTES)."</td>
Complete Working Code:
echo "<tr align='center' bgcolor='#0f7ea3'>
<td height='25px'>"
.htmlspecialchars($results['Website'], ENT_QUOTES)."</td>
<td>".htmlspecialchars($results['Keywords'], ENT_QUOTES)."</td>
<td>".htmlspecialchars($results['Category'], ENT_QUOTES)."</td>
<td>".htmlspecialchars($results['Date Saved'], ENT_QUOTES)."</td>
<td> <a href='" . htmlspecialchars($results['Website'], ENT_QUOTES) . "'>Click To Access Your Link</a></td>
</tr>" ;
Thank you so much.
I think I understand your question but I don't know why you could only escape one result.
You can do:
echo "<tr align='center' bgcolor='#0f7ea3'>
<td height='25px'>"
.htmlspecialchars($results['Website'], ENT_QUOTES)."</td>
<td>".htmlspecialchars($results['Keywords'], ENT_QUOTES)."</td>
<td>".htmlspecialchars($results['Category'], ENT_QUOTES)."</td>
<td>".htmlspecialchars(.$results['Date Saved'], ENT_QUOTES)."</td>
<td> <a href='" . htmlspecialchars($results['Website'], ENT_QUOTES) . "'>Click To Access Your Link</a></td>
</tr>" ;
This prevents XSS by injecting JavaScript into the echo. Also notice that I used the ENT_QUOTES flag in the htmlspecialchars function. This escapes both double and single quotes as they are not escaped by default.
However, your script is still vulnerable if you don't verify the URL that can be injected in the href tag ($results['Website']).
By setting "javascript:alert(123);" as your URL you can still execute JavaScript. You need to verify that the URL starts with http:// or https://.

how to replace "opencart" word from back-end

i want to replace the "Opencart" word from my back-end by the name of my store. I mean the "Opencart" written before the "Administration" in back end and from its footer in Dashboard. Will please any one help me out?
Thank you..
I think "Opencart" not word but it's an image logo.
You can edit this line :
<div class="div2">
<img src="view/image/logo.png" title="<?php echo $heading_title; ?>" onclick="location = '<?php echo $home; ?>'" />
</div>
location file : admin/view/template/common/header.tpl

Change page data based on currency choice

I've been trying to create simple script that swaps table data based on the active currency code. It's for a size chart (on product.tpl).
PREMISE:
IF "USD" is active then display table "A" (Inches), ELSE display table "B" (Centimeters).
I'm a total hack with php/js, but enough to find my way into trouble. :)
I followed this thread to bring the currency code variable into "product.tpl": How to get currency to show on product page in opencart?
Now I'm just banging my head, I can't find the right variable to create the swap... I've tried multiple variations of a simple If/Else script, basically like this:
<?php if ($currency['code'] == $currency_code) { ?>
<td>15.5"</td>
<td>25"</td>
<?php } else { ?>
<td >40cm</td>
<td >64cm</td>
<?php } ?>
Anyone have a clue what the script might look like?
Or am I totally barking at the wrong cat here?? Thx
Just use the session value for the currency code...
<?php if($this->session->data['currency'] == 'USD') : ?>
<td>15.5"</td>
<td>25"</td>
<?php else: ?>
<td>40cm</td>
<td>60cm</td>
<?php endif; ?>

OSCommerce STS template flow-How to get output of a box in html file

I am trying to explore STS template system.
What i need to do is simple.
I just want to show a banner/box in the right column which is added from the OSC admin.
I have done the following steps:
added a banner from admin banner manager.
created a file in the includes/boxes directory under name customBanner.php
added this line in column_right.php include(DIR_WS_BOXES . 'customBanner.php');
And finally added the following code to customBanner.php
<?php
if ($banner = tep_banner_exists('dynamic', '170x158')) {
?>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><?php echo tep_display_banner('static', $banner); ?></td>
</tr>
</table>
<?php
}
?>
This code is basically used for OSC without STS template.
Now i need to know how STS template giving output in php.html files e.g.<td>$specialbox</td>. I mean how this variable is getting value from the sts.
and how can i show advertisement box in the right column.
You should add to the includes/modules/sts_inc/sts_user_code.php teh following code:
$sts->start_capture();
include(DIR_WS_INCLUDES . 'boxes/customBanner.php');
$sts->stop_capture('specialbox');
It also posible to use your own file to add this code but you should include its name in the admin->modules-> Default -> Files for normal template
You could add as many boxes as you like in the same way:
$sts->start_capture();
include(DIR_WS_INCLUDES . 'boxes/customBanner.php');
$sts->stop_capture('box1');
$sts->start_capture();
include(DIR_WS_INCLUDES . 'boxes/OTHERcustomBanner.php');
$sts->stop_capture('box2');