Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

coding question


djo

Recommended Posts

I've been playing with his for a couple of days, and I think I'm in over my head. I would appreciate any input.

 

This is what I am trying to do:

Some items in our store are post dated and show "product expected in stock on..."at the bottom of the product info page. We allow customers to purchase these items as backorders. I would like this disclaimer to also show up in the cart underneith the product name and attributes.

I'm not sure how to incorporate the info from product info into the shopping cart - I may be way off here, but I think these are the pieces of code I'm trying to merge.

 

 

 

 

 

From product_info.php

 

<?php
}

if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
  <tr>
	<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
  </tr>

 

 

Into shopping_cart.php

 

if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {

	reset($products[$i]['attributes']);

	while (list($option, $value) = each($products[$i]['attributes'])) {

	  $products_name .= '<br><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>';

	}

  }



  $products_name .= '	</td>' .

					'  </tr>' .

					'</table>';



  $info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"',

										 'text' => $products_name);

////I think the new code would go here////




  $info_box_contents[$cur_row][] = array('align' => 'center',

										 'params' => 'class="productListing-data" valign="top"',

										 'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));



  $info_box_contents[$cur_row][] = array('align' => 'right',

										 'params' => 'class="productListing-data" valign="top"',

										 'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>');

}

 

 

I don't really know anything about PHP, so this may be more involed than I realize. If that's the case, maybe just give me a nudge in the right direction and I'll go back to reading.

 

Thanks again.

Link to comment
Share on other sites

you have to look into the catalog\includes\classes\shopping_cart.php You need to modify the get_products method to store this products_date_available column. And then the products_date_available will be available into the catalog\shopping_cart.php

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...