Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

QTpro & STS 4.5


Guest

Recommended Posts

Dear All,

 

I still didn't find any solution to integrate QTpro with STS 4.5. Who has the knowledge to create a QTpro tag in STS to put in product_info ?

 

Please help....

Link to comment
Share on other sites

Dear All,

 

I still didn't find any solution to integrate QTpro with STS 4.5. Who has the knowledge to create a QTpro tag in STS to put in product_info ?

 

Please help....

 

I don't use QTpro but you may want to try the following from the STS Power Pack site (STS add-ons):

 

OPEN AND MAKE CHANGES IN THIS FILE: catalog/includes/modules/sts_inc/product_info.php

 

Around line 63 replace this (or comment it out in order to switch back if needed):

 

--------------------------------------------------------

 

if ($products_attributes['total'] > 0) {

 

// Print the options header

 

$template_pinfo['optionheader'] = TEXT_PRODUCT_OPTIONS;

 

// Select the list of attribute (option) names

 

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

 

while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {

 

$products_options_array = array();

 

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

 

// For each option name, get the individual attribute (option) choices

 

while ($products_options = tep_db_fetch_array($products_options_query)) {

 

$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);

 

// If the attribute (option) has a price modifier, include it

 

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($product_info['products_tax_class_id'])) .') ';

 

}

 

}

 

 

 

// If we should select a default attribute (option), do it here

 

if (isset($cart->contents[$_GET['products_id']]['attributes'][$products_options_name['products_options_id']])) {

 

$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

 

} else {

 

$selected_attribute = false;

 

}

 

$template_pinfo['optionnames'] .= $products_options_name['products_options_name'] . ':<br>';

 

$template_pinfo['optionchoices'] .= tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . "<br>";

 

}

 

} else {

 

// No options, blank out the template variables for them

 

$template_pinfo['optionheader'] = '';

 

$template_pinfo['optionnames'] = '';

 

$template_pinfo['optionchoices'] = '';

 

}

 

 

 

------------------------------------------------------

 

With this:

 

------------------------------------------------------

 

//+++Begin of QT Pro STS hack+++

 

if ($products_attributes['total'] > 0) {

 

$QTproducts_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']);

 

//this require_once is needed for products without attributes to work also:

 

require_once(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');

 

$QTobj = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN;

 

$pad = new $QTobj($QTproducts_id);

 

$template_pinfo['QTattrib']=$pad->draw(); //now you can use "$QTattrib" as a placeholder in your product_info.php.html

 

} else {

 

// No options, blank out the template variables for them

 

$template_pinfo['QTattrib'] = '';

 

}

 

//+++End of QT Pro STS hack+++

 

 

 

-----------------------------------------------------

 

Thats all there is to change. To use it place the $QTattrib placholder in your product_info.php.html template page.

 

Hope this helped,

 

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

I don't use QTpro but you may want to try the following from the STS Power Pack site (STS add-ons):

 

Open and make the changes in the following file: catalog/includes/modules/sts_inc/product_info.php

 

Around line 63 replace this (or comment it out in order to switch back if needed):

 

 

 

 if ($products_attributes['total'] > 0) {
 // Print the options header
 $template_pinfo['optionheader'] = TEXT_PRODUCT_OPTIONS;  // Select the list of attribute (option) names
 $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");  while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
$products_options_array = array();
$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");	// For each option name, get the individual attribute (option) choices
while ($products_options = tep_db_fetch_array($products_options_query)) {
  $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);	  // If the attribute (option) has a price modifier, include it
  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($product_info['products_tax_class_id'])) .') ';
  }	}

// If we should select a default attribute (option), do it here
if (isset($cart->contents[$_GET['products_id']]['attributes'][$products_options_name['products_options_id']])) {
  $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
} else {
  $selected_attribute = false;
}	$template_pinfo['optionnames'] .= $products_options_name['products_options_name'] . ':<br>'; 
$template_pinfo['optionchoices'] .=  tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . "<br>"; 
 }
} else {
 // No options, blank out the template variables for them
 $template_pinfo['optionheader'] = '';
 $template_pinfo['optionnames'] = '';
 $template_pinfo['optionchoices'] = '';
}

With this:

 if ($products_attributes['total'] > 0) {

//+++Begin of QT Pro STS hack
$QTproducts_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']); 
//this require_once is needed for products without attributes to work also:
require_once(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');

$QTobj = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN;
$pad = new $QTobj($QTproducts_id);

 $template_pinfo['QTattrib']=$pad->draw(); //now you can use "QTattrib" as a placeholder in your product_info.php.html

/* 
//+++ commented this, because otherwise QT attributes do not work (only first line of attributes is shown)	// Print the options header
 $template_pinfo['optionheader'] = TEXT_PRODUCT_OPTIONS;  // Select the list of attribute (option) names
 $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");   while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
 $products_options_array = array();
 $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");	 // For each option name, get the individual attribute (option) choices
 while ($products_options = tep_db_fetch_array($products_options_query)) {
	$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);		// If the attribute (option) has a price modifier, include it
	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($product_info['products_tax_class_id'])) .') ';
	}

  }

 // If we should select a default attribute (option), do it here
 if (isset($cart->contents[$_GET['products_id']]['attributes'][$products_options_name['products_options_id']])) {
   $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
 } else {
	$selected_attribute = false;
 }


 $template_pinfo['optionnames'] .= $products_options_name['products_options_name'] . ':<br>'; 
 $template_pinfo['optionchoices'] .=  tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . "<br>"; 
}
*/

} else {
 // No options, blank out the template variables for them
 //$template_pinfo['optionheader'] = '';
 //$template_pinfo['optionnames'] = '';
 //$template_pinfo['optionchoices'] = '';  
 $template_pinfo['QTattrib'] = '';
}//+++End of QT Pro STS hack

 

 

Thats all there is to change. To use it place the $QTattrib placholder in your product_info.php.html template page.

 

Hope this helped,

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Thanks Bill!!!

 

It helped, QTpro now works with STS....

 

I think you helped a lot of people who were struggle with this integration in STS.

 

Many thanks again :D

Link to comment
Share on other sites

  • 1 year later...

This may be crazy but is there any way to integrate this with the stock count table - any help would be appreciated! Thanks in advance,

Emma

I don't use QTpro but you may want to try the following from the STS Power Pack site (STS add-ons):

 

Open and make the changes in the following file: catalog/includes/modules/sts_inc/product_info.php

 

Around line 63 replace this (or comment it out in order to switch back if needed):

 

 

 

 if ($products_attributes['total'] > 0) {
 // Print the options header
 $template_pinfo['optionheader'] = TEXT_PRODUCT_OPTIONS;  // Select the list of attribute (option) names
 $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");  while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
$products_options_array = array();
$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");	// For each option name, get the individual attribute (option) choices
while ($products_options = tep_db_fetch_array($products_options_query)) {
  $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);	  // If the attribute (option) has a price modifier, include it
  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($product_info['products_tax_class_id'])) .') ';
  }	}

// If we should select a default attribute (option), do it here
if (isset($cart->contents[$_GET['products_id']]['attributes'][$products_options_name['products_options_id']])) {
  $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
} else {
  $selected_attribute = false;
}	$template_pinfo['optionnames'] .= $products_options_name['products_options_name'] . ':<br>'; 
$template_pinfo['optionchoices'] .=  tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . "<br>"; 
 }
} else {
 // No options, blank out the template variables for them
 $template_pinfo['optionheader'] = '';
 $template_pinfo['optionnames'] = '';
 $template_pinfo['optionchoices'] = '';
}

With this:

 if ($products_attributes['total'] > 0) {

//+++Begin of QT Pro STS hack
$QTproducts_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']); 
//this require_once is needed for products without attributes to work also:
require_once(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');

$QTobj = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN;
$pad = new $QTobj($QTproducts_id);

 $template_pinfo['QTattrib']=$pad->draw(); //now you can use "QTattrib" as a placeholder in your product_info.php.html

/* 
//+++ commented this, because otherwise QT attributes do not work (only first line of attributes is shown)	// Print the options header
 $template_pinfo['optionheader'] = TEXT_PRODUCT_OPTIONS;  // Select the list of attribute (option) names
 $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");   while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
 $products_options_array = array();
 $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");	 // For each option name, get the individual attribute (option) choices
 while ($products_options = tep_db_fetch_array($products_options_query)) {
	$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);		// If the attribute (option) has a price modifier, include it
	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($product_info['products_tax_class_id'])) .') ';
	}

  }

 // If we should select a default attribute (option), do it here
 if (isset($cart->contents[$_GET['products_id']]['attributes'][$products_options_name['products_options_id']])) {
   $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
 } else {
	$selected_attribute = false;
 }


 $template_pinfo['optionnames'] .= $products_options_name['products_options_name'] . ':<br>'; 
 $template_pinfo['optionchoices'] .=  tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . "<br>"; 
}
*/

} else {
 // No options, blank out the template variables for them
 //$template_pinfo['optionheader'] = '';
 //$template_pinfo['optionnames'] = '';
 //$template_pinfo['optionchoices'] = '';  
 $template_pinfo['QTattrib'] = '';
}//+++End of QT Pro STS hack

 

 

Thats all there is to change. To use it place the $QTattrib placholder in your product_info.php.html template page.

 

Hope this helped,

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...