Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

[Contrib] Quick Price Updates for SPPC


84 replies to this topic

#1 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 27 November 2005, 16:38

A version of Quick Price Updates has been uploaded today that is adapted for Separate Pricing Per Customer (SPPC). If you don't have this installed, don't use it! Use this thread for questions.

This version is based on the Quick Price Updates version 2.6 of Februari 2005. The "only" additional feature is that you can choose a customer group and then the prices for that customer group will be shown and can then be changed. So you can only change prices for products for one particular customer group, not all at once (I don't think it is even possible). Maybe not ideal, but it might be helpful.

The newer versions of Quick Price Updates all seem to cater to people with particular contributions installed, so I opted to use the latest one that was still kind of generic.

The features that were already in, like selecting according to category and manufacturer (or both), sorting (sorting on price will be according to retail price) and editing of model, product status, title, tax etcetera are still in.

It appears to work OK, but since this is a new version: be careful and backup your database first before using it.

For the record: the contribution can be found here.

#2 propsydye

  • Community Member
  • 4 posts
  • Real Name:propsydye

Posted 31 January 2006, 21:52

Hi JanZ

just wondering, do you think this could be adapted to work for the pricebreaks as well?

#3 Thenes

  • Community Member
  • 32 posts
  • Real Name:Thene

Posted 27 August 2006, 16:31

Hi,

I've just installed Quick Updates for SPPC and I've encountered a strange problem. (I have a small problem with my Admin Access Level Contrib - so I'm not sure if that's affecting that...)

I got it installed with a few minor problems and then when I was using Quick Updates, everytime I selected a value in the pull down menus along the top it would take me back into the Admin Login Page.

If someone could shed some light on this it would be much appreciated.

#4 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 27 August 2006, 17:01

View PostThenes, on Aug 27 2006, 06:31 PM, said:

I've just installed Quick Updates for SPPC and I've encountered a strange problem. (I have a small problem with my Admin Access Level Contrib - so I'm not sure if that's affecting that...)

I got it installed with a few minor problems and then when I was using Quick Updates, everytime I selected a value in the pull down menus along the top it would take me back into the Admin Login Page.
There is nothing special about that. The link that is generated for the form is the regular tep_href_link function which uses: HTTP_SERVER . DIR_WS_ADMIN to which the page name is added. Look at the source code of the page to see what that is in your case. Probably something wrong with admin/included/configure.php

I use for example (local machine in a local network):
// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
  define('HTTP_SERVER', 'http://192.168.0.9'); // eg, http://localhost - should not be empty for productive servers
  define('HTTP_CATALOG_SERVER', 'http://192.168.0.9');
  define('HTTPS_CATALOG_SERVER', '');
  define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module
  define('DIR_FS_DOCUMENT_ROOT', '/Library/WebServer/Documents/catalog3/'); // where the pages are located on the server
  define('DIR_WS_ADMIN', '/catalog3/admin/'); // absolute path required
  define('DIR_FS_ADMIN', '/Library/WebServer/Documents/catalog3/admin/'); // absolute pate required
  define('DIR_WS_CATALOG', '/catalog3/'); // absolute path required
  define('DIR_FS_CATALOG', '/Library/WebServer/Documents/catalog3/'); // absolute path required
This PHP snippet:
<!-- SPPC mod: next tr changed for better HTML -->
										<tr><td colspan="5" class="smalltext"> </td></tr>
<tr align="center">
  <td class="smalltext"><?php echo tep_draw_form('row_by_page', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'manufacturer', $manufacturer); echo tep_draw_hidden_field( 'cPath', $current_category_id);
  // BOF Separate Pricing Per Customer
  echo tep_draw_hidden_field('customers_group_id', $customers_group_id);
  ?></td>
generates the following html:
<!-- SPPC mod: next tr changed for better HTML -->
										<tr><td colspan="5" class="smalltext"> </td></tr>
<tr align="center">
  <td class="smalltext"><form name="row_by_page" action="http://192.168.0.9/catalog3/admin/quick_updates.php" method="get"><input type="hidden" name="manufacturer"><input type="hidden" name="cPath" value=""><input type="hidden" name="customers_group_id"></td>


#5 Thenes

  • Community Member
  • 32 posts
  • Real Name:Thene

Posted 28 August 2006, 02:40

View PostJanZ, on Aug 28 2006, 03:01 AM, said:

There is nothing special about that. The link that is generated for the form is the regular tep_href_link function which uses: HTTP_SERVER . DIR_WS_ADMIN to which the page name is added. Look at the source code of the page to see what that is in your case. Probably something wrong with admin/included/configure.php

I use for example (local machine in a local network):
// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
  define('HTTP_SERVER', 'http://192.168.0.9'); // eg, http://localhost - should not be empty for productive servers
  define('HTTP_CATALOG_SERVER', 'http://192.168.0.9');
  define('HTTPS_CATALOG_SERVER', '');
  define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module
  define('DIR_FS_DOCUMENT_ROOT', '/Library/WebServer/Documents/catalog3/'); // where the pages are located on the server
  define('DIR_WS_ADMIN', '/catalog3/admin/'); // absolute path required
  define('DIR_FS_ADMIN', '/Library/WebServer/Documents/catalog3/admin/'); // absolute pate required
  define('DIR_WS_CATALOG', '/catalog3/'); // absolute path required
  define('DIR_FS_CATALOG', '/Library/WebServer/Documents/catalog3/'); // absolute path required
This PHP snippet:
<!-- SPPC mod: next tr changed for better HTML -->
										<tr><td colspan="5" class="smalltext"> </td></tr>
<tr align="center">
  <td class="smalltext"><?php echo tep_draw_form('row_by_page', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'manufacturer', $manufacturer); echo tep_draw_hidden_field( 'cPath', $current_category_id);
  // BOF Separate Pricing Per Customer
  echo tep_draw_hidden_field('customers_group_id', $customers_group_id);
  ?></td>
generates the following html:
<!-- SPPC mod: next tr changed for better HTML -->
										<tr><td colspan="5" class="smalltext"> </td></tr>
<tr align="center">
  <td class="smalltext"><form name="row_by_page" action="http://192.168.0.9/catalog3/admin/quick_updates.php" method="get"><input type="hidden" name="manufacturer"><input type="hidden" name="cPath" value=""><input type="hidden" name="customers_group_id"></td>

Hi, thanks for that - that actually fixed another problem I had with File Access in Admin Levels, however I'm still getting bounced out, and I have no idea what it is.

On Quick Updates, I can click the sorting or the arrow to go to the product etc, but still all the pull down menus, and the Update button - all take me to the Admin Login page.

#6 -RJM-

  • Community Member
  • 50 posts
  • Real Name:Richard Mrazek

Posted 11 March 2007, 19:00

Hi There,

I have been using SPPC 415 succesfully. I have installed the Quick Price Updates, but when I select any price group from the top right drop down box, I am always immediately returned to the Retail group. I am unable to pull up any other price group.

Any Suggestions?

Thanks in advance.

#7 -RJM-

  • Community Member
  • 50 posts
  • Real Name:Richard Mrazek

Posted 11 March 2007, 19:28

Another note from my post above. I am unable to change page numbers, as it always returns to page 1. It also does not sort by manufacturer, always returning to all.

Thanks

#8 paq1200

  • Community Member
  • 98 posts
  • Real Name:Mike
  • Gender:Male
  • Location:Texas

Posted 15 March 2007, 14:34

I love this quick update contribution. It is a real time saver. I was wanting to find out if there is a way to make the date available to be editable in this contribution.

I have a lot of products and it takes forever for the page to load going through the catalog/products.

btw, thanks janz for the help with the code to update all of the products through sql.


Mike

#9 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 15 March 2007, 21:40

View Postpaq1200, on Mar 15 2007, 03:34 PM, said:

I love this quick update contribution. It is a real time saver. I was wanting to find out if there is a way to make the date available to be editable in this contribution.

I have a lot of products and it takes forever for the page to load going through the catalog/products.
My guess is it might not be very easy to add that, especially not with the JavaScript calender for the date as in categories.php.

Perhaps it has been done already however. You could check the regular quick updates contribution if anybody has added that as a mod, or perhaps there is a thread for that contribution in which it has been mentioned.

#10 Hondo

  • Community Member
  • 14 posts
  • Real Name:Carsten Hornkamp

Posted 01 May 2007, 08:25

Hello Jan,

a member of the German Forum has changed the Quick Updates Contrib to use it with Gross Prices( tax included) today.

He made only a few changes but I am not able to transfer them to the Quick Updates with SPPC Contrib. The coder himself doesn´t use SPPC.

Could you please watch this out if you have some time??

Here is the thread from the German Forum. If you read from the bottom upwards you will find the post quickly ;)

http://forums.oscommerce.de/index.php?showtopic=52582


Thanks,
Carsten

Edited by Hondo, 01 May 2007, 08:26.


#11 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 01 May 2007, 18:38

View PostHondo, on May 1 2007, 10:25 AM, said:

a member of the German Forum has changed the Quick Updates Contrib to use it with Gross Prices( tax included) today.

He made only a few changes but I am not able to transfer them to the Quick Updates with SPPC Contrib. The coder himself doesn´t use SPPC.
I couldn't find the exact position quickly either but I took a look at his new file and it looks like the updating of gross if you make changes in net and vice versa isn't working. Did I miss something? Wouldn't that be the whole point of adding that extra input field (making the use of a wide screen almost mandatory to be able to update prices :) )?

#12 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 01 May 2007, 21:20

View PostJanZ, on May 1 2007, 08:38 PM, said:

I took a look at his new file and it looks like the updating of gross if you make changes in net and vice versa isn't working. Did I miss something?
Apparently that only works when both DISPLAY_TAX and MODIFY_TAX are set to true in the settings for Quick Updates. Otherwise JavaScript will error with elements["product_new_tax[" + product_id + "]"] having no property :(

#13 Hondo

  • Community Member
  • 14 posts
  • Real Name:Carsten Hornkamp

Posted 02 May 2007, 04:52

View PostJanZ, on May 1 2007, 11:20 PM, said:

Apparently that only works when both DISPLAY_TAX and MODIFY_TAX are set to true in the settings for Quick Updates. Otherwise JavaScript will error with elements["product_new_tax[" + product_id + "]"] having no property :(

Hi Jan!

Thank you for your efforts!

There is a note of the coder in the german forums regarding this. I will post it like it is in German to avoid of translation missunderstandings. I think you understand German as you mentioned last time. Here it is:

Dann noch die letzte Änderung:
if(DISPLAY_TAX == 'true'){if(MODIFY_TAX == 'true')echo "<td class=\"smallText\" align=\"left\">".tep_draw_pull_down_menu("product_new_tax[".$products['products_id']."]", $tax_class_array, $products['products_tax_class_id'])."</td>\n";else echo "<td class=\"smallText\" align=\"left\">" . $tax_rate['tax_class_title'] . "</td>";}else{ echo "<td class=\"smallText\" align=\"center\"></td>";}


Hier sollte allerdings noch beim Ändern der Tax zuerst die updateNet und dann die updateGross aufgerufen werden. Weiss aber auf die Schnelle nicht wie und hab jetzt die Schnauze voll... Irgendwie mit onchange. wink.gif


#14 Hondo

  • Community Member
  • 14 posts
  • Real Name:Carsten Hornkamp

Posted 02 May 2007, 05:04

View PostHondo, on May 2 2007, 06:52 AM, said:

Hi Jan!

Thank you for your efforts!

There is a note of the coder in the german forums regarding this. I will post it like it is in German to avoid of translation missunderstandings. I think you understand German as you mentioned last time. Here it is:

Dann noch die letzte Änderung:
if(DISPLAY_TAX == 'true'){if(MODIFY_TAX == 'true')echo "<td class=\"smallText\" align=\"left\">".tep_draw_pull_down_menu("product_new_tax[".$products['products_id']."]", $tax_class_array, $products['products_tax_class_id'])."</td>\n";else echo "<td class=\"smallText\" align=\"left\">" . $tax_rate['tax_class_title'] . "</td>";}else{ echo "<td class=\"smallText\" align=\"center\"></td>";}


Hier sollte allerdings noch beim Ändern der Tax zuerst die updateNet und dann die updateGross aufgerufen werden. Weiss aber auf die Schnelle nicht wie und hab jetzt die Schnauze voll... Irgendwie mit onchange. wink.gif

Not able to edit my last post :angry:

Translation of the last bold sentence should be like this:

When changing the tax at this position updateNet and updateGross should be accessed first of all. But I´m not sure how to do this for the moment. Perhaps in some way with onchange.

#15 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 02 May 2007, 22:28

View PostHondo, on May 2 2007, 07:04 AM, said:

When changing the tax at this position updateNet and updateGross should be accessed first of all. But I´m not sure how to do this for the moment. Perhaps in some way with onchange.
Why updating the net price? That is price without tax IMHO.
Anyway, these are the total changes (apart from adding the JavaScript code, that part is the same). This starts around line 584 in the original file quick_updates.php (the SPPC version of course):
//// get the specials products list
/*   deleted code */
//// check specials
//  original: if ( in_array($products[$x]['products_id'],$specials_array)) {
		if (tep_not_null($products[$x]['specials_id'])) {		
 /* deleted code */
			echo "<td class=\"smallText\" align=\"left\">    <input type=\"text\" size=\"8\" name=\"product_new_price[".$products[$x]['products_id']."]\" value=\"".$products[$x]['products_price']."\" disabled > <a target=blank href=\"".tep_href_link (FILENAME_SPECIALS, 'sID='.$products[$x]['specials_id']).'&action=edit'."\">". tep_image(DIR_WS_IMAGES . 'icon_info.gif', TEXT_SPECIALS_PRODUCTS) ."</a></td>\n";
		} else {
			if ($flag_spec == 'true') {
				   echo "<td class=\"smallText\" align=\"left\">    <input type=\"text\" size=\"8\" name=\"product_new_price[".$products[$x]['products_id']."]\" "; if(DISPLAY_TVA_UP == 'true'){ echo "onKeyUp=\"display_ttc('keyup', this.value" . ", " . $tax_rate['tax_rate'] . ", 1);\"";} echo " value=\"".$price ."\">". tep_draw_checkbox_field('update_price['. $products[$x]['products_id'] .']','yes','checked','no')."</td>\n";
			} else { 
		echo "<td class=\"smallText\" align=\"left\">    <input type=\"text\" size=\"6\" name=\"product_new_price_gross[".$products[$x]['products_id']."]\" ";
	  echo "onkeyup=\"updateNet(".$products[$x]['products_id'].");\"";
	  echo " value=\"".($price*(1+$tax_rate['tax_rate']/100)) ."\">  <input type=\"text\" size=\"6\" name=\"product_new_price[".$products[$x]['products_id']."]\" "; 
		echo "onkeyup=\"updateGross(".$products[$x]['products_id'].");\""; 
		echo " value=\"".$price ."\" style=\"background-color: lightyellow;\">".tep_draw_hidden_field('update_price['.$products[$x]['products_id'].']','yes'). "</td>\n";}
		} // end if-else (tep_not_null($products[$x]['specials_id']))
   if (DISPLAY_TAX == 'true') { 
	   if (MODIFY_TAX == 'true') { 
		  echo "<td class=\"smallText\" align=\"left\">". tep_draw_pull_down_menu("product_new_tax[". $products[$x]['products_id'] ."]", $tax_class_array, $products[$x]['products_tax_class_id'], 'onchange="updateGross('.$products[$x]['products_id'].')"')."</td>\n";
		   } else {
			  echo "<td class=\"smallText\" align=\"left\">" . $tax_rate['tax_class_title'] . "<input type=\"hidden\" name=\"product_new_tax[". $products[$x]['products_id'] ."]\" value=\"" . $products[$x]['products_tax_class_id'] . "\"></td>";
	   } // end if-else (MODIFY_TAX == 'true')
   }  else { 
		echo "<td class=\"smallText\" align=\"center\"><input type=\"hidden\" name=\"product_new_tax[". $products[$x]['products_id'] ."]\" value=\"" . $products[$x]['products_tax_class_id'] . "\"></td>";
		   }
//// links to preview or full edit
Added a light yellow background to the net price column. Found it a bit confusing without. It changes the gross price when you change the tax in the drop-down menu. The JavaScript updating works also when DISPLAY_TAX or MODIFY_TAX are false.

#16 Hondo

  • Community Member
  • 14 posts
  • Real Name:Carsten Hornkamp

Posted 07 May 2007, 19:17

View PostJanZ, on May 3 2007, 12:28 AM, said:

Anyway, these are the total changes...

Thank you very much, Jan! The code works perfect and changing prices will be much easier for me in the future.

I don´t want to be brazen but will ask for it nevertheless:

The ultimate thing would be to change also the special prices with gross and net using Quick Updates. Beeing back to the use of a wide screen... ;)

Perhaps you´ll find a minute for that :rolleyes:

Cheers, Hondo

#17 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 07 May 2007, 21:08

View PostHondo, on May 7 2007, 09:17 PM, said:

The ultimate thing would be to change also the special prices with gross and net using Quick Updates. Beeing back to the use of a wide screen...
Actually, I once adapted a contribution of Carine Bruyndoncx that kind of has that: Admin Specials by Categories for SPPC ;)

#18 Hondo

  • Community Member
  • 14 posts
  • Real Name:Carsten Hornkamp

Posted 09 May 2007, 17:34

View PostJanZ, on May 7 2007, 11:08 PM, said:

Actually, I once adapted a contribution of Carine Bruyndoncx that kind of has that: Admin Specials by Categories for SPPC ;)


Hi Jan,

the contribution is generally great to update specials. Thank you very much!

But for my retail store it would be very helpful to type in the gross price directly in the same way you did it for Quick Updates.

Could you please include this when you find some time??

Thanks,
Carsten

#19 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 09 May 2007, 21:23

View PostHondo, on May 9 2007, 07:34 PM, said:

Could you please include this when you find some time??
It already is (instructions on the page itself: add an "i" after the price).

#20 Hondo

  • Community Member
  • 14 posts
  • Real Name:Carsten Hornkamp

Posted 09 May 2007, 21:50

View PostJanZ, on May 9 2007, 11:23 PM, said:

It already is (instructions on the page itself: add an "i" after the price).

Wonderful!

Thanks a lot! :thumbsup: