Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

Can anyone recommend a simple payment module for free downloads that works w/ SPPC, allows checkout, and sets an order status that is not the (default) in localization?

 

I'm trying Linda McGrath's freecharger, but it ignores the customer group setting, and replaces all other available payment options. Looking at the moneyorder, rfp, cod mods ...

 

What will cause payment modules to leap across (ignore) customer group settings?

 

Thanks,

EricK

Link to comment
Share on other sites

I need some expert help to manually edit the includes/classes/shopping_cart.php and catalog/product_info.php files - they are the only files I cannot edit, and I believe its to do with a contribution already installed (again at a guess the Price Breaks contrib).
There is a version of Quantity Price Breaks for SPPC.
Link to comment
Share on other sites

This is probably the last thing anyone would like to show their retail customers but I guess you have your reasons.

 

Hmmm i've not think about it, just wanted to facilitate the customer..coz perhaps some wnt make the effort to login etc. But its better not to show both the prices anyway :blush: . What other contribs do u advice me to install to improve the b2b aspects. I'll try Quantity Price Breaks for SPPC. what are the other contribs for sppc ?

 

Another point. How should paiment be dealt with wholesalers. Can large sum of money be paid via credit cards ? sorry for these questions..i'm just a confused student.. ;)

Link to comment
Share on other sites

What other contribs do u advice me to install to improve the b2b aspects. I'll try Quantity Price Breaks for SPPC. what are the other contribs for sppc ?

 

There are a number of contributions which were made for/ adjusted for SPPC -- http://www.oscommerce.com/community?contri...ns=&search=SPPC

://http://www.oscommerce.com/community...arch=SPPC

There is also a forked version of osC which is made for b2b users - http://www.oscommerce.com/community/contributions,2862 . Infact, they have (or had) a whole site for this project, you can find the link in the read me of that contribution.

 

Another point. How should paiment be dealt with wholesalers. Can large sum of money be paid via credit cards ? sorry for these questions..i'm just a confused student.. ;)

 

Nearly any of the payment modules will work, no matter how much money your site brings in and no matter what the average value of sale is. Your best bet would to be to use somthing (such as a CC processor, unless you have the ability to run your own cards) that charges a low % if you infact do have high sales volume. The other choice you could off is to take wire transfers/checks/money orders (a bit more risky and hard to do also as a new company). What you need to do is research both on the osC board and on google.com the number of different ways to operate an ecommerce store and how to take payments and apply the one that best fits your business model.

 

Good Luck,

 

Nate

Link to comment
Share on other sites

There are a number of contributions which were made for/ adjusted for SPPC -- <a href="http://www.oscommerce.com/community?contributions=&search=SPPC"'>http://www.oscommerce.com/community?contributions=&search=SPPC" target="_blank">http://www.oscommerce.com/community?contributions=&search=SPPC

://http://www.oscommerce.com/community...arch=SPPC

</a> There is also a forked version of osC which is made for b2b users - http://www.oscommerce.com/community/contributions,2862 . Infact, they have (or had) a whole site for this project, you can find the link in the read me of that contribution.

Nearly any of the payment modules will work, no matter how much money your site brings in and no matter what the average value of sale is. Your best bet would to be to use somthing (such as a CC processor, unless you have the ability to run your own cards) that charges a low % if you infact do have high sales volume. The other choice you could off is to take wire transfers/checks/money orders (a bit more risky and hard to do also as a new company). What you need to do is research both on the osC board and on google.com the number of different ways to operate an ecommerce store and how to take payments and apply the one that best fits your business model.

 

Good Luck,

 

Nate

 

 

Thanks for these advice, I badly need them. :thumbsup: I have only 1 month left to submit my project! I haven't so far seen the payment, shipping and security modules of osc. Perhaps I should stop adding contrib and move to these stuff...Hope that one month will be enough to cover these aspect :huh:

 

Regards

MzM

Edited by MzM
Link to comment
Share on other sites

ahaa, I think I've found the problem (thanks Maggi) 5 posts up...

 

in classes/payment.php I need only Customer Group = 2 to have freecharger enabled for downloads, as it's written below all Customer Groups see only freecharger for downloads.

 

What is the best if/else statement to enable only Customer Group = 2 to use freecharger?

 

 

// BOF: MOD - Downloads Controller - Free Shipping and Payments
// Show either normal payment modules or free payment module when Free Shipping Module is On
	  // Free Payment Only

	  if (tep_get_configuration_key_value('MODULE_PAYMENT_FREECHARGER_STATUS') and ($cart->show_total()==0 and $cart->show_weight==0)) {
		$this->selected_module = $module;
		$include_modules[] = array('class'=> 'freecharger', 'file' => 'freecharger.php');
	  } else {
		// All Other Payment Modules
		while (list(, $value) = each($this->modules)) {
		  $class = substr($value, 0, strrpos($value, '.'));
		  // Don't show Free Payment Module
		  if ($class !='freecharger') {
			$include_modules[] = array('class' => $class, 'file' => $value);
		  }
		}
// EOF: MOD - Downloads Controller

 

Thank you,

EricK

Link to comment
Share on other sites

How do I remove a customer group? I tried to delete one from the database then got the following on the customer group page in admin.

 

Warning: reset(): Passed variable is not an array or object in /home/leakp/public_html/catalog/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home/leakp/public_html/catalog/admin/includes/classes/object_info.php on line 18

 

I'm trying to find the source of a problem in my per item shipping module that carries forward 2 ghost items, adding the value of 2 extra items to the shipping charge. I thought that maybe this mod or something in the database might do that, so if I try to remove one, I can see if the amount carried over is changed. But then I got those warnings.

 

I will restore the database and try adding another customer group to see if that adds another per item rate in the shipping charges.

................Time delay of 5 minutes.............

OK, I did that and no change. Any thoughts?

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

I'm having another problem.

 

I can't copy a product when working in admin to make my product entries. I get this error, which I believe is related to the database and SPPC. I'm sure the fix is easy, but I'm stuck.

 

This is the error after I select "Duplicate Product" and hit the Copy button.

 

1062 - Duplicate entry '0-24' for key 1

 

insert into products_to_categories (products_id, categories_id) values ('0', '24')

 

[TEP STOP]

 

Any ideas?

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

I'm having another problem.

 

I can't copy a product when working in admin to make my product entries. I get this error, which I believe is related to the database and SPPC. I'm sure the fix is easy, but I'm stuck.

 

This is the error after I select "Duplicate Product" and hit the Copy button.

Any ideas?

 

And, when I go to make a new product, there are two fields already filled for SPPC section for prices I previously put in for the first product I inputed these peices for. The prices are bing carried into the new product window. I believe they should be blank.

 

What part of the code could do these things?

 

Thanks for listening. :'(

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

I can't copy a product when working in admin to make my product entries. I get this error, which I believe is related to the database and SPPC. I'm sure the fix is easy, but I'm stuck.

 

This is the error after I select "Duplicate Product" and hit the Copy button.

Any ideas?

I wish I had. I tried to replicate the error, but nothing wrong happened. By the way, I think quila reported a similar problem. Actually, that part of the code hasn't been changed by SPPC (until 4.13, about that later) at all. The part that deals with that (on admin/categories.php) starts around line 304 with case 'copy_to_confirm':. The error seems to be the fact that $dup_products_id = tep_db_insert_id(); apparently is zero or empty or something, because a few lines further you hit: tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')"); with the products_id being 0, which it shouldn't be at all.

 

The only thing I can think of now is that perhaps something is wrong with the function tep_db_insert_id (admin/includes/functions/database.php) for your MySQL version:

  function tep_db_insert_id() {
return mysql_insert_id();
 }

If the previous query already ran, that might explain the customer group prices already added, but I'm not convinced, since that happens with the "bugfix" of infobroker in version 4.13 which comes after the insert query that goes wrong.

 

Now the bugfix (I would prefer to call it the addition of a feature) is not flawless. If there haven't been added customer group prices for a product for example (only retail price has been entered) then this code will still enter a row into the table products_group with customers_group_id 0 (doesn't belong there) and customers_group_price 0.0000. That is not correct.

 

I suggest to change the 4th line in the file to adapted for Separate Pricing Per Customer v4.1.3 2006/05/19. Then you at least know it is another file than in the previous versions and then the code infobroker added (starts around line 333) to:

  // BOF Separate Pricing Per Customer originally 2006-04-26 by Infobroker

$cg_price_query = tep_db_query("select customers_group_id, customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $products_id . "' order by customers_group_id");

// insert customer group prices in table products_groups when there are any for the copied product
if (tep_db_num_rows($cg_price_query) > 0) {
  while ( $cg_prices = tep_db_fetch_array($cg_price_query)) {
	tep_db_query("insert into " . TABLE_PRODUCTS_GROUPS . " (customers_group_id, customers_group_price, products_id) values ('" . (int)$cg_prices['customers_group_id'] . "', '" . tep_db_input($cg_prices['customers_group_price']) . "', '" . (int)$dup_products_id . "')");
  } // end while ( $cg_prices = tep_db_fetch_array($cg_price_query))
} // end if (tep_db_num_rows($cg_price_query) > 0)

 // EOF Separate Pricing Per Customer originally 2006-04-26 by Infobroker

Link to comment
Share on other sites

in classes/payment.php I need only Customer Group = 2 to have freecharger enabled for downloads, as it's written below all Customer Groups see only freecharger for downloads.
Looking at your code it looks as if this would come after SPPC has determined what the modules that have to be loaded for this customer/customer group are. This downloads controller mod ignores that. If you only need to to use this code for customer_group_id 2 then simply add it to the conditions that need to be met for it to be the only module loaded:

// BOF: MOD - Downloads Controller - Free Shipping and Payments
// Show either normal payment modules or free payment module when Free Shipping Module is On
	  // Free Payment Only

	  if (tep_get_configuration_key_value('MODULE_PAYMENT_FREECHARGER_STATUS') && ($cart->show_total()==0 && $cart->show_weight==0) && $customer_group_id == '2' ) {
		$this->selected_module = $module;
		$include_modules[] = array('class'=> 'freecharger', 'file' => 'freecharger.php');
	  } else {
// etcetera, etcetera

Link to comment
Share on other sites

How do I remove a customer group? I tried to delete one from the database then got the following on the customer group page in admin.
That is exactly the page where you can delete/add/edit a customer group.
I'm trying to find the source of a problem in my per item shipping module that carries forward 2 ghost items, adding the value of 2 extra items to the shipping charge. I thought that maybe this mod or something in the database might do that, so if I try to remove one, I can see if the amount carried over is changed. But then I got those warnings.
I don't see how SPPC can do that, but perhaps the copying of products that goes wrong when partly done has something to do with it?
Link to comment
Share on other sites

I installed the new Infobroker code, but the problem is still there.

 

1062 - Duplicate entry '0-24' for key 1

 

insert into products_to_categories (products_id, categories_id) values ('0', '24')

 

[TEP STOP]

 

 

Can't copy a product; and new products already have per installed prices for the customer groups that are from the very first product I put prices on for customers groups. They are the same each time I go to make a new product.

 

bug1.jpg

 

bug2.jpg

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

I successfully have installed SPPC and my client loves it!

This install was merged successfully with Wolfen Featured Sets - without any aparent problems.

 

Now I am trying to install the "Hide Products for CG_SPPC" and getting an unexpected T_ELSEIF parse error. (it points to a line around 840 each try)

 

I am fairly certain I see WHERE the source of the problem is... but have no idea how to merge these two contributions to work correctly together.

 

I am pasting ONLY the merges in question... someone please tell me what I have done wrong, or how I can work around this. Notice the fact that wolfen crosses right over the "hide from groups mod"

 

The error is coming from the admin/categories.php page.

 

CODE// BOF Wolfen featured sets

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

?>

<!-- BOF SPPC hide from groups mod -->

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td colspan="2" class="main" ><?php echo TEXT_HIDE_PRODUCTS_FROM_GROUP; ?></td>

<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_SHORT; ?></td>

<td><table border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

<td class="main"><?php echo tep_draw_textarea_field('products_short[' . $languages[$i]['id'] . ']', 'soft', '70', '4', (isset($products_short[$languages[$i]['id']]) ? $products_short[$languages[$i]['id']] : tep_get_products_short($pInfo->products_id, $languages[$i]['id']))); ?></td>

</tr>

</table></td>

</tr>

<?php

$hide_customers_group_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id");

$hide_from_groups_array = explode(',',$pInfo->products_hide_from_groups);

$hide_from_groups_array = array_slice($hide_from_groups_array, 1); // remove "@" from the array

while ($hide_customers_group = tep_db_fetch_array($hide_customers_group_query)) {

?>

<tr bgcolor="#ebebff">

<td class="main" colspan="2"><?php

if (isset($pInfo->hide)) {

echo tep_draw_checkbox_field('hide[' . $hide_customers_group['customers_group_id'] . ']', $hide_customers_group['customers_group_id'] , (isset($pInfo->hide[ $hide_customers_group['customers_group_id']])) ? 1: 0);

} else {

echo tep_draw_checkbox_field('hide[' . $hide_customers_group['customers_group_id'] . ']', $hide_customers_group['customers_group_id'] , (in_array($hide_customers_group['customers_group_id'], $hide_from_groups_array)) ? 1: 0);

} ?> <?php echo $hide_customers_group['customers_group_name']; ?></td>

</tr>

<?php

} // end while ($hide_customers_group = tep_db_fetch_array($hide_customers_group_query))

// EOF Wolfen featured sets

?>

 

I would greatly appreciate any insight on this delima, I really hope someone can show me the light.

Has anyone else ran into this? or combined these successfully?

 

Thanks,

Landon

Link to comment
Share on other sites

Can't copy a product
Obviously a products_id cannot be zero.

You will need to debug that code by echo'ing some variables used. For example changing this part of the "copy code" (starts around line 319) to:

		  } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {
		$product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
		$product = tep_db_fetch_array($product_query);
// begin debug
	echo '<p>Insert query: <br>';
	print("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "',  now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
	echo '<br>Id of product to be copied is: ';
	echo $products_id;
	echo '<br>';

		tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "',  now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
		$dup_products_id = tep_db_insert_id();
	echo 'Product id of duplicated product: ';
	echo $dup_products_id;
	echo '</p>';
// end debug
		$description_query = tep_db_query("select language_id, products_name, products_description, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");

would if everything goes right produce something like:

Insert query: 
insert into products (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('16', 'DVD-BLDRNDC', 'dvd/blade_runner.gif', '35.9900', now(), '', '7.00', '0', '1', '3')
Id of product to be copied is: 5
Product id of duplicated product: 45


Warning: Cannot modify header information - headers already sent by (output started at /Library/WebServer/Documents/catalog/admin/categories.php:323) in /Library/WebServer/Documents/catalog/admin/includes/functions/general.php on line 18

Link to comment
Share on other sites

I am pasting ONLY the merges in question... someone please tell me what I have done wrong, or how I can work around this. Notice the fact that wolfen crosses right over the "hide from groups mod"
No, it doesn't cross over at all. You are mixing two code changes for no reason at all. Actually, it goes very very wrong because code that has to be executed once is repeated for the number of languages you are using: for ($i=0, $n=sizeof($languages); $i<$n; $i++) (looks like the end } is missing and that is giving the error).

 

You need to keep out the code Wolfen featured sets adds from the code that starts with (around line 626 in the original SPPC hide file):

<!-- BOF SPPC hide from groups mod -->

and ends on line 653 (in the original file) with:

<?php
	} // end while ($hide_customers_group = tep_db_fetch_array($hide_customers_group_query))
?>
	  <tr>
		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>
<!-- EOF Separate Pricing Per Customer -->

Link to comment
Share on other sites

Obviously a products_id cannot be zero.

You will need to debug that code by echo'ing some variables used. For example changing this part of the "copy code" (starts around line 319) to:

		  } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {
		$product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
		$product = tep_db_fetch_array($product_query);
// begin debug
	echo '<p>Insert query: <br>';
	print("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "',  now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
	echo '<br>Id of product to be copied is: ';
	echo $products_id;
	echo '<br>';

		tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "',  now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
		$dup_products_id = tep_db_insert_id();
	echo 'Product id of duplicated product: ';
	echo $dup_products_id;
	echo '</p>';
// end debug
		$description_query = tep_db_query("select language_id, products_name, products_description, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");

would if everything goes right produce something like:

Insert query: 
insert into products (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('16', 'DVD-BLDRNDC', 'dvd/blade_runner.gif', '35.9900', now(), '', '7.00', '0', '1', '3')
Id of product to be copied is: 5
Product id of duplicated product: 45
Warning: Cannot modify header information - headers already sent by (output started at /Library/WebServer/Documents/catalog/admin/categories.php:323) in /Library/WebServer/Documents/catalog/admin/includes/functions/general.php on line 18

 

Before I do that...

..............I think my code needs some rewriting to include some items in the value part.

Please tell me if I'm right.

 

In my code, this starts on line 483 of Admin/catagories.

 

$messageStack->add_session(ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error');

}

} elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {

// BOF MaxiDVD: Modified For Ultimate Images Pack!

$product_query = tep_db_query("select products_quantity, products_model, products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_price, products_date_available, products_weight, products_dim_type, products_weight_type, products_length, products_width, products_height, products_ready_to_ship, products_tax_class_id, manufacturers_id, products_sort_order from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

$product = tep_db_fetch_array($product_query);

 

tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6,products_price, products_date_added, products_date_available, products_weight, products_dim_type, products_weight_type, products_length, products_width, products_height, products_ready_to_ship, products_status, products_tax_class_id, manufacturers_id, products_sort_order) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_image_med']) . "', '" . tep_db_input($product['products_image_lrg']) . "', '" . tep_db_input($product['products_image_sm_1']) . "', '" . tep_db_input($product['products_image_xl_1']) . "', '" . tep_db_input($product['products_image_sm_2']) . "', '" . tep_db_input($product['products_image_xl_2']) . "', '" . tep_db_input($product['products_image_sm_3']) . "', '" . tep_db_input($product['products_image_xl_3']) . "', '" . tep_db_input($product['products_image_sm_4']) . "', '" . tep_db_input($product['products_image_xl_4']) . "', '" . tep_db_input($product['products_image_sm_5']) . "', '" . tep_db_input($product['products_image_xl_5']) . "', '" . tep_db_input($product['products_image_sm_6']) . "', '" . tep_db_input($product['products_image_xl_6']) . "', '" . tep_db_input($product['products_price']) . "', now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '" . tep_db_input($product['products_dim_type']) . "', '" . tep_db_input($product['products_weight_type']) . "', '" . tep_db_input($product['products_length']) . "', '" . tep_db_input($product['products_width']) . "', '" . tep_db_input($product['products_height']) . "', '" . tep_db_input($product['products_ready_to_ship']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "', '" . (int)$product['products_sort_order'] . "')");

// BOF MaxiDVD: Modified For Ultimate Images Pack!

$dup_products_id = tep_db_insert_id();

 

$description_query = tep_db_query("select language_id, products_name, products_description, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");

while ($description = tep_db_fetch_array($description_query)) {

tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_url']) . "', '0')");

}

 

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");

$products_id = $dup_products_id;

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

}

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

..............I think my code needs some rewriting to include some items in the value part.

Please tell me if I'm right.

Yes, the queries are a bit different, but basically the same. Where I tell you to print("insert into.... etcetera the only thing that you need to do is copy the tep_db_query("insert into... till the end of the query and paste it above it. Then change the tep_db_query to print and you should be in business. Plus add the other little echo's.
Link to comment
Share on other sites

Yes, the queries are a bit different, but basically the same. Where I tell you to print("insert into.... etcetera the only thing that you need to do is copy the tep_db_query("insert into... till the end of the query and paste it above it. Then change the tep_db_query to print and you should be in business. Plus add the other little echo's.

 

Sorry JanZ, I was refering to the (what seems to be) non-matching strings of code. They don't match up. I think they need to match up.

 

This line:

 

$product_query = tep_db_query("select products_quantity, products_model, products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_price, products_date_available, products_weight, products_dim_type, products_weight_type, products_length, products_width, products_height, products_ready_to_ship, products_tax_class_id, manufacturers_id, products_sort_order from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

 

 

And this line:

 

tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6,products_price, products_date_added, products_date_available, products_weight, products_dim_type, products_weight_type, products_length, products_width, products_height, products_ready_to_ship, products_status, products_tax_class_id, manufacturers_id, products_sort_order) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_image_med']) . "', '" . tep_db_input($product['products_image_lrg']) . "', '" . tep_db_input($product['products_image_sm_1']) . "', '" . tep_db_input($product['products_image_xl_1']) . "', '" . tep_db_input($product['products_image_sm_2']) . "', '" . tep_db_input($product['products_image_xl_2']) . "', '" . tep_db_input($product['products_image_sm_3']) . "', '" . tep_db_input($product['products_image_xl_3']) . "', '" . tep_db_input($product['products_image_sm_4']) . "', '" . tep_db_input($product['products_image_xl_4']) . "', '" . tep_db_input($product['products_image_sm_5']) . "', '" . tep_db_input($product['products_image_xl_5']) . "', '" . tep_db_input($product['products_image_sm_6']) . "', '" . tep_db_input($product['products_image_xl_6']) . "', '" . tep_db_input($product['products_price']) . "', now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '" . tep_db_input($product['products_dim_type']) . "', '" . tep_db_input($product['products_weight_type']) . "', '" . tep_db_input($product['products_length']) . "', '" . tep_db_input($product['products_width']) . "', '" . tep_db_input($product['products_height']) . "', '" . tep_db_input($product['products_ready_to_ship']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "', '" . (int)$product['products_sort_order'] . "')");

 

This is taken from the prior postings code in admin/catagories.php.

 

You opinion please. I can't tell what is right or not.

Thanks.

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

Hi

 

This is an amazing contribution. Thank you for all the effort and astounding ongoing support I have seen here. I have a problem that I hope is a simple issue for someone who actually knows what they're doing.

 

I installed sppc on my heavily modded store and all went well, then added, hide products and show price list.

 

My problem is that the store is absolutely only for wholesale use and needs to funciton as a pure catalogue (with a list of stockists) for visitors. However, my retail customers want to see the list prices as well, so I cannot use a contribution like "hide prices for 0".

 

I managed to hide prices with a minor tweak at the bottom of currencies.php, but I cannot for the life of me work out how to hide the add to cart button (product_info.php) and buy now button (product_listing.php)

 

I tried this in product_info.php:

<td class="main" align="right"><?php if (tep_session_is_registered('customer_id')){
			  echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART);
			  }else{
			  RETURN'Login for price';
			  }?></td>

 

I found it in a forum for hiding prices unless logged in, but my entire right column disappears from my product pages when I add it.

 

I am sure the solution is a relatively small piece of coding but after a week of battling with it, I just cannot get it figured out.

 

If anyone can help me with this, it would be much appreciated.

Link to comment
Share on other sites

Hi. First off I have to say I am real happy with the SPPC and the QPB module for it .. And thanks guys you have done a great job.

 

I have noticed a few things and am not to sure if it is my fault or it is not part of the mods. But when I set up a different price it doesnt show when I click on more info on the item .. eg .. a headset .. $69.00 and set for wholesale at $55.00 .. In the headset catagory it shows the $55 price but when I click on it to get the item veiw it goes back to $69.

 

Also once I setup QPB .. I set up a price break at 5 and 10 buy so it shows that once again on the list but says nothing in item veiw to let the customer know if he buys more he will get a better price.

 

Any help on this would be great thankyou.

Link to comment
Share on other sites

Vivienne,

My problem is that the store is absolutely only for wholesale use and needs to funciton as a pure catalogue (with a list of stockists) for visitors. However, my retail customers want to see the list prices as well, so I cannot use a contribution like "hide prices for 0".

 

I managed to hide prices with a minor tweak at the bottom of currencies.php, but I cannot for the life of me work out how to hide the add to cart button (product_info.php) and buy now button (product_listing.php)

 

I tried this in product_info.php:

What about:

<td class="main" align="right"><?php if (tep_session_is_registered('customer_id') && $customer_group_id > 0 ){
// only show 'add to card' button to wholesale customers (customer group id higher than 0)
			  echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART);
 } elseif (tep_session_is_registered('customer_id') && $customer_group_id == '0' ) {
// hide 'add to card' button for retail customers but fill up the space of the button with a 1px gif
// adjust size to what you need or use no-break spaces
 echo tep_draw_separator('pixel_trans.gif', '24', '15');
			  }else{
			  RETURN'Login for price';
			  }?></td>

Be aware that although you hide the buttons you can often (depends a bit on the contributions you have added) still add products to the shopping basket by typing in a url manually. For example http:// theshop.com/index.php?products_id=##&action=buy_now

 

To avoid that (in your case) you could make the shopping cart actions depend on the customer group id.

 

For example wrap them in an if condition:

  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) {
// starts around line 318 in includes/application_top.php
// Shopping cart actions
 if (isset($HTTP_GET_VARS['action'])) {
// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled
.
.
.

}
 }
} // end if ($customer_group_id > 0)

// include the who's online functions

Link to comment
Share on other sites

Rod,

I was refering to the (what seems to be) non-matching strings of code. They don't match up. I think they need to match up.
I can't see any fault in it. Looks fine to me.

 

Of course once you have echo'ed them you can copy and paste them into phpMyAdmin and see if that returns an error.

Link to comment
Share on other sites

Also once I setup QPB .. I set up a price break at 5 and 10 buy so it shows that once again on the list but says nothing in item veiw to let the customer know if he buys more he will get a better price.
It sounds like you missed adding the code for QPB to product_info.php (around line 78):

	$pf->loadProduct((int)$HTTP_GET_VARS['products_id'], (int)$languages_id);
$products_price=$pf->getPriceString();

This picks up the quantity price for the customer group and the function getPriceString will show the price break table (a pretty ugly one if you ask me ;) ).

Link to comment
Share on other sites

Vivienne,

 

What about:

<td class="main" align="right"><?php if (tep_session_is_registered('customer_id') && $customer_group_id > 0 ){
// only show 'add to card' button to wholesale customers (customer group id higher than 0)
			  echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART);
 } elseif (tep_session_is_registered('customer_id') && $customer_group_id == '0' ) {
// hide 'add to card' button for retail customers but fill up the space of the button with a 1px gif
// adjust size to what you need or use no-break spaces
 echo tep_draw_separator('pixel_trans.gif', '24', '15');
			  }else{
			  RETURN'Login for price';
			  }?></td>

 

 

Janz

Thank you very much for coming back to me on this. I'm not even looking at the shopping cart fix you gave me until I get the hiding buttons sorted. I tried your code and it's doing the same thing - it hides the button but it also makes my entire right hand column totally disappear from the page - the middle content stretches across as if there never was a column on the right. Logically it makes no sense that this snippet of code is changing my entire page layout though. If you have any other ideas I would be really thankful. This is driving me batty.

 

Thanks again.

Vivienne

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