Prestashop template modification "More Info" Tab

Inaendelea Ilichapishwa Miaka 6 iliyopita Kulipwa wakati wa kujifungua
Inaendelea 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

HTML PSD hadi HTML Kubuni Tovuti

Kitambulisho cha Mradi: #14632782

Kuhusu mradi

16 mapendekezo Mradi wa mbali Ipo mtandaoni %project.latestActivity_relativeTime|badilisha%

Imetuzwa kwa:

sahildeveloper01

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

€23 EUR kwa siku 1
(Maoni 17)
4.2

16 wafanyakazi huru wanazabuni wastani wa €30 kwa kazi hii

jayesh793

Thank you for considering my bid! I read through the job details extremely carefully and I am absolutely sure that I can do the project very well. Relevant Skills and Experience We have worked on similar projects to w Zaidi

€24 EUR kwa siku 1
(Maoni 16)
4.8
marlinbyte

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

€25 EUR kwa siku 1
(Maoni 14)
4.1
rajchadokar123

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

€23 EUR kwa siku 1
(Maoni 4)
3.5
Bijimol

We are adhered to strict timelines and schedules . We believe in quality, as we understand the needs of our customer and respects their time and money. Relevant Skills and Experience I am expertise in designing the Zaidi

€19 EUR kwa siku 5
(Maoni 1)
0.6