Jump to content
zonetown

[Contribution] QTpro - Quantity Tracking Professional

Recommended Posts

Hi again. I still do not know how to do this;

 

1, I want the "Out of stock" message to show in products_info.php for products with NO attributes too. As it is right now that message is only shown in the drop downs for products with several attributes.

 

2, Is it also possible to prevent adding to cart / show the popup for products without attributes?

 

Thanks! Help is very much appreciated!

 

In product_info.php you can add whatever you want for products without attributes like this:

	if ($products_attributes['total'] > 0) {
//++++ QT Pro: Begin Changed code
  $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : (int)$HTTP_GET_VARS['products_id']); 
  require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');
  $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN;
  $pad = new $class($products_id);
  echo $pad->draw();
//++++ QT Pro: End Changed Code
//+++  Above code is part of qtpro already.  Changes below for products without attributes
} else {
   Put code here for products without attributes. 
}

 

You can check the stock for the product by testing $product_info['products_quantity']. If its less than 1 output some HTML to tell the customer. You can also output some JS for a popup if the customer tries to add it to the cart. Something like this:

		  $out="<script LANGUAGE=\"JavaScript\"><!--\n";
	  $out.="  document.cart_quantity.onsubmit=alert('".TEXT_OUT_OF_STOCK_MESSAGE."');\n";
	  $out.="//--></SCRIPT>\n";
	  echo $out;

You could actually make the add to cart button go away, but thats more work and will be left as an exercise for the reader.

Share this post


Link to post
Share on other sites

I'm sorry to announce I will no longer be supporting this contribution or monitoring this thread. I have decided another shopping cart meets my needs better. Hopefully, someone else will pick up support of this contribution or a similar feature will appear in base osCommerce soon.

 

Ralph Day

Share this post


Link to post
Share on other sites

Thank you for all help and support Ralph! I could not have lived without this great contribution!! And thank you again for answering so quickly!

 

Just curious, maybe a bit off topic, but which shopping cart meets your needs better? :)

Share this post


Link to post
Share on other sites

Oh, a question related to the one above. How can I prevent the store from deactivating products out of stock? If I display the text "Out of stock" on the products page (for all products, with and without attributes) theres no need for the shop to change them to red. I want my visitors to be able to browse all products, even if they are out of stock for the moment.

 

If that is possible, can I still choose between true or false for "Allow Checkout"?

Share this post


Link to post
Share on other sites
In your product_info.php is the code which calls the attributes. It is a dynamic query that gets the current product_id number. In the part in products_info.php, change the part where it is getting the product_id number (it will most likely look something like tep_db_query("stuff goes here... WHERE products_id=."$product_id.");

 

Change the WHERE products_id=."$product_id." to WHERE products_id= '0'. Then go into your databases and change the universal set of attributes' products_id number (I dont know what the column is called) to 0. This should work.

 

 

If anyone is following this particular line of modification I started the process the other night and have found it's far more complicated than I originally thought!

 

Problem lies with where QTPro checks for attributes - basically it does the lookup several times through the checkout process and telling the system that it's Product_ID (x) for quantity etc but attributes from Product_ID (0) is turning into a nightmare. One thing it does is change from products_attributes to orders_products_attributes at some point, where exactly I'm trying to find at the moment.

 

If anyone can shed light on the sequence of events in OSC so I can see where to look to make the changes I'd appreciate it.

Share this post


Link to post
Share on other sites

I have installed QT Pro and have found that when an order is made the stock level is not updated for products with 2 or more attributes.

 

EG. createing an order for...

 

Tshirt - Stock is Altered correctly

Tshirt Attr.Black - Stock is Altered correctly

Tshirt Attr.Black.SizeM - Stock is not changed.

 

Is this a Standard QT Pro Bug or is it My Install which has other contributions added.


Its Only Me

Alex

Share this post


Link to post
Share on other sites
I have installed QT Pro and have found that when an order is made the stock level is not updated for products with 2 or more attributes.

 

EG. createing an order for...

 

Tshirt - Stock is Altered correctly

Tshirt Attr.Black - Stock is Altered correctly

Tshirt Attr.Black.SizeM - Stock is not changed.

 

Is this a Standard QT Pro Bug or is it My Install which has other contributions added.

 

 

I have the same problem. Any ideas?

Share this post


Link to post
Share on other sites

Hi

 

Does anyone know how to get the QTPro module to work with the 'Step-By-Step Manual Order Entry'?

 

The contribution can be found here: http://www.oscommerce.com/community/contributions,1589

 

It is a very handy contribution if you want to use your admin to manually create customers (they get a password email) or whether you buy an item for an existing customer...

 

The only problem is that the attributes can't be selected from Admin. Can anyone please help?

 

I have tried but failed to get the QTPro module to be compatible with it - does anyone have a working version they can please elaborate on their work as I am stuck :-(

 

Thanks in advance

 

BTW: Thanks for all your help Ralph. Sorry to hear you are no longer going to monitor this thread. Take Care :-)


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites

Is there any plans to release this for CRELoaded? I'm having such a hard time with other people's versions :(

Share this post


Link to post
Share on other sites

Looks like when you set

->Product Information

-->Product Info Attribute Display Plugin *base*

 

The contrib, takes the attribs to the order, but not when you have single_dropdown

Share this post


Link to post
Share on other sites

Hello all,

I am one of the many suffering from the problems of QTPro and PayPal IPN. I've been reading the forums and attempting the fixes presented, but with little luck. Many times, the files mentioned were not present in my oscommerce setup. Other times, there was no context given for the patches and the line numbers indicated ended up in what looked very much like the wrong places. Various patched files were posted up, but were posted either incorrectly (zip up those .php files if you want me to be able to download them) or the links were broken (files removed?). So I am going to present my setup here and hope that someone can tell me what files to modify, with appropriate context and approximate line numbers, and also if any tables need to be modified.

 

OSCommerce 2.2ms2

PayPal IPN v 1.1.2.11

QT Pro 4.1

 

Any help you can provide would be greatly appreciated. Solve the problem, and we'll send you some cookies ;)

Share this post


Link to post
Share on other sites
That didn't work, and actually it caused another problem where the IPN wasn't being accepted, which I fixed that by adding some extra single-quotes around the order ID and such, but no matter, the stock quantity still isn't being restocked and the products_stock_attributes setting is still NULL in the database.

 

Let me go ahead and show you what I have as my updateProducts function in Order.class.php. Maybe the problem is in there... (pardon the length!):

 

 ?function updateProducts(&$order) {
? ?// initialized for the email confirmation
? ?$this->products_ordered = '';
? ?$subtotal = 0;
? ?$total_tax = 0;
? ?for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
? ?// Stock Update - Joao Correia
//begin QT PRO/Paypal IPN
? ? ?$products_stock_attributes=null;
? ? ?if (STOCK_LIMITED == 'true') {
? ? ? ?$products_attributes = $order->products[$i]['attributes'];
// ? ? ? ?if (DOWNLOAD_ENABLED == 'true') {
//end QT PRO/Paypal IPN
? ? ? ? ?$stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?FROM " . TABLE_PRODUCTS . " p
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ON p.products_id=pa.products_id
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ON pa.products_attributes_id=pad.products_attributes_id
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";
? ? ? ? ?// Will work with only one option for downloadable products
? ? ? ? ?// otherwise, we have to build the query dynamically with a loop
//begin QT PRO/Paypal IPN
// ? ? ? ? ?$products_attributes = $order->products[$i]['attributes'];
//end QT PRO/Paypal IPN
? ? ? ?if (is_array($products_attributes)) {
? ? ? ? ?$stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
? ? ? ?}
? ? ? ?$stock_query = tep_db_query($stock_query_raw);
? ? ? ?if (tep_db_num_rows($stock_query) > 0) {
? ? ? ? ?$stock_values = tep_db_fetch_array($stock_query);
//begin QT PRO/Paypal IPN
? ? ? ?$actual_stock_bought = $order->products[$i]['qty'];
? ? ? ?$download_selected = false;
? ? ? ?if ((DOWNLOAD_ENABLED == 'true') && isset($stock_values['products_attributes_filename']) && tep_not_null($stock_values['products_attributes_filename'])) {
? ? ? ? ?$download_selected = true;
? ? ? ? ?$products_stock_attributes='$$DOWNLOAD$$';
? ? ? ?}
// ? ? ?If not downloadable and attributes present, adjust attribute stock
? ? ? ?if (!$download_selected && is_array($products_attributes)) {
? ? ? ? ?$all_nonstocked = true;
? ? ? ? ?$products_stock_attributes_array = array();
? ? ? ? ?foreach ($products_attributes as $attribute) {
? ? ? ? ? ?if ($attribute['track_stock'] == 1) {
? ? ? ? ? ? ?$products_stock_attributes_array[] = $attribute['option_id'] . "-" . $attribute['value_id'];
? ? ? ? ? ? ?$all_nonstocked = false;
? ? ? ? ? ?}
? ? ? ? ?} 
? ? ? ? ?if ($all_nonstocked) {
? ? ? ? ? ?$actual_stock_bought = $order->products[$i]['qty'];
? ? ? ? ?} ?else {
? ? ? ? ? ?asort($products_stock_attributes_array, SORT_NUMERIC);
? ? ? ? ? ?$products_stock_attributes = implode(",", $products_stock_attributes_array);
? ? ? ? ? ?$attributes_stock_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_stock_attributes = '$products_stock_attributes' AND products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
? ? ? ? ? ?if (tep_db_num_rows($attributes_stock_query) > 0) {
? ? ? ? ? ? ?$attributes_stock_values = tep_db_fetch_array($attributes_stock_query);
? ? ? ? ? ? ?$attributes_stock_left = $attributes_stock_values['products_stock_quantity'] - $order->products[$i]['qty'];
? ? ? ? ? ? ?tep_db_query("update " . TABLE_PRODUCTS_STOCK . " set products_stock_quantity = '" . $attributes_stock_left . "' where products_stock_attributes = '$products_stock_attributes' AND products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
? ? ? ? ? ? ?$actual_stock_bought = ($attributes_stock_left < 1) ? $attributes_stock_values['products_stock_quantity'] : $order->products[$i]['qty'];
? ? ? ? ? ?} else {
? ? ? ? ? ? ?$attributes_stock_left = 0 - $order->products[$i]['qty'];
? ? ? ? ? ? ?tep_db_query("insert into " . TABLE_PRODUCTS_STOCK . " (products_id, products_stock_attributes, products_stock_quantity) values ('" . tep_get_prid($order->products[$i]['id']) . "', '" . $products_stock_attributes . "', '" . $attributes_stock_left . "')");
? ? ? ? ? ? ?$actual_stock_bought = 0;
? ? ? ? ? ?}
? ? ? ? ?}
? ? ? ?}
// ? ? ? ?$stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
// ? ? ?}
// ? ? ?if (tep_db_num_rows($stock_query) > 0) {
// ? ? ? ?$stock_values = tep_db_fetch_array($stock_query);
// do not decrement quantities if products_attributes_filename exists
? ? ? ?if (!$download_selected) {
? ? ? ? ?$stock_left = $stock_values['products_quantity'] - $actual_stock_bought;
? ? ? ? ?tep_db_query("UPDATE " . TABLE_PRODUCTS . " 
? ? ? ? ? ? ? ? ? ? ? ?SET products_quantity = products_quantity - '" . $actual_stock_bought . "' 
? ? ? ? ? ? ? ? ? ? ? ?WHERE products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
//end QT PRO/Paypal IPN
? ? ? ? ?if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
? ? ? ? ? ?tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
? ? ? ? ?}
? ? ? ?}
? ? ?}
//begin QT PRO/Paypal IPN
? ?}
//end QT PRO/Paypal IPN

? ? ?// Update products_ordered (for bestsellers list)
? ? ?tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

? ? ?//begin QT PRO/Paypal IPN
? ? ?tep_db_query("update " . TABLE_ORDERS_PRODUCTS . " SET products_stock_attributes = '" . $products_stock_attributes . "' WHERE orders_id = '" . $this->orderID . "' AND orders_products_id = '" . $order->products[i]['orders_products_id'] . "'");
? ? ?//end QT PRO/Paypal IPN

? ? ?//------insert customer choosen option to order--------
? ? ?$attributes_exist = '0';
? ? ?$products_ordered_attributes = '';
? ? ?if (isset($order->products[$i]['attributes'])) {
? ? ? ?$attributes_exist = '1';
? ? ? ?for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
? ? ? ? ?if (DOWNLOAD_ENABLED == 'true') {
? ? ? ? ? ?$attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?on pa.products_attributes_id=pad.products_attributes_id
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? where pa.products_id = '" . $order->products[$i]['id'] . "'
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?and pa.options_id = popt.products_options_id
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?and pa.options_values_id = poval.products_options_values_id
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?and popt.language_id = '" . $this->languageID . "'
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?and poval.language_id = '" . $this->languageID . "'";
? ? ? ? ? ?$attributes = tep_db_query($attributes_query);
? ? ? ? ?} else {
? ? ? ? ? ?$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $this->languageID . "' and poval.language_id = '" . $this->languageID . "'");
? ? ? ? ?}
? ? ? ? ?$attributes_values = tep_db_fetch_array($attributes);
? ? ? ? ?if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename']) ) {
? ? ? ? ? ?$sql_data_array = array('orders_id' => $this->orderID,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'orders_products_id' => $order->products[$i]['orders_products_id'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'orders_products_filename' => $attributes_values['products_attributes_filename'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'download_maxdays' => $attributes_values['products_attributes_maxdays'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'download_count' => $attributes_values['products_attributes_maxcount']);
? ? ? ? ? ?tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
? ? ? ? ?}
? ? ? ? ?$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
? ? ? ?}
? ? ?}
? ? ?//------insert customer choosen option eof ----
? ? ?$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
? ? ?$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
? ? ?$total_cost += $total_products_price;

? ? ?//$currency_price = $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']);
? ? ?$products_ordered_price = $this->displayPrice($order->products[$i]['final_price'],$order->products[$i]['tax'],$order->products[$i]['qty']);

? ? ?$this->products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $products_ordered_price . $products_ordered_attributes . "\n";
? ?}
?}

 

Wanted to point out for those having IPN issues with QTPro & not deducting attribute stock, the combination of the two quoted posts has fixed it for me.

 

I also see the same issue with orders_products.products_stock_attributes being written with a null, but my store doesn't sell the type of products that are typically returned so I'm not as concerned.

Share this post


Link to post
Share on other sites

Hi,

 

Has anybody managed to get the "Actual Price" displayed instead of the standard + or - amount?

 

I have figured out that a change is probably needed to pad_base.php where it is building the loop ( _build_attributes_array ), but my PHP isn't good enough to get it working. I don't think that the products_price is available in this function, so perhaps another call to the database is needed to get the base price before adding/subtracting the amount.

 

Please help - I know from searching that quite a few other people are after this functionality too.

 

Thanks.

Share this post


Link to post
Share on other sites

OK, I think I have got it working...

 

In catalog\includes\classes\pad_base.php : -

 

Replace this function (or just change the two lines that I have commented): -

 

	function pad_base($products_id=0) {


  $this->products_id  = $products_id;

  if ($this->products_id != 0) {
	$tax_class_query = tep_db_query('SELECT products_tax_class_id, products_price	 /* ADDED COL*/
									 FROM ' . TABLE_PRODUCTS . " 
									 WHERE products_id = '" . (int)$products_id . "'");
	$tax_class_array = tep_db_fetch_array($tax_class_query);
	$this->products_tax_class_id = $tax_class_array['products_tax_class_id'];
	$this->products_original_price = $tax_class_array['products_price'];   /* ADDED THIS LINE */
  }

  $this->_SetConfigurationProperties('PRODINFO_ATTRIBUTE_');

}

 

 

Comment out this bit: -

 

		  // commented out +/- amount to show actual price
	  //if ($products_options['options_values_price'] != '0') {
	  //  $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($this->products_tax_class_id)) .')';
	  //}

 

And use this instead: -

 

 
// Start of Changes- display actual prices instead of +/-
		  $original_price = $this->products_original_price;
		  $option_price = $products_options['options_values_price'];
		  if ($products_options['price_prefix'] == "-") // in case price lowers, don't add values, subtract.
			{
				  $show_price = 0.0 + $original_price - $option_price; // force float (in case) using the 0.0;
			} else {
				$show_price = 0.0 + $original_price + $option_price; // force float (in case) using the 0.0;
			}
		  if ($products_options['options_values_price'] != '') {
			  $products_options_array[sizeof($products_options_array)-1]['text'] .= ' ('
			  . $currencies->display_price( $show_price, tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
		  }
// End Of Changes

 

I got the bulk of the code from one of the contributions, so all credit goes to the original author (can't remember which contribution it was).

 

Hope this helps somebody - it seems to work fine for me.

Share this post


Link to post
Share on other sites

Hi,

Great contribution! I have this installed on my test site along with Attribute Sets Plus and the Paypal IPN V1.1 and everything works great.

 

However, I'm trying to figure out how to force the selection of attributes from the product_info page. In my live site, I have this working where I have attribute called "-Please Select-" as the default option that shows in the list and if selected, a box pops up telling the you to that you need to select an option. This was easly implemented with some basic java script similar to one of the contributions currently available.

 

I'd like to be able to have this option but I just can't figure out where to put java script code. My coding abilities are limited so I'm wondering if anyone else has had any luck impletementing something similar with the QT Pro contrib and wouldn't mind sharing. If not, can anyone suggest where to modify the code or where to start.

 

Thanks!

Shayne

Share this post


Link to post
Share on other sites

Hi,

Great contribution! I have this installed on my test site along with Attribute Sets Plus and the Paypal IPN V1.1 and everything works great.

 

However, I'm trying to figure out how to force the selection of attributes from the product_info page. In my live site, I have this working where I have attribute called "-Please Select-" as the default option that shows in the list and if selected, a box pops up telling the you to that you need to select an option. This was easly implemented with some basic java script similar to one of the contributions currently available.

 

I'd like to be able to have this option but I just can't figure out where to put java script code. My coding abilities are limited so I'm wondering if anyone else has had any luck impletementing something similar with the QT Pro contrib and wouldn't mind sharing. If not, can anyone suggest where to modify the code or where to start.

 

Thanks!

Shayne

Share this post


Link to post
Share on other sites

Hi,

Great contribution! I have this installed on my test site along with Attribute Sets Plus and the Paypal IPN V1.1 and everything works great.

 

However, I'm trying to figure out how to force the selection of attributes from the product_info page. In my live site, I have this working where I have attribute called "-Please Select-" as the default option that shows in the list and if selected, a box pops up telling the you to that you need to select an option. This was easily implemented with some basic java script similar to one of the contributions currently available.

 

I'd like to be able to have this option but I just can't figure out where to put java script code. My coding abilities are limited so I'm wondering if anyone else has had any luck implementing something similar with the QT Pro contrib and wouldn't mind sharing. If not, can anyone suggest where to modify the code or where to start.

 

Thanks!

Shayne

Share this post


Link to post
Share on other sites

I'm an idiot! Sorry about the above posts... what the hell happened! I'm not sure how I ended up posting my question 3 times.

 

Again... so sorry. Is there anyway to delete the extra 2 posts?

Share this post


Link to post
Share on other sites
OK, I think I have got it working...

 

In catalog\includes\classes\pad_base.php : -

 

Replace this function (or just change the two lines that I have commented): -

 

	function pad_base($products_id=0) {
  $this->products_id  = $products_id;

  if ($this->products_id != 0) {
	$tax_class_query = tep_db_query('SELECT products_tax_class_id, products_price	 /* ADDED COL*/
									 FROM ' . TABLE_PRODUCTS . " 
									 WHERE products_id = '" . (int)$products_id . "'");
	$tax_class_array = tep_db_fetch_array($tax_class_query);
	$this->products_tax_class_id = $tax_class_array['products_tax_class_id'];
	$this->products_original_price = $tax_class_array['products_price'];   /* ADDED THIS LINE */
  }

  $this->_SetConfigurationProperties('PRODINFO_ATTRIBUTE_');

}

Comment out this bit: -

 

		  // commented out +/- amount to show actual price
	  //if ($products_options['options_values_price'] != '0') {
	  //  $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($this->products_tax_class_id)) .')';
	  //}

 

And use this instead: -

 

 
// Start of Changes- display actual prices instead of +/-
		  $original_price = $this->products_original_price;
		  $option_price = $products_options['options_values_price'];
		  if ($products_options['price_prefix'] == "-") // in case price lowers, don't add values, subtract.
			{
				  $show_price = 0.0 + $original_price - $option_price; // force float (in case) using the 0.0;
			} else {
				$show_price = 0.0 + $original_price + $option_price; // force float (in case) using the 0.0;
			}
		  if ($products_options['options_values_price'] != '') {
			  $products_options_array[sizeof($products_options_array)-1]['text'] .= ' ('
			  . $currencies->display_price( $show_price, tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
		  }
// End Of Changes

 

I got the bulk of the code from one of the contributions, so all credit goes to the original author (can't remember which contribution it was).

 

Hope this helps somebody - it seems to work fine for me.

i cant get it to show... can you please post your pad_base file here?

 

thanks


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites

Hi

 

Has any one used this mod where a product has different barcodes. Using the example often mentioned above, a tshirt comes in different sizes and different colors. Thus has a seperate barcode associated with it.

 

I guess you could add these in as an atribute but I can see this quickly getting out of hand (given the volume and ease of making mistakes). I imagine a better way would be to create the product with size and color, and then where you add the quantity, also add the barcode there.

 

Any thoughts?

 

Wired

Share this post


Link to post
Share on other sites

Hi

 

Also, is it possible to change the product image based on the drop down selection. I always have a problem with sites that allow me to chose a different color but dont show me what it actually looks like. (I should take a look at catalogues to see what they do!!).

 

Obviously not interested in sizes just colors.

 

Cheers

 

Wired

Share this post


Link to post
Share on other sites

hi

I were install QTpro4.25. It works wonderful. But I just had one problem!

 

In products_info page

 

A products

 

S - out of stock

M

 

Then, I put the M size in the cart.(M size just only one Quantity in stock).and checkout.

 

I view A product again, IT still show

 

S- out of stock

M

 

In fects the M size were out of stock too.

 

how can i do? Please help me!

 

Thanks very much

 

Sophian

Share this post


Link to post
Share on other sites

Hello all!

 

I already posted this somewhere else but I see now that this is the right place. Sorry about that.

Now to my problem.

 

I installed QTPro a long time ago for my store which has only 3 products.

All the products are of the same type, i.e. I have just one category.

My 3 products have sizes and colours though.

QTPro manages my stock perfectly. A truly awesome contrib, by the way.

 

So then I decided to eliminate the category, in order to have fewer clicks on my site.

But what then happened was that my dropdowns vanished completely!

So I'm stumped. I've been wrestling with this for a long time, but so far no solution.

Any ideas, anyone?

TIA

Dave

Share this post


Link to post
Share on other sites

Hi,

 

has somebody written a plugin for option type features? I can see the setup is basically there for admin in the files, so it seems weird that you cannot display it in product info as is right now.

 

Last mentioning I saw on the boards here was 2004. Any news?

 

TIA


:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×