Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hello,

 

i am installing the nice Buy_Two Bundle contrib... and it works fine.. after that i installed die Quantity Price Breaks Per Product Contrib.. it works fine too .. but now when i put a bundle in the shopping cart, i can?t see it there!

 

I think the problem is the Shopping_cart class.. i must remove some functions for the priceformatter class.. so anyone knows to fix the problem? or had installed both contribs to work together?

 

 

 function get_products() {
 global $languages_id;

 if (!is_array($this->contents)) return false;
$pf = new PriceFormatter;

 $products_array = array();
 reset($this->contents);
 while (list($products_id, ) = each($this->contents)) {
[b]/* REMOVED FOR QPB[/b]
   $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and ((pd.language_id = '" . (int)$languages_id . "') or ((pd.language_id != '" . (int)$languages_id . "') and p.products_bundle_status='1'))");
   if ($products = tep_db_fetch_array($products_query)) {
	 $prid = $products['products_id'];
	 $products_price = $products['products_price'];

	 $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
	 if (tep_db_num_rows($specials_query)) {
	   $specials = tep_db_fetch_array($specials_query);
	   $products_price = $specials['specials_new_products_price'];
	 }
[b]   REMOVED FOR QBP */[/b]
   if ($products = $pf->loadProduct($products_id, $languages_id)) {
	 $products_price = $pf->computePrice($this->contents[$products_id]['qty']);

	 $products_array[] = array('id' => $products_id,
							   'name' => $products['products_name'],
							   'model' => $products['products_model'],
							   'image' => $products['products_image'],
							   'price' => $products_price,
							   'einkauf' => $products['products_einkauf'],
							   'quantity' => $this->contents[$products_id]['qty'],
							   'weight' => $products['products_weight'],
							   'final_price' => ($products_price + $this->attributes_price($products_id)),
							   'tax_class_id' => $products['products_tax_class_id'],
							   'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));
   }
 }

 return $products_array;
  }

  function show_total() {
 $this->calculate();

 return $this->total;
  }

 

Greets

Marco

Posted (edited)

I found a solution for my problem:

 

Change this in your clas/priceformatter.php

 

function loadProduct($product_id, $language_id=2)
{
 $sql="select pd.products_name, p.products_model, p.products_image, p.products_id," .
  " p.manufacturers_id, p.products_price, p.products_einkauf, p.products_weight," .
  " p.products_price1,p.products_price2,p.products_price3,p.products_price4," .
  " p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty," .
  " p.products_qty_blocks," .
  " p.products_tax_class_id," .
  " IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price," .
  " IF(s.status, s.specials_new_products_price, p.products_price) as final_price" .
  " from " . TABLE_PRODUCTS_DESCRIPTION . " pd," .
  "	  " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id," .
  "	  " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id" .
  " where (p.products_status = '1' or (p.products_status='0' and p.products_bundle_status='1'))" .
  "   and p.products_id = '" . (int)$product_id . "'" .
  "   and pd.products_id = '" . (int)$product_id . "'" .
   "   and pd.language_id = '". (int)$language_id ."'";

 $product_info_query = tep_db_query($sql);
 $product_info = tep_db_fetch_array($product_info_query);
 $this->parse($product_info);

 return $product_info;
}

 

now the funny part.. on my test server it works fine.. but on my really site, it add the products but the price ist different.. bundle price in the product_info: 99,13 in my cart 99,00 .. i found out it writes in the database only values with .00 ...

 

Why happend this ?? is it a database config error or what?

 

Hope you unterstand my bad english :)

Edited by tt2k
Posted

i fixed my problem ..

 

changed the LC_ALL in the german.php and english.php to

 

@setlocale(LC_TIME, 'de_DE.ISO_8859-1');

 

now it works fine!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...