Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

KiLLaH

Archived
  • Posts

    55
  • Joined

  • Last visited

Posts posted by KiLLaH

  1. Is there a simple way to make a content file for the frontpage (index.php), instead of the system using the default index.php file in oscommerce can be a pain as it detects php between the columns. I tried to create content/index.php.html which failed.

  2. OK, guys...I'll give a stab at this.

     

    Check that you do not have Gzip on in the Admin settings. If you absolutely need it, then lower the Gzip setting.

     

    Also, SEO URLS is very finicky when used with other contributions. Here is a post from Nov 2005 that may be of some interest to you:

     

     

    I simply disabled the GZip compression and it showed my template. Thanks! :)

  3. I am also experiencing that problem. Checked and rechecked everything. Only thing installed besides this is SEO URLS contribution.

     

    Cheers,

     

    Santo

     

    I also have the SEO URLS contribution installed, i wonder what may create a conflict, currently everything works when i set the template to false (i wonder why? ;)).

     

    But id be glad to hear suggestions for solving the issue!

  4. I have finally upgraded my STS v3 to the latest (v4.3). Now as i proceed to test the system i set STS to "true" in the "Default" menu (admin), now i get the problem that nothing appears on catalog index.

     

    To be sure i have checked all files over again a few times and i cannot spot the problem. :blink:

  5. Ive got a problem heres the summary:

     

    Version: Version 2.4.1

     

    Error:

    Parse error: parse error in /www/link/shop/account_history_info.php on line 351

     

    Line 351:

    <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

     

    Line 129-197:

    <?php
     if (sizeof($order->info['tax_groups']) > 1) {
    ?>
                     <TR>
                       <TD CLASS="main" COLSPAN="2"><B><?php echo HEADING_PRODUCTS; ?></B></TD>
                       <TD CLASS="smallText" ALIGN="right"><B><?php echo HEADING_TAX; ?></B></TD>
                       <TD CLASS="smallText" ALIGN="right"><B><?php echo HEADING_TOTAL; ?></B></TD>
                     </TR>
    <?php
     } else {
    ?>
                     <TR>
                       <TD CLASS="main" COLSPAN="3"><B><?php echo HEADING_PRODUCTS; ?></B></TD>
                     </TR>
    <?php
     }
    
     for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
       echo '          <tr>' . "\n" .
            '            <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
            '            <td class="main" valign="top">' . $order->products[$i]['name'];
    
       if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
         for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
           echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
         }
       }
    
       echo '</td>' . "\n";
    
       if (sizeof($order->info['tax_groups']) > 1) {
    // Begin RMA Returns
    if ($order->products[$i]['return'] == '1') {
    $rma_query_one = tep_db_query("SELECT returns_id FROM " . TABLE_RETURNS_PRODUCTS_DATA . " where products_id = '" . $order->products[$i]['id'] . "' and order_id = '" . $HTTP_GET_VARS['order_id'] . "'");
    $rma_query = tep_db_fetch_array($rma_query_one);
    $rma_number_query = tep_db_query("SELECT rma_value FROM " . TABLE_RETURNS . " where returns_id = '" . $rma_query['returns_id'] . "'");
    $rma_result = tep_db_fetch_array($rma_number_query);
    
    $return_link = '<b>' . TEXT_RMA . ' # <u><a href="' . tep_href_link(FILENAME_RETURNS_TRACK, 'action=returns_show&rma=' . $rma_result['rma_value'], 'NONSSL') . '">' . $rma_result['rma_value'] . '</a></u></b>';
    } else {
    $return_link = '<a href="' . tep_href_link(FILENAME_RETURN, 'order_id=' . $HTTP_GET_VARS['order_id'] . '&products_id=' . ($order->products[$i]['id']), 'NONSSL') . '"><b><u>' . TEXT_RETURN_PRODUCT .'</a></u></b>';
    }
    // Don't show Return link if order is still pending or processing
    // You can change this or comment it out as best fits your store configuration
    if (($orders_status == '1') OR ($orders_status == '2') ) {
    $return_link = '';
    }
       echo '          <tr>' . "\n" .
            '            <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
            '            <td class="main" valign="top">' . $order->products[$i]['name'];
       if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
         for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
           echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
         }
       }
    echo $return_link;
    // JLM: End RMA Returns
    
       echo '</td>' . "\n";
     } 
    ?>

  6. To KiLLah:

     

    In your $HTTP_POST_VARS listing, you can see that there is one extra field:

    ["extra_field"]=> array(1) { [2]=> string(4) "Testing extra". If it is not in database, error is in the switch ($action), case 'update_product'.

     

    Here is the code I have in this section:

     

            // START: Extra Fields Contribution (Chapter 1.2)
             $extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id = " . (int)$products_id);
             while ($products_extra_fields = tep_db_fetch_array($extra_fields_query)) {
               $extra_product_entry[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];
             }
    
             if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
               foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) {
                 if (isset($extra_product_entry[$key])) { // an entry exists
                   if ($val == '') tep_db_query("DELETE FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " where products_id = " . (int)$products_id . " AND  products_extra_fields_id = " . $key);
                   else tep_db_query("UPDATE " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " SET products_extra_fields_value = '" . tep_db_input($val) . "' WHERE products_id = " . (int)$products_id . " AND  products_extra_fields_id = " . $key);
                 }
                 else { // an entry does not exist
                   if ($val != '') tep_db_query("INSERT INTO " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " (products_id, products_extra_fields_id, products_extra_fields_value) VALUES ('" . (int)$products_id . "', '" . $key . "', '" . tep_db_input($val) . "')");
                 }
               }
             } // Check to see if there are any need to update extra fields.
             // END: Extra Fields Contribution

     

    Try to 'echo' some values inside this code, to see what is really processed (and keep the tep_redirect commented).

     

    I have started the multi-language version, ready soon...

     

    I have tried the diffrent stuff but yet still backed with the same errors and problems i cant really see what is what right now. Would you like to check the categories.php source to see if you can see anything wrong setup?

     

    Thanks in advance.

  7. Heres how i added according to your description:

     

          case 'update_product':
         var_dump ($HTTP_POST_VARS);
           if (isset($HTTP_POST_VARS['edit_x']) || isset($HTTP_POST_VARS['edit_y'])) {
             $action = 'new_product';

     

    And commented out the tep_redirect line which was in this case.

  8. So problem should be with the update of fields in database.

    In the switch ($action) near begining of categories.php, find case 'update_product':

    and add this right after:

     

    var_dump ($HTTP_POST_VARS);

     

    and comment the last line of this case, just before the break:

    // tep_redirect (...

     

    Try to insert or update a product having extra fields. The var_dump instruction will display on the screen the variables that have been posted. Extra fields should be there. If they are, check the extra fields code for the update (chapter 1.2). If they are not, problem is with the re-posted values that we discussed previously.

     

     

    This is what it writes on the top when i click the "update" and go back to the product list in admin.

     

    array(55) { ["products_status"]=> string(1) "1" ["products_date_available"]=> string(0) "" ["manufacturers_id"]=> string(0) "" ["products_tax_class_id"]=> string(1) "1" ["products_price"]=> string(8) "255.2000" ["products_price_gross"]=> string(3) "319" ["products_quantity"]=> string(1) "0" ["products_model"]=> string(5) "12124" ["products_previous_image"]=> string(9) "12124.jpg" ["products_previous_image_sm_1"]=> string(0) "" ["products_previous_image_xl_1"]=> string(0) "" ["products_previous_image_sm_2"]=> string(0) "" ["products_previous_image_xl_2"]=> string(0) "" ["products_previous_image_sm_3"]=> string(0) "" ["products_previous_image_xl_3"]=> string(0) "" ["products_previous_image_sm_4"]=> string(0) "" ["products_previous_image_xl_4"]=> string(0) "" ["products_previous_image_sm_5"]=> string(0) "" ["products_previous_image_xl_5"]=> string(0) "" ["products_previous_image_sm_6"]=> string(0) "" ["products_previous_image_xl_6"]=> string(0) "" ["products_qty_blocks"]=> string(1) "1" ["products_price1"]=> string(8) "232.0000" ["products_price1_qty"]=> string(2) "22" ["products_price2"]=> string(9) "2323.0000" ["products_price2_qty"]=> string(3) "222" ["products_price3"]=> string(9) "2323.0000" ["products_price3_qty"]=> string(2) "22" ["products_price4"]=> string(9) "2323.0000" ["products_price4_qty"]=> string(3) "222" ["products_weight"]=> string(5) "0.130" ["products_sort_order"]=> string(1) "0" ["products_date_added"]=> string(19) "2004-07-27 23:23:20" ["x"]=> string(2) "60" ["y"]=> string(1) "7" ["products_name"]=> array(1) { [4]=> string(45) "Product name here" } ["products_info"]=> array(1) { [4]=> string(0) "" } ["products_description"]=> array(1) { [4]=> string(1221) "Product description: blah blah " } ["products_url"]=> array(1) { [4]=> string(0) "" } ["extra_field"]=> array(1) { [2]=> string(4) "Testing extra" } ["products_image"]=> string(9) "12124.jpg" ["products_image_med"]=> string(0) "" ["products_image_lrg"]=> string(0) "" ["products_image_sm_1"]=> string(0) "" ["products_image_xl_1"]=> string(0) "" ["products_image_sm_2"]=> string(0) "" ["products_image_xl_2"]=> string(0) "" ["products_image_sm_3"]=> string(0) "" ["products_image_xl_3"]=> string(0) "" ["products_image_sm_4"]=> string(0) "" ["products_image_xl_4"]=> string(0) "" ["products_image_sm_5"]=> string(0) "" ["products_image_xl_5"]=> string(0) "" ["products_image_sm_6"]=> string(0) "" ["products_image_xl_6"]=> string(0) "" }

     

    And yet it doesnt add the extrafields..

  9. The code you mention is added as you say:

     

    <?php
    /* Re-Post all POST'ed variables */
         reset($HTTP_POST_VARS);
         while (list($key, $value) = each($HTTP_POST_VARS)) {
           if (!is_array($HTTP_POST_VARS[$key])) {
             echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
           }
         }
         $languages = tep_get_languages();
         for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
           echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));
           echo tep_draw_hidden_field('products_info[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_info[$languages[$i]['id']])));
           echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));
           echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));
         }
             // START: Extra Fields Contribution
         if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
         foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) {
    // reset ($extra_fields_array);
    // while (list ($key, $val) = each ($extra_fields_array)) {
             echo tep_draw_hidden_field('extra_field['.$key.']', stripslashes($val));
           }
         } // Check to see if there are any need to update extra fields.
         // END: Extra Fields Contribution
    ................................ and so on..

  10. Hi,

     

    I suppose the error comes because there is no extra fields defined for the product you want to preview (fields are empty), and the foreach loop does not like empty arrays => you can try to replace the foreach loop by this one:

     

    reset ($extra_fields_array);
    while (list ($key, $val) = each ($extra_fields_array)) {

     

    Chris

     

    Hello Chris,

     

    I tried replacing the line:

     

             <?php 
    // START: Extra Fields Contribution
             $extra_fields_names_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_EXTRA_FIELDS);
             while ($extra_fields_names = tep_db_fetch_array($extra_fields_names_query)) {
               $extra_field_name[$extra_fields_names['products_extra_fields_id']] = $extra_fields_names['products_extra_fields_name'];
             }
    
             if ($HTTP_GET_VARS['read'] == 'only') {
               $products_extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id=" . (int)$HTTP_GET_VARS['pID']);
               while ($products_extra_fields = tep_db_fetch_array($products_extra_fields_query)) {
    //v1.3b       echo "Hi";
                 $extra_fields_array[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];
               }
             }
             else {
               $extra_fields_array = $HTTP_POST_VARS['extra_field'];
             }
    
    //          if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
    //            foreach ($extra_fields_array as $key=>$val) {
                 reset ($extra_fields_array);
                 while (list ($key, $val) = each ($extra_fields_array)) {
               ?>
                 <b><? echo $extra_field_name[$key];?>:</b> <? echo $val;?><br />
               <?
               }
    //         } // Check to see if there are any need to update extra fields.
             // END: Extra Fields Contribution
    //   echo "<br />" . $pInfo->products_description;
            ?>

     

    I got this error when i viewed a product again:

     

    Warning: reset(): Passed variable is not an array or object in /www/url.com/shop/admin/categories.php on line 1493

     

    Warning: Variable passed to each() is not an array or object in /www/url.com/shop/admin/categories.php on line 1494

     

    Although i also noticed something else that when i typed in a value when editing a product it shows the value on the viewing page where you can click "update", but it doesnt save the value of the extra field? I think the problem is still because of this?

     

    Thanks for the reply.

  11. Hello everyone,

     

    I have currently made an fresh install of Extra Fields.

     

    URL: http://www.oscommerce.com/community/contri...ll/search,extra

     

    Version: 1.3c

     

    Everything went fine until i got this error when i tried to view the product (http://www.url.com/shop/admin/categories.php?cPath=28_30_119&pID=368&action=new_product_preview&read=only)

     

    This problem is obviously why i cannot save the data in the fields on each product.

     

    Case:

    ---

     

    Error:

     

    Warning: Invalid argument supplied for foreach() in /www/url.com/shop/admin/categories.php on line 1492

     

    Line 1492 in admin/categories.php:

     

    foreach ($extra_fields_array as $key=>$val) {

     

    Entire code:

     

             <?php 
    // START: Extra Fields Contribution
             $extra_fields_names_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_EXTRA_FIELDS);
             while ($extra_fields_names = tep_db_fetch_array($extra_fields_names_query)) {
               $extra_field_name[$extra_fields_names['products_extra_fields_id']] = $extra_fields_names['products_extra_fields_name'];
             }
    
             if ($HTTP_GET_VARS['read'] == 'only') {
               $products_extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id=" . (int)$HTTP_GET_VARS['pID']);
               while ($products_extra_fields = tep_db_fetch_array($products_extra_fields_query)) {
    //v1.3b       echo "Hi";
                 $extra_fields_array[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];
               }
             }
             else {
               $extra_fields_array = $HTTP_POST_VARS['extra_field'];
             }
    
    //v1.3b          if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
               foreach ($extra_fields_array as $key=>$val) {
               ?>
                 <b><? echo $extra_field_name[$key];?>:</b> <? echo $val;?><br />
               <?
               }
    //v1.3b          } // Check to see if there are any need to update extra fields.
             // END: Extra Fields Contribution
    //   echo "<br />" . $pInfo->products_description;
            ?>

  12. Hi all,

     

    I have currently tried to install this module:

     

    http://www.oscommerce.com/community/contributions,1242

     

    The latest update "02/14/2004 - File by File MS2 Installation"

     

    But theres a slight problem with the price update in the cart, it just shows 0.00 even though theres something there.

     

    This is how my shopping_cart.php looks like:

     

    http://nopaste.php-q.net/43745

     

    If anyone know what i have missed out or have a clue what it is please let me know, ive checked it through alot of times now.

     

    Thanks in advance.

  13. Hello all,

     

    I have tried to modify my xsell_products.php by removing the (annoying) arrays because of the insufficient use of tables.

     

    Problem is that the code gives no error at all and it doesnt view anything either, but be aware that i have added 'xsell' products to the following product im viewing.

     

    This is how it looks like [catalog/modules/xsell_products.php]:

     

    <?php

    /*

    $Id: xsell_products.php, v1 2002/09/11

     

    osCommerce, Open Source E-Commerce Solutions

    <http://www.oscommerce.com>

     

    Copyright © 2002 osCommerce

     

    Released under the GNU General Public License

    */

     

    if ($HTTP_GET_VARS['products_id']) {

    $products_to_products_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name from " . TABLE_PRODUCTS_XSELL . " xp, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where xp.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_status = '1' and pd.products_name > '' order by xp.products_id asc limit " . MAX_DISPLAY_ALSO_PURCHASED);

    $products_to_products_count_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_XSELL . " pa where pa.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pa.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and pd.products_name > '' and p.products_status = '1'");

    $products_count = tep_db_fetch_array($products_to_products_count_query);

    }

    ?>

    <!-- xsell_products //-->

    <?php

     

    if ($products_count['count'] > 0) {

    echo '<table> ';

     

     

    while ($xsell = tep_db_fetch_array($xsell_query)) {

     

    $rows++;

    $products_to_products_list = '

    <tr><td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td><td valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] .'</a></td><td valign="top">' . $xsell_price. '</td><td valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $xsell['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $xsell['products_name'] . TEXT_NOW) .'</a></td></tr>

    ';

     

     

    $boxContent = $products_to_products_list;

     

     

    echo $boxContent;

     

    }

    echo '</table>';

    }

    ?>

  14. I installed WYSIWYG and it seem to work right now..

    Although theres another problem now which is with the Ultra Pics contribution..

     

    When i use the additional images system i add an picture of same size in Small and XL as i use the thumbnail system to resize the pictures automatically.. Although when i have added same file in the fields and then goto the product, i see the product as a small picture. Although when i click the picture and it pop-up's it shows the products main picture instead of the XL.

×
×
  • Create New...