Prestashop template modification "More Info" Tab
€8-30 EUR
Kulipwa wakati wa kujifungua
Hi
We import a supplier csv which has the description field as follow:
<div id=HTML_SPEC class=ITSs>
<div class=ITSg>Group Feature Title 1</div>
<div class=ITSr0>
<div class=ITSn>Feature 1</div>
<div class=ITSv>Value 1</div>
</div>
<div class=ITSr1>
<div class=ITSn>Feature 2</div>
<div class=ITSv>Value 2</div>
</div>
<div class=ITSr0>
<div class=ITSn>Feature 3</div>
<div class=ITSv>Value 3</div>
</div>
<div class=ITSg>Group Feature Title 2</div>
<div class=ITSr0>
<div class=ITSn>Feature 1</div>
<div class=ITSv>Value 1</div>
</div>
<div class=ITSr1>
<div class=ITSn>Feature 2</div>
<div class=ITSv>Value 2</div>
</div>
<div class=ITSg>Group Feature Title 3</div>
<div class=ITSr0>
<div class=ITSn>Feature 1</div>
<div class=ITSv>Value 1</div>
</div>
<div class=ITSr1>
<div class=ITSn>Feature 2</div>
<div class=ITSv>Value 2</div>
</div>
</div>
and we wish to have it displayed as a table in the "more info" Tab (Prestashop 1.6):
<table class="ITSs" border="0" width="100%" cellspacing="1">
<tr class="ITSg">
<td colspan="2">Group Feature Title 1</td>
</tr>
<tr class="ITSr0" bgcolor="#f4f4f4">
<td class="ITSn" width="35%" >Feature 1</td>
<td class="ITSv">Value 1</td>
</tr>
<tr class="ITSr1">
<td class="ITSn" width="35%">Feature 2</td>
<td class="ITSv">Value 2</td>
</tr>
<tr class="ITSr0" bgcolor="#f4f4f4">
<td class="ITSn" width="35%" >Feature 3</td>
<td class="ITSv">Value 3</td>
</tr>
<tr class="ITSg">
<td colspan="2">Group Feature Title 2</td>
</tr>
<tr class="ITSr0" bgcolor="#f4f4f4">
<td class="ITSn" width="35%" >Feature 1</td>
<td class="ITSv">Value 1</td>
</tr>
<tr class="ITSr1">
<td class="ITSn" width="35%">Feature 2</td>
<td class="ITSv">Value 2</td>
</tr>
<tr class="ITSg">
<td colspan="2">Group Feature Title 3</td>
</tr>
<tr class="ITSr0" bgcolor="#f4f4f4">
<td class="ITSn" width="35%" >Feature 1</td>
<td class="ITSv">Value 1</td>
</tr>
<tr class="ITSr1">
<td class="ITSn" width="35%">Feature 2</td>
<td class="ITSv">Value 2</td>
</tr>
</table>
And if Value = "Yes, Oui, Ja" replace with image /images/[login to view URL]
And if Value = "No, Non, Nein" replace with image /images/[login to view URL]
Coding is simple, something like (we are not familiar with Prestashop):
<?php function datasheet2table($datasheet) { $datasheet = trim($datasheet); $datasheet = str_replace("<div id=HTML_SPEC class=ITSs>","",$datasheet); $lines = explode("</div>",$datasheet); $spec = array(); $g = ""; // group $n = ""; // name $v = ""; // value foreach($lines as $k => $line) { $line = trim($line); $parts = explode(">",$line); $cdata = array_pop($parts); if (strpos($line,"ITSg")) { $g = $cdata; } if (strpos($line,"ITSn")) { $n = $cdata; } if (strpos($line,"ITSv")) { $v = $cdata; } if ($n && $v) { $spec[$g][$n] = $v; $n = ""; $v = ""; } } $html = ""; $html .= "<table class='ITSs' border='0' width='100%' cellspacing='1'>"; foreach($spec as $group => $features) { $html .= "<tr class='ITSg'><td colspan='2'>".$group."</td></tr>"; foreach($features as $name => $value) { $html .= "<tr class='ITSr'>"; $html .= "<td class='ITSn' width='35%'>".$name."</td>"; $html .= "<td class='ITSv'>"; switch($value) { case "Yes": $html .= "<img alt='Yes' src='/images/[login to view URL]' />"; break; case "No": $html .= "<img alt='No' src='/images/[login to view URL]' />"; break; default: $html .= $value; break; } $html .= "</td>"; $html .= "</tr>"; } } $html .= "</table>"; return $html; }
Best Regards
Kitambulisho cha Mradi: #14632782
Kuhusu mradi
Imetuzwa kwa:
I have been in the field of most creative ideas ( WEB ) for more than 10 years. Having a vast experience to design and developer web based applications using the latest and trending technologies. Relevant Skills and Zaidi
16 wafanyakazi huru wanazabuni wastani wa €30 kwa kazi hii
We have gone through your project requirement and we can do your project very efficiently, effectively and with 100% accuracy. we are available to start this work right now if get awarded. Relevant Skills and Experien Zaidi
I am extremely proficient in PHP/MySQL and Wordpress ,along with extensive experience with the latest standards Bootstrap / HTML5. I am able to build website. Relevant Skills and Experience HTML, PSD to HTML, Website Zaidi