Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

I still have not been able to fix my problem mentioned HERE. I've tried to figure out the query statements myself, but they're just too complex for my brain. Please help.
I don't get it. You found and applied the changes needed for MySQL 5 (been confirmed to work) and now you don't know how to follow the easy instructions in the post you refer to? You can simply ignore all the if/else statements and just put those changes for products description in. Nothing fancy going on there.

 

If that doesn't work for you, describe what goes wrong.

Share this post


Link to post
Share on other sites
The store I am currently working on uses the Multi-Stores contrib and the way I would like to try and get SPPC to work is probably completely different to the ways other people use it.
I'm not familiar with the Multi-Stores contribution...
1. I would like to be able to use the PWA contribution for retail customers.

2. I would like trade clients to use the default create account system.

No problems there IMO. When they open an account and enter in a tax id number it will be flagged in admin (you make your own system for that, using a drop-down or a checkbox or whatever). You then manually put them into another group.
3. I would like to be able to add a group for dropshippers where they create an account the same way that the trade clients do with the exception that they will be able to place an order and enter their customers delivery details.
Now that is something new. Haven't heard of anyone doing something like that because normally the prices (of the client who logs in) go on the invoice whereas you want to have the retail prices on the invoice for the customer but you also need an invoice for the dropshipper with their prices? That is something special.

Share this post


Link to post
Share on other sites

mark27uk3:

MOD Fancier Invoice may be able to help a little with this, with some tweaking on the 'packing slip' portion. But you really need two customers linked by one orders_id so the dropshipper can have their invoice with discount and the customer's shipping box can have their invoice/packing slip with what they are paying the dropshipper, right?. SPPC can keep the two price groupings separate, but it is still one order, one invoice, one price per product according to the group YOUR customer is in. I've not heard of a dropshipper MOD yet though I've seen it mentioned/requested in several different places. Otherwise it would be easy enough, stock OSC will handle a "bill to" (your dropshipper) and a "ship to" (the customer/recipient).

 

Ramblin' on: maybe you could tweak the packing slip from Fancier Invoice to read in the retail price of the product ordered instead of the price as written into the database for the order. could get messy. think about who gets the money. are you the collector and you write a check to the dropshipper for the diff? You're the wholesaler and the dropshipper is your real customer? and the ship_to is their customer? And you are the one doing the shipping? Could you turn the relationship upside down and call it "affiliate" (even if only to yourself) dropshipping sounds so much cooler than affiliate, but they are very similar middle-sale arrangements. maybe draw out the flow of product & money and find MODS that do that function instead of MODS that are called what you think they should be called.


Toward Continued Success - - > Carol Hawkey - - > KidsLearnToSew.com - - > Wyoming, USA

Mods Installed - - > Authnet AIM2 - Bundled Products 1.4 - Fancier Invoice 6.1 - Email_HTML_Order_Link_Fixed - Header Tags Controller - Login aLa Amazon - JustOneAttribute - Article Manager - SPPC w/PB - spiders.txt - Dangling Carrot/Olive - Printable Catalog - CCGV(trad)

Planned Mods - - > Purchase Without Account - USPS Label - Ultimate SEO

Share this post


Link to post
Share on other sites
I don't get it. You found and applied the changes needed for MySQL 5 (been confirmed to work) and now you don't know how to follow the easy instructions in the post you refer to? You can simply ignore all the if/else statements and just put those changes for products description in. Nothing fancy going on there.

 

If that doesn't work for you, describe what goes wrong.

 

I think I need a little help with this one.

Is anyone modded EasyPopulate with SPPC, Price Breaks, Hide Prices, and Show Price list? I am using the SPPC mods and tried to add the easy populate but the prices did not come through.

Any ideas?

Share this post


Link to post
Share on other sites
I think I need a little help with this one.

Is anyone modded EasyPopulate with SPPC, Price Breaks, Hide Prices, and Show Price list? I am using the SPPC mods and tried to add the easy populate but the prices did not come through.

Any ideas?

 

IMHO, nobody have succeeded EasyPopulate to work with Price Breaks. You have to do your price for Price break at hand in the panel admin. But EasyPopulate work very well to update SPPC with Hide Prices, and Show Price list.

Edited by Jeep_ice

John

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

osCommerce 2.3.4 Bootstrap Edge

Share this post


Link to post
Share on other sites
IMHO, nobody have succeeded EasyPopulate to work with Price Breaks. You have to do your price for Price break at hand in the panel admin. But EasyPopulate work very well to update SPPC with Hide Prices, and Show Price list.

 

Ok! That's what i wanted to know. That's not a big deal to me! I can do the pricing from admin. Its the attributes that I don't like doing from admin. :angry:

Thanks!

Share this post


Link to post
Share on other sites
Ok! That's what i wanted to know. That's not a big deal to me! I can do the pricing from admin. Its the attributes that I don't like doing from admin. :angry:

Thanks!

 

The attribute is another thing too. I don't use Attribute on all the site web I do for Oscommerce because it's not work with SPPC and Easypopulate IMHO. So I don't use Attribute at all. >_< .

Edited by Jeep_ice

John

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

osCommerce 2.3.4 Bootstrap Edge

Share this post


Link to post
Share on other sites

I've looked around though was unable to find what I was looking for

 

I'm using sppc 3.5, though may be moving to 4.1 tomorrow.

 

Is there a means to set the wholesale group to minimum order cost?

 

Example

 

Retail can order as little or as much as they wish.

 

Wholesale group

Certain items may only be available in sets of 2 or 3, etc...

AND wholesale accounts must have a minimum cart total of $100.00 at checkout or an additional fee applies.

 

Do any contrib's do this that work well with sppc 4.1?

 

Thanks

 

Henry


My Contributions

 

Henry Smith

Share this post


Link to post
Share on other sites
I don't get it. You found and applied the changes needed for MySQL 5 (been confirmed to work)

Debian Etch (testing) upgraded to MySQL5 today. I saw it come through on dist-upgrade and thought I might end up here soon. Is there a basic thread/post that you all can point me to.

The one error that I notice right away is:

1054 - Unknown column 'p.products_id' in 'on clause'

select count(p.products_id) as total from products_description pd etc..etc..

I do remember seeing a post refering to this before but I can't seem to find it and your help is appriciated.

<Curt

Share this post


Link to post
Share on other sites
Debian Etch (testing) upgraded to MySQL5 today. I saw it come through on dist-upgrade and thought I might end up here soon. Is there a basic thread/post that you all can point me to.

The one error that I notice right away is:

1054 - Unknown column 'p.products_id' in 'on clause'

select count(p.products_id) as total from products_description pd etc..etc..

I do remember seeing a post refering to this before but I can't seem to find it and your help is appriciated.

That post regarding the sql for MySQL5 versions was one from January 4, post 1897, page 95 (unless the numbers of post per page gets changed). It has been confirmed to work (by others).

Share this post


Link to post
Share on other sites
Is there a means to set the wholesale group to minimum order cost?
There is a contribution called Minimum Order that does almost all of that and could be adapted to SPPC. This is how the client is stopped when his order amount is too low.

In checkout_confirmation.php, checkout_payment.php, checkout_shipping.php, and checkout_process.php pages after
 require(DIR_WS_CLASSES . 'order.php');
 $order = new order;

add the following lines:
// check order total minimum
 if ($order->info['subtotal'] < MIN_ORDER_AMOUNT) {
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'));
 }

The simplest change (in case of only one customer group you want a minimum order amount for) would be to add the customer group into the mix. So, say wholesale has customer group id 1:

 if ($order->info['subtotal'] < MIN_ORDER_AMOUNT && $_SESSION['sppc_customer_group_id'] == '1' )

Certain items may only be available in sets of 2 or 3, etc...
That is a standard feature in Quantity Price Breaks for SPPC but I don't know if there are simpler contributions (but then you have to adapt it for SPPC yourself). QPB for SPPC is fairly easy to install (IMHO) so that shouldn't be a show stopper.

Share this post


Link to post
Share on other sites

Hi,

 

JanZ, Thank you for your thoughts a few posts back, It has really given me something to think about.

 

I have taken the plunge finally and installed the SPPC contrib and I must say it was easier than I thought. My store is heavily modified and I honestly thought I was going to have a nightmare.

 

I have started to run into a couple of problems that I am not sure how to resolve and was wondering if you could take a look at some code for me. I am trying to change the whats_new box of mine which is completely different to the stock one.

 

The different prices will just not show, I know it has something to do with the way I have my queries setup.

 

This is the code

 

<!-- new_products //-->
<tr>
<td>
<TABLE WIDTH=162 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
	<TD COLSPAN=3>
		<IMG SRC="images/boxes/table_value.gif" WIDTH=162 HEIGHT=18></TD>
</TR>
<TR>
<td>
<?php
 $info_box_contents = array();


 if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
// start random new products
$new_products_query = tep_db_query("select substring(pd.products_description, 1, 300) as products_description, p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' and pd.products_description != '' and p.products_id = pd.products_id order by p.products_date_added desc limit " . MAX_RANDOM_SELECT_NEW);
 } else {
$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_RANDOM_SELECT_NEW);
// end random new products	
 }
// start random new products
 // To configure:
 //
 // Under Admin - Configuration - Maximum Values
 // Set the following:
 //  'Selection of Random New Products' 
 //   (MAX_RANDOM_SELECT_NEW) - Sets how many of the most recent new product entries are queried
 //  'New Products Module'
 //   (MAX_DISPLAY_NEW_PRODUCTS) - Sets how many random new products are displayed on screen
 //
 $row = 0;
 $col = 0;
 $pCount = 0;
 $info_box_contents = array();
 $found_products = array();
 $num_rows = tep_db_num_rows($new_products_query);
 if (MAX_DISPLAY_NEW_PRODUCTS > MAX_RANDOM_SELECT_NEW) {
// don't allow more new products than will be queried
$max_new_products = MAX_RANDOM_SELECT_NEW;
 } else {
$max_new_products = 2;
 }
 if ($num_rows < $max_new_products) {
  $max_new_products = $num_rows;
 }
//  echo "num_rows: " . $num_rows . " max_new_products " . $max_new_products . "<br>";
 if ($num_rows > 0) {		
while ($pCount < $max_new_products) {	
  // choose a random row 
  $random_product = '';
  $random_row = tep_rand(0, ($num_rows - 1));
  tep_db_data_seek($new_products_query, $random_row);
  $random_product = tep_db_fetch_array($new_products_query);
  // see if found already, if not use else skip
  $found = 0;
  for ($ii=0; $ii < $pCount; $ii++) {
	if ($found_products[$ii] == $random_product['products_id']) {
	  $found = 1;
	  break;
	}
  }
  if ($found == 0) {
	// keep track of found id's
	$found_products[$pCount] += $random_product['products_id'];
	$pCount ++; 
	// add to display array
	$random_product['products_name'] = tep_get_products_name($random_product['products_id']);
	  $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']);
	// BOF Separate Pricing Per Customer
	// global variable (session) $sppc_customer_group_id -> local variable customer_group_id

	  if(!tep_session_is_registered('sppc_customer_group_id')) {
	  $customer_group_id = '0';
	  } else {
	   $customer_group_id = $sppc_customer_group_id;
	  }

		   if ($customer_group_id !='0') {
		$customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $random_product['products_id'] . "' and customers_group_id =  '" . $customer_group_id . "'");
		  if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
			$random_product['products_price'] = $customer_group_price['customers_group_price'];
		  }
		 }
	// EOF Separate Pricing Per Customer

	$info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="33%" valign="top"',
									   'text' => '<b><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</b></a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], WHATSNEW_IMAGE_WIDTH, WHATSNEW_IMAGE_HEIGHT) . '</a><br><span class="whats_new" width="100%">' . tep_flatten_product_description($random_product['products_description'], '</span><br><br><font color="#ff3333">' . TEXT_OUR_PRICE . '  ' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '<br><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $random_product['products_id']) . '">' . tep_image_buttona('read_more.gif', IMAGE_BUTTON_READ_MORE) . '</a> <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $random_product['products_id']) . '">' . tep_image_buttonb('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>') . '<br><br>');
	$col ++;
	if ($col > 0) {
	  $col = 0;
	  $row ++;
	}
  } // found
} // while pCount
 } // num_rows  
// end random new products

 new contentBoxa($info_box_contents);
?>
 </TD>
</TR>

</TABLE>
</td>
</tr>
<!-- new_products_eof //-->

 

If someone would mind helping out then that would be great.

 

Thanks

 

Mark


Lifes a bitch, then you marry one, then you die!

Share this post


Link to post
Share on other sites

Hi

I were install the "Seperate Pricing Per Customer 4.1", it's very wonderful.But, I just had one problem.

I were also install the "featured_products_v1.5.2".The file named catalog\featured_products.php can't show the right price.

catalog\featured_products.php code just as below:

 

$featured_products_array = array();

$featured_products_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by p.products_date_added DESC, pd.products_name";

$featured_products_split = new splitPageResults($featured_products_query_raw, MAX_DISPLAY_FEATURED_PRODUCTS);

 

if (($featured_products_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {

?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="smallText"><?php echo $featured_products_split->display_count(TEXT_DISPLAY_NUMBER_OF_FEATURED_PRODUCTS); ?> </td>

<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $featured_products_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

?>

<tr>

<td> <!-- Featured Products Main Page Box -->

<table bgcolor="ffffff" border="0" width="100%" cellspacing="0" cellpadding="2">

<?php

if ($featured_products_split->number_of_rows > 0) {

$featured_products_query = tep_db_query($featured_products_split->sql_query);

while ($featured_products = tep_db_fetch_array($featured_products_query)) {

if ($new_price = tep_get_products_special_price($featured_products['products_id'])) {

$products_price = '<s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</span>';

} else {

$products_price = $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id']));

}

?>

<tr>

<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>

<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '"><b><u>' . $featured_products['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($featured_products['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $featured_products['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>

<td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>

</tr>

<tr>

<td colspn="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

} else {

?>

<tr>

<td class="main"><?php echo TEXT_NO_NEW_PRODUCTS; ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

?>

</table>

</td>

</tr>

<?php

if (($featured_products_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {

?>

<tr>

<td>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="smallText"><?php echo $featured_products_split->display_count(TEXT_DISPLAY_NUMBER_OF_FEATURED_PRODUCTS); ?></td>

<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $featured_products_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

</tr>

</table>

</td>

</tr>

<?php

}

?>

</table></td>

<!-- body_text_eof //-->

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

Please Help Me!!

Thank You!!

Share this post


Link to post
Share on other sites

Hi Kevin,

 

All contributions are available from the contributions site, if you place your mouse pointer over the 'Community' tab at the top of the page and click contributions you will then be able to do a search for any contribution that you require.

 

This is the direct link to the SPPC contribution page here

 

Mark


Lifes a bitch, then you marry one, then you die!

Share this post


Link to post
Share on other sites
The attribute is another thing too. I don't use Attribute on all the site web I do for Oscommerce because it's not work with SPPC and Easypopulate IMHO. So I don't use Attribute at all. >_< .

 

Are you serious!!!! I thought that this was the main reason for using Easy populate. I really need to be able to update the attributes easily. I guess I will have to find something else to update the attributes. :blink:

 

2 quick questions:

1. Does the quick updates for SPPC allow you to enter a qty for each product attribute?

2. If not, anyone have any suggestions as to a good mod to allow quantities for product attributes?

Share this post


Link to post
Share on other sites
I think it has to do with the index page indeed and your host using MySQL5. Can you change your index.php to use the queries mentioned in this post on page 95, close to the bottom? Hopefully those are MySQL5 valid and get rid of the error.

 

Let us know when it does, than we have confirmation of that.

 

Does anyone have an updated index.php with the applied queries to fix this problem please? I have been staring at the code on Page 95 of this forum for the last two hours and i can;t find those queries in my index.php.. :rolleyes: . Using SPP 4.1 and PHP5 an no other contributions installed, and have that :

 

1054 - Unknown column 'p.products_id' in 'on clause'

 

select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials_retail_prices s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '21'

 

[TEP STOP]

 

..doh. :blush: ..maybe I am missing something obvious but need some sleep...thanks in advance

Mark

Share this post


Link to post
Share on other sites
Are you serious!!!! I thought that this was the main reason for using Easy populate. I really need to be able to update the attributes easily. I guess I will have to find something else to update the attributes. :blink:

 

2 quick questions:

1. Does the quick updates for SPPC allow you to enter a qty for each product attribute?

2. If not, anyone have any suggestions as to a good mod to allow quantities for product attributes?

 

I don't about quick updates for SPPC but I will try when I have time :rolleyes: . I use EasyPopulate to change my prices.


John

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

osCommerce 2.3.4 Bootstrap Edge

Share this post


Link to post
Share on other sites
2 quick questions:

1. Does the quick updates for SPPC allow you to enter a qty for each product attribute?

2. If not, anyone have any suggestions as to a good mod to allow quantities for product attributes?

 

Yes. SPPC Quick Updates does allow you to enter/update a product Qty.

 

Good Luck.

Share this post


Link to post
Share on other sites
I have started to run into a couple of problems that I am not sure how to resolve and was wondering if you could take a look at some code for me. I am trying to change the whats_new box of mine which is completely different to the stock one.

 

The different prices will just not show, I know it has something to do with the way I have my queries setup.

It took me quite a bit of time to see what is going on, but I think I figured it out.

 

What IMO goes wrong is that the module will only do a query for the customer_group_price when the information on the product hasn't been picked up yet by the $new_products_query.

 

You also need to to adapt the code above that to SPPC (for example getting the table specials out: won't work because of the way this table has been changed with the customer_group_id, if you do and have a special for the same product for more than one group you will end up with multiple appearances of it in the module). Look at the code for new_products.php for how to do that and add in the customer group prices and special prices. The code you added looks fine (but is only used when the products_id has not been picked up in the $new_products_query).

Share this post


Link to post
Share on other sites

Hi Jan,

 

Thanks for the reply!

 

Well what you said has got me completely stumped because I dont understand what actually goes on in the sppc new_products code :blush:

 

I am presuming that this is the only part of my code that I need to alter

 

$random_product = '';
$random_row = tep_rand(0, ($num_rows - 1));
tep_db_data_seek($new_products_query, $random_row);
$random_product = tep_db_fetch_array($new_products_query);
// see if found already, if not use else skip
$found = 0;
for ($ii=0; $ii < $pCount; $ii++) {
if ($found_products[$ii] == $random_product['products_id']) {
$found = 1;
break;
}
}
if ($found == 0) {
// keep track of found id's
$found_products[$pCount] += $random_product['products_id'];
$pCount ++;
// add to display array
$random_product['products_name'] = tep_get_products_name($random_product['products_id']);
$random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']);

 

because the rest of the code above deals with the amount of products to display. Am I correct in thinking that or am I way off the mark?

 

Mark


Lifes a bitch, then you marry one, then you die!

Share this post


Link to post
Share on other sites
because the rest of the code above deals with the amount of products to display. Am I correct in thinking that or am I way off the mark?

No, you're way off. What the code above does, is getting a relatively large number of recent products and then pick a number of them at random. But the first query gets all the price information (for retail) and gets you in trouble with the special prices. You have to exchange all the prices for group prices and add in special prices before you can do the random picking. This is very similar (if not identical) code that you can find in the module new_products.php (for SPPC).

Share this post


Link to post
Share on other sites
Does anyone have an updated index.php with the applied queries to fix this problem please? I have been staring at the code on Page 95 of this forum for the last two hours and i can;t find those queries in my index.php.. :rolleyes: . Using SPP 4.1 and PHP5 an no other contributions installed, and have that :

 

1054 - Unknown column 'p.products_id' in 'on clause'

 

select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials_retail_prices s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '21'

 

[TEP STOP]

 

..doh. :blush: ..maybe I am missing something obvious but need some sleep...thanks in advance

Mark

 

 

Got it fixed... :D

Share this post


Link to post
Share on other sites

Hi,

 

i installed the contribution and now i have a big problem with my advanced_search_result.php:

 

1066 - Not unique table/alias: 'pd'

 

select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id), products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c, products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '2' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%kost?me%' or p.products_model like '%kost?me%' or m.manufacturers_name like '%kost?me%') )

 

[TEP STOP]

 

Can somebody help me, please?

Share this post


Link to post
Share on other sites
i installed the contribution and now i have a big problem with my advanced_search_result.php:

Can somebody help me, please?

It looks like you should update the sql queries as mentioned in the November 12 update of OSC MS2.2 (see the front page, link at the top of the page) to be MySQL 5 compatible.

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

×