Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Location
    France
    Posts
    577
    Plugin Contributions
    8

    Default Code on OSC port not working...Help please

    I'm in the process of porting a module from OSC. I've managed to get to grips with the differences between zen structure and osc structure, and to date, a large amount of the port is complete. I have hit a brick wall with one particular section of code that is supposed to call 3 bits of info from the database, namely the products threshold, products name and products id, then display them, and give an option of editing or deleting the products. I have run the sql as a query in phpmyadmin and it returns the correct data, but it fails to display the output on screen in zen admin.

    Code in question is:
    PHP Code:
      <?php    
                $gift 
    $db->Execute("select fg.*, p.products_id, pd.products_name from " TABLE_CARROT " fg, products p LEFT JOIN products_description pd ON (pd.products_id=fg.products_id)
                WHERE pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'    AND p.products_id = fg.products_id ORDER BY fg.threshold ASC");
                while (!
    $gift->EOF) {
                       
                echo 
    '<form action="gift_add.php" method="GET"><tr>
                <td class="smallText">$<input type="text" size="4" name="threshold" value="'
    .$gift['threshold'].'"></td>
                <td class="smallText">'
    .$gift['products_id'].'</td>
                <td class="smallText">'
    .$freeGifts['products_name'].'</td> 
                <td><a href="gift_add.php?ID=' 
    $gift['products_id'] . '&action=delete">' zen_image_button('button_delete.gif''Delete') . '</a>&nbsp;<a href="categories.php?pID=' $gift['products_id'] . '&action=new_product">' zen_image_button('button_edit.gif''Edit') . '</a></td>
                </tr></form>'
    ;
                
    $gift->MoveNext();    
                }
                
    ?>
    I have been looking for a solution to this all day and can't find a fix....perhaps i'm missing something obvious.

    Can anyone point me in the right direction to fix this??

    Thanks in advance
    Steve

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Code on OSC port not working...Help please

    Try using the ->fields identifier:
    Code:
    $gift->fields['products_id']
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Nov 2005
    Location
    France
    Posts
    577
    Plugin Contributions
    8

    Default Re: Code on OSC port not working...Help please

    Thanks a million Dr Byte. Worked a treat.
    Now i can move on to fixing the next section of the port....making it display in admin/categories that it has been flagged as a gift.

 

 

Similar Threads

  1. Help to port Worldship script from OSC to Zen
    By staft in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 17 Jun 2010, 04:41 AM
  2. Few lines code translation from osc to zencart - please help
    By Backstage in forum All Other Contributions/Addons
    Replies: 10
    Last Post: 14 Jul 2009, 08:49 AM
  3. TNT Shipping OSC >> ZEN Port Help
    By ozetrade in forum Addon Shipping Modules
    Replies: 2
    Last Post: 28 Jul 2008, 02:47 AM
  4. OSC mod porting - more help please - another code problem
    By strelitzia in forum Contribution-Writing Guidelines
    Replies: 0
    Last Post: 31 Oct 2007, 07:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR