Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Trying to add form to product_listing_all.php


Marg

Recommended Posts

Posted

This has been an impossible task.

I am trying to add a link in the product_listing_all.php in hopes that the client can click it and add the product to a wishlist page (made into a print catalog page) I have tried every thing. Made a form link... no go. A normal link, nada.

It may simply be that I haven't the knowledge as to how to do this.

What I have used is the Quantity area, since I am not using it.

Here is a graphic of what I am trying to do:

print.jpg

 

Any help will be greatly appreciated or steer me in the right contibution direction.

Thanks,

Marg

 

To see what I am doing, please go to:

All Prods Page

 

To see the print catalog page (Link left column), you will need to log-in

[email protected]

test

Posted

This is one of the things I tried and kept getting a parse error:

 

$lc_text = tep_draw_form('wishlist_quantity' . $listing['products_id'], tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist&products_id=' . $listing['products_id']), 'GET') . tep_draw_input_field('products_id', '$product_info_values['products_id']') . tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</form> ';

 

 

Marg

Posted

i'm still rather new to php, but aren't you missing ) at the end of that statement?

 

i would think that entire part of code would all be part of the same function...

 

i could be wrong though

Posted

Let me ask this a different way...

How do I put this:

<?php echo tep_draw_form('wishlist_quantity', tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist')); ?> 
          <?php if (tep_session_is_registered('customer_id')) echo tep_draw_hidden_field('products_id', $product_info_values['products_id']) . tep_image_submit('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST); ?>

somewhere in here: (product_listing_all.php) so it shows up like the image above.

 

<?php
/*
 $Id: product_listing_all.php,v 1.44 2003/06/09 22:49:59 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS_PRODUCTS_LIST_ALL, 'p.products_id');

 if ( ($listing_split->number_of_rows > 0) && ( (PRODUCT_LIST_ALL_PREV_NEXT_BAR_LOCATION == '1') || (PRODUCT_LIST_ALL_PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
   <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
   <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
 </tr>
</table>
<?php
 }

 $list_box_contents = array();

 for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
   switch ($column_list[$col]) {
     case 'PRODUCT_LIST_ALL_MODEL':
       $lc_text = TABLE_HEADING_MODEL;
       $lc_align = '';
       break;
     case 'PRODUCT_LIST_ALL_NAME':
       $lc_text = TABLE_HEADING_PRODUCTS;
       $lc_align = '';
       break;
     case 'PRODUCT_LIST_ALL_MANUFACTURER':
       $lc_text = TABLE_HEADING_MANUFACTURER;
       $lc_align = '';
       break;
     case 'PRODUCT_LIST_ALL_PRICE':
       $lc_text = TABLE_HEADING_PRICE;
       $lc_align = 'right';
       break;
     case 'PRODUCT_LIST_ALL_QUANTITY':
       $lc_text = TABLE_HEADING_QUANTITY;
       $lc_align = 'right';
       break;
     case 'PRODUCT_LIST_ALL_WEIGHT':
       $lc_text = TABLE_HEADING_WEIGHT;
       $lc_align = 'right';
       break;
     case 'PRODUCT_LIST_ALL_IMAGE':
       $lc_text = TABLE_HEADING_IMAGE;
       $lc_align = 'center';
       break;
     case 'PRODUCT_LIST_ALL_BUY_NOW':
       $lc_text = TABLE_HEADING_BUY_NOW;
       $lc_align = 'center';
       break;
   }

   if ( ($column_list[$col] != 'PRODUCT_LIST_ALL_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_ALL_IMAGE') ) {
     $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);
   }

   $list_box_contents[0][] = array('align' => $lc_align,
                                   'params' => 'class="productListing-heading"',
                                   'text' => ' ' . $lc_text . ' ');
 }

 if ($listing_split->number_of_rows > 0) {
   $rows = 0;
   $how_many_sold_out=0;

   $listing_query = tep_db_query($listing_split->sql_query);
   while ($listing = tep_db_fetch_array($listing_query)) {
     $rows++;

     if (($rows/2) == floor($rows/2)) {
       $list_box_contents[] = array('params' => 'class="productListing-even"');
     } else {
       $list_box_contents[] = array('params' => 'class="productListing-odd"');
     }

     $cur_row = sizeof($list_box_contents) - 1;

     for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
       $lc_align = '';

       switch ($column_list[$col]) {
         case 'PRODUCT_LIST_ALL_MODEL':
           $lc_align = '';
           $lc_text = ' ' . $listing['products_model'] . ' ';
           break;
         case 'PRODUCT_LIST_ALL_NAME':
           $lc_align = '';
           if (isset($HTTP_GET_VARS['manufacturers_id'])) {
             $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';
           } else {
             $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> ';
           }
           break;
         case 'PRODUCT_LIST_ALL_MANUFACTURER':
           $lc_align = '';
           $lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a> ';
           break;
         case 'PRODUCT_LIST_ALL_PRICE':
// WebMakers.com Added: Shoppe Enhancement Controller
           $displayed_price = tep_get_products_display_price($listing['products_id']);

           $lc_align = 'right';
           $lc_text = $displayed_price;
           break;
         case 'PRODUCT_LIST_ALL_QUANTITY':
           $lc_align = 'right';
           $lc_text = ' ' . $listing['products_quantity'] . ' ';
           break;
         case 'PRODUCT_LIST_ALL_WEIGHT':
           $lc_align = 'right';
           $lc_text = ' ' . $listing['products_weight'] . ' ';
           break;
         case 'PRODUCT_LIST_ALL_IMAGE':
           $lc_align = 'center';
           if (isset($HTTP_GET_VARS['manufacturers_id'])) {
             $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], (SMALL_IMAGE_WIDTH * (((100 - IMAGE_PRODUCT_LISTING_ALL_PERCENTAGE)/100))) , (SMALL_IMAGE_HEIGHT * (((100 - IMAGE_PRODUCT_LISTING_ALL_PERCENTAGE)/100))) ) . '</a>';
           } else {
             $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], (SMALL_IMAGE_WIDTH * (((100 - IMAGE_PRODUCT_LISTING_ALL_PERCENTAGE)/100))) , (SMALL_IMAGE_HEIGHT * (((100 - IMAGE_PRODUCT_LISTING_ALL_PERCENTAGE)/100)))) . '</a> ';
           }
           break;
         case 'PRODUCT_LIST_ALL_BUY_NOW':
/*
           $lc_align = 'center';
           $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
           break;
*/
// BOF: WebMakers.com Added: Shoppe Enhancement Controller
// select the right buy now or More Info for Call for Price Showroom Only
           $lc_qty_min_units=tep_get_products_quantity_min_units_display($listing['products_id']);
           // qty discounts available
           if (tep_get_products_price_quantity_discount_on($listing['products_id'])) {
             $discounts_on='<br>' . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_ICONS . 'icon_status_green.gif') . ' ' . DISCOUNTS_AVAILABLE_TEXT . '</a>';
           } else {
             $discounts_on='';
           }
           switch (true) {
           // login for prices
             case (LOGIN_CONTROLLER_ON=='true' and (LOGIN_TO_SHOW_PRICES=='true' or LOGIN_TO_SHOP=='true') and !tep_session_is_registered('customer_id')):
               $lc_align = 'right';
               $lc_text = '<a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . tep_image_button('button_login.gif',LOGIN_TO_SHOW_PRICES_TEXT) . '</a>';
               break;
             case (tep_get_products_price_is_call($listing['products_id'])):
               $lc_align = 'right';
               $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . PRODUCTS_PRICE_IS_CALL_FOR_PRICE_MORE_INFO_TEXT . '</a>' . '<br>' . $lc_qty_min_units;
               break;
             case (tep_get_products_price_is_showroom_only($listing['products_id'])):
               $lc_align = 'right';
               $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . PRODUCTS_PRICE_IS_SHOWROOM_ONLY_MORE_INFO_TEXT . '</a>' . '<br>' . $lc_qty_min_units;
               break;
             case (tep_get_products_priced_by_attribute($listing['products_id']) or tep_has_product_attributes($listing['products_id'])):
               $lc_align = 'right';
               $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . PRODUCTS_PRICE_IS_PRODUCTS_PRICED_BY_ATTRIBUTE_MORE_INFO_TEXT . '</a>' . '<br>' . $lc_qty_min_units . $discounts_on;
               break;
             case (STOCK_ALLOW_CHECKOUT=='false' and tep_get_products_stock($listing['products_id']) <= 0):
               $lc_align = 'right';
               $lc_text = (SOLD_OUT_IMAGE_ON=='1' ? tep_image(DIR_WS_IMAGES . SOLD_OUT_IMAGE, '', '', SOLD_OUT_TEXT) . '<br>' : SOLD_OUT_TEXT) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . PRODUCTS_PRICE_IS_PRODUCTS_PRICED_BY_ATTRIBUTE_MORE_INFO_TEXT . '</a>' . '<br>' . $lc_qty_min_units;
               break;
             default:
               $lc_align = 'center';
               if (tep_get_products_stock($listing['products_id']) <= 0) {
                 $lc_text = (SOLD_OUT_IMAGE_ON=='1' ? tep_image(DIR_WS_ICONS . 'icon_status_red.gif', '', '', SOLD_OUT_TEXT) : SOLD_OUT_TEXT . '<br>');
                 $how_many_sold_out++;
               } else {
                 $lc_text='';
               }
               $lc_text .= '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing['products_name'] . TEXT_NOW) . '</a> ' . '<br>' . $lc_qty_min_units . $discounts_on;
             break;
           }
// EOF: WebMakers.com Added: Shoppe Enhancement Controller

       }

       $list_box_contents[$cur_row][] = array('align' => $lc_align,
                                              'params' => 'class="productListing-data"',
                                              'text'  => $lc_text);
     }
   }

   new productListingBox($list_box_contents);
 } else {
   $list_box_contents = array();

   $list_box_contents[0] = array('params' => 'class="productListing-odd"');
   $list_box_contents[0][] = array('params' => 'class="productListing-data"',
                                  'text' => TEXT_NO_PRODUCTS);

   new productListingBox($list_box_contents);
 }

 if ( ($listing_split->number_of_rows > 0) && ((PRODUCT_LIST_ALL_PREV_NEXT_BAR_LOCATION == '2') || (PRODUCT_LIST_ALL_PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
   <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
   <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
 </tr>

<?php
// BOF: WebMakers.com Added: show sold out legend
if ($how_many_sold_out > 0 ) {
?>
 <tr>
   <td class="smallText" align="right" colspan="2"><?php echo tep_image(DIR_WS_ICONS . 'icon_status_red.gif', '', '', SOLD_OUT_TEXT) . ' ' . SOLD_OUT_TEXT_LEGEND; ?></td>
 </tr>
<?php
}
// EOF: WebMakers.com Added: show sold out legend
?>

</table>
<?php
 }
?>

 

Any assistance is greatly appreciated.

Marg

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...