Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
price list plugin, need help
Hi all !

I wish to create a plugin to create/edit and display list price as a table.

You can see what I manualy done here :

My list price will be like that :
Quote:Title -------------------- Price
--------First category--------
-First item ------- First Price
-Sec item ------- Sec Price
------Second category------
-First item ------- First Price
-Sec item ------- Sec Price
I'm very bad with multidimensional array use and I need your help to know how to do.

I've begin code (probably the function to write each item in xml file, I'm using echo function but just to watch the result with a temporary variable) but it is surely false :
$title = 'Prestations';
$empty = '&nbsp;';
$title_price = 'Prix (€)';
$subtitle = array("sub 1", "sub 2", "sub 3");
$item = array(); <=== Don't know how to fix value for each item with $subtitle

echo '<table>';
echo '<colgroup>';
echo '<col class="colonne-title" /><col class="colonne-empty" /><col class="colonne-price" /></colgroup>';
echo '<tbody><tr><td><h3>'.$title.'</h3></td>';
echo '<td><h3>'.$empty.'</h3></td>';
echo '<td><h3>'.$title_price.'</h3></td></tr>';

foreach ($subtitle as $num_sub){
    echo '<tr><td><h4>'.$subtitle[$num_sub].'</h4></td>';
    echo '<td>'.$empty.'</td><td>'.$empty'</td></tr>';
    foreach ($item as $num_item){    
        echo '<tr><td>'.$item[$num_sub][$num_item].'</td><td>'.$empty.'</td><td>'.$item_price[$num_sub][$num_item].'</td></tr>';
echo '</tbody></table>';

Next time I will need help to create the user interface to add/delete subtitle and item.

Thanks for your help

Messages In This Thread
price list plugin, need help - by didou038 - 2012-04-29, 19:48:29

Users browsing this thread: 1 Guest(s)