Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Please help to modify a contribution


esurge

Recommended Posts

Hello all

 

I need some help on how to modify a contribution. The contribution is a bundle package system.

 

Bundled Products

 

The mod is very good, I like it but i would like to add a extra feature.

 

When a bundle is made it shows the names of all the product you are going to buy. I would like to make thoes name hyperlink to the individual products.

 

Here is the code for product_info.php.

 

Can some tell me where to start.

 

Jazz

 

 

<!-- start bundle -->
   <?php     
   if ($product_info['products_bundle'] == "yes") {
  	 $products_bundle = $product_info['products_bundle'];
  	 echo "This product contains the following items:";
	 $bundle_query = tep_db_query("	SELECT pd.products_name, pb.*, p.products_bundle, p.products_id, p.products_price
        	 FROM products p 
        	 INNER JOIN products_description pd
            ON p.products_id=pd.products_id
        	 INNER JOIN products_bundles pb
            ON pb.subproduct_id=pd.products_id 
        	 WHERE pb.bundle_id = " . tep_get_prid($products_id) . " and language_id = '" . (int)$languages_id . "'");
	 while ($bundle_data = tep_db_fetch_array($bundle_query)) {
   if ($bundle_data['products_bundle'] == "yes") {
  	 // uncomment the following line to display subproduct qty 
                             // echo "<br>» <b>" . $bundle_data['subproduct_qty'] . " x " . $bundle_data['products_name'] . "</b>";
  	 echo "<br>» <b> " . $bundle_data['products_name'] . "</b>";
  	 $bundle_query_nested = tep_db_query("	SELECT pd.products_name, pb.*, p.products_bundle, p.products_id, p.products_price
        	 FROM products p 
        	 INNER JOIN products_description pd
            ON p.products_id=pd.products_id
        	 INNER JOIN products_bundles pb
            ON pb.subproduct_id=pd.products_id 
        	 WHERE pb.bundle_id = " . $bundle_data['products_id'] . " and language_id = '" . (int)$languages_id . "'");
  	 while ($bundle_data_nested = tep_db_fetch_array($bundle_query_nested)) {
        	 // uncomment the following line to display subproduct qty 
                                   // echo "<br><i>     " . $bundle_data_nested['subproduct_qty'] . " x " . $bundle_data_nested['products_name'] . "</i>";
     echo "<br><i>     " . $bundle_data_nested['products_name'] . "</i>";
     $bundle_sum += $bundle_data_nested['products_price']*$bundle_data_nested['subproduct_qty'];
  	 }
   } else {
  	 // uncomment the following line to display subproduct qty 
                             // echo "<br>» <b>" . $bundle_data['subproduct_qty'] . " x " . $bundle_data['products_name'] . "</b>";
  	 echo "<br>» <b> " . $bundle_data['products_name'] . "</b>";
  	 $bundle_sum += $bundle_data['products_price']*$bundle_data['subproduct_qty'];
   }
	 }
	 $bundle_saving = $bundle_sum - $product_info['products_price'];
	 $bundle_sum = $currencies->display_price($bundle_sum, tep_get_tax_rate($product_info['products_tax_class_id']));
	 $bundle_saving =  $currencies->display_price($bundle_saving, tep_get_tax_rate($product_info['products_tax_class_id']));
                 // comment out the following line to hide the "saving" text
	 echo "<p><b>Cost of separate parts: " . $bundle_sum . '<br><font color="red">You save ' . $bundle_saving . '</font></b>';
   } 
   ?>
<!-- end bundle -->

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...