Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Easypopulate and price-per-customer?


osDJ

Recommended Posts

I have a problem with price per customer working with easypopulate. I found others instances where somebody had the same problem but could not get it resolved.

 

I uncommented the appropriate lines as indicated in the easypopuate install but nothing changed. I noticed something strange in the older version of easypopulate compared to the latest version. The latest version has this:

"

// uncomment the customer_price and customer_group to support multi-price per product contrib

 

// VJ product attribs begin

$header_array = array(

'v_products_price' => $iii++,

'v_products_weight' => $iii++,

'v_date_avail' => $iii++,

'v_date_added' => $iii++,

'v_products_quantity' => $iii++,

 

 

);

"

 

But the older version included these lines:

 

"

#'v_customer_price_1' => $iii++,

#'v_customer_group_id_1' => $iii++,

 

"

 

The new version mentions commenting out lines here but there are no lines in this section to comment out. Does this make sense to anybody?

 

As an experiment, I added those two lines to that section and the downloaded .txt file looked good, including the extra category with the extra price.

 

However, when I immediately uploaded this file, without even making any modifications, it comes up with the following error:

 

"

| 638 | set1006.jp | Iron Cross | This piece | | 9.82 | | | | 8 | 3.99 | 1 | Dan's J | Gothic and | Bracelets | | | Active Updated

1136 - Column count doesn't match value count at row 1

 

INSERT INTO products_groups VALUES ( 1, 3.99, 1930, 9.82 )

 

[TEP STOP]

"

 

Please help me get this sorted out. Another post where someone had a similar problem (and did not get it resolved) can be found here:

http://www.oscommerce.com/forums/index.php?sho...08entry472408

 

Thanks,

Daniel

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Has anyone got anywhere with this? I'm having the same problem :huh:

 

I successfully added the SPPC contribution (after making a silly error which was sorted out in another thread, thanks :thumbsup: ) but now I can't update the stock with separate pricing (it works individually but there are over 2000 items so I really need Easypopulate :o )

 

dcmo :blush:

Link to comment
Share on other sites

Thanks for that link - the first bit I've already done ok but the second bit looks like it may be part of the answer - can't look at my shop code til this evening though. I'll report back if I get it to work :'(

Link to comment
Share on other sites

Hi everyone,

 

Just had a go with the solution suggested above.... IT WORKED! :thumbsup:

 

So, to summarise ... :huh: (sorry this gets a bit long but I hope it helps someone.

 

I had Easypopulate working fine. Then I installed the SPPC contribution and added just one extra group so I had two groups of customers, Retail and Trade. This was working fine with a few test products I updated with the 2 prices per product using the usual admin product update method.

 

I then wanted to download a text file of all my products using Easypopulate so that I could update the new price/group columns, and upload it again. [i was very careful to follow all the instructions in the Easypopulate notes for the changes needed for SPPC (uncommenting some lines for the new customer groups).]

 

But I found using Easypopulate that the

 

"Download Model/Price/Qty tab-delimited .txt file to edit"

 

worked fine (making a txt file with the new price groups) but

 

"Download Complete tab-delimited .txt file to edit"

 

did not include the new prices. I didn't try an upload at this point as I had no idea what would happen :'(

 

First I set about getting the complete download to work.

 

The Easypopulate instructions say

For use with the Separate Price per Customer contrib:
Edit easypopulate.php.  Find function ep_create_file_layout around line 655.  Uncomment all rows in that function that look like this:
	 #'v_customer_price_1'  => $iii++,
	 #'v_customer_group_id_1'  => $iii++,
Only uncomment the pairs of lines for as many prices as you are using.  I.E. If you are using Retail and Wholesale, then only umcomment the lines that end in _1 and _2.  If you have 3 levels of prices, uncomment the _1, _2, and _3 lines.

 

I found function ep_create_filelayout($dltype) and dltype can be 'full', 'priceqty', 'category' and 'froogle' which corresponds to the 4 options for downloading a txt file with easypopulate... so I added the extra v_customer_price_1, v_customer_group_id_1, v_customer_price_2, v_customer_group_id_2 lines to the 'full' case too

 

     $header_array = array(
	 'v_products_price'  => $iii++,
	 'v_customer_price_1'  => $iii++,
	 'v_customer_group_id_1'  => $iii++,
	 'v_customer_price_2'  => $iii++,
	 'v_customer_group_id_2'  => $iii++,  
	 'v_products_weight'  => $iii++,
	 'v_date_avail' 	 => $iii++,
	 'v_date_added' 	 => $iii++,
	 'v_products_quantity'  => $iii++,
	 );

 

I think maybe the 'v_products_price' is unnecessary? I left the extra column in my EP files anyway as it works so why fiddle :rolleyes:

 

Now I had the ability to download the full text file complete with the empty columns ready to put in my new group prices.

 

Regretably, the upload (tested with just one product just in case!) gave the error

 

File uploaded.
Temporary filename: /tmp/phpFqQKHx
User filename: SPPCtest1.txt
Size: 583
| sis2436C | stamps/sis | Birthday | Catalogue: | | 5.85 | 5.85 | 0 | 2.49 | 1 | 0 | | 05/03/2005 | 0 | Stamp-it | Rubber Sta | Words | | | Taxable Go | Active Updated
1136 - Column count doesn't match value count at row 1

INSERT INTO products_groups VALUES ( 0, 5.85, 122, 4.9787 )

[TEP STOP]

 

I was stuck... but the thread mentioned above by Janz suggested deleting a couple of lines in easypopulate.php

 

 	 if ($v_customer_price_1 != ''){
   $result = tep_db_query('
    	 INSERT INTO
       '.TABLE_PRODUCTS_GROUPS.'
    	 VALUES
    	 (
       ' . $v_customer_group_id_1 . ',
       ' . $v_customer_price_1 . ',
       ' . $v_products_id . ',
       ' . $v_products_price .'
       )'
    	 );
	 }

 

Just get rid of the ' . $v_products_price .' line each place it occurs in this section and no more errors!

 

Hmm, well actually my uploaded prices unexpectedly have tax added when I don't want it but I think I can fix that with a switch somewhere which will be another story...

 

Eeek, I hope I remembered everything

HTH,

dcmo

Link to comment
Share on other sites

  • 2 weeks later...
  • 7 months later...
Hi everyone,

 

Just had a go with the solution suggested above.... IT WORKED! :thumbsup:

 

So, to summarise ... :huh: (sorry this gets a bit long but I hope it helps someone.

 

I had Easypopulate working fine. Then I installed the SPPC contribution and added just one extra group so I had two groups of customers, Retail and Trade. This was working fine with a few test products I updated with the 2 prices per product using the usual admin product update method.

 

I then wanted to download a text file of all my products using Easypopulate so that I could update the new price/group columns, and upload it again. [i was very careful to follow all the instructions in the Easypopulate notes for the changes needed for SPPC (uncommenting some lines for the new customer groups).]

 

But I found using Easypopulate that the

 

"Download Model/Price/Qty tab-delimited .txt file to edit"

 

worked fine (making a txt file with the new price groups) but

 

"Download Complete tab-delimited .txt file to edit"

 

did not include the new prices. I didn't try an upload at this point as I had no idea what would happen :'(

 

First I set about getting the complete download to work.

 

The Easypopulate instructions say

For use with the Separate Price per Customer contrib:
Edit easypopulate.php. ?Find function ep_create_file_layout around line 655. ?Uncomment all rows in that function that look like this:
?	#'v_customer_price_1' ?=> $iii++,
?	#'v_customer_group_id_1' ?=> $iii++,
Only uncomment the pairs of lines for as many prices as you are using. ?I.E. If you are using Retail and Wholesale, then only umcomment the lines that end in _1 and _2. ?If you have 3 levels of prices, uncomment the _1, _2, and _3 lines.

 

I found function ep_create_filelayout($dltype) and dltype can be 'full', 'priceqty', 'category' and 'froogle' which corresponds to the 4 options for downloading a txt file with easypopulate... so I added the extra v_customer_price_1, v_customer_group_id_1, v_customer_price_2, v_customer_group_id_2 lines to the 'full' case too

 

 ? ? $header_array = array(
?	'v_products_price' ?=> $iii++,
?	'v_customer_price_1' ?=> $iii++,
?	'v_customer_group_id_1' ?=> $iii++,
?	'v_customer_price_2' ?=> $iii++,
?	'v_customer_group_id_2' ?=> $iii++, ?
?	'v_products_weight' ?=> $iii++,
?	'v_date_avail' ?	=> $iii++,
?	'v_date_added' ?	=> $iii++,
?	'v_products_quantity' ?=> $iii++,
?	);

 

I think maybe the 'v_products_price' is unnecessary? I left the extra column in my EP files anyway as it works so why fiddle :rolleyes:

 

Now I had the ability to download the full text file complete with the empty columns ready to put in my new group prices.

 

Regretably, the upload (tested with just one product just in case!) gave the error

 

File uploaded.
Temporary filename: /tmp/phpFqQKHx
User filename: SPPCtest1.txt
Size: 583
| sis2436C | stamps/sis | Birthday | Catalogue: | | 5.85 | 5.85 | 0 | 2.49 | 1 | 0 | | 05/03/2005 | 0 | Stamp-it | Rubber Sta | Words | | | Taxable Go | Active Updated
1136 - Column count doesn't match value count at row 1

INSERT INTO products_groups VALUES ( 0, 5.85, 122, 4.9787 )

[TEP STOP]

 

I was stuck... but the thread mentioned above by Janz suggested deleting a couple of lines in easypopulate.php

 

 ?	if ($v_customer_price_1 != ''){
? ?$result = tep_db_query('
? ? ?	INSERT INTO
? ? ? ?'.TABLE_PRODUCTS_GROUPS.'
? ? ?	VALUES
? ? ?	(
? ? ? ?' . $v_customer_group_id_1 . ',
? ? ? ?' . $v_customer_price_1 . ',
? ? ? ?' . $v_products_id . ',
? ? ? ?' . $v_products_price .'
? ? ? ?)'
? ? ?	);
?	}

 

Just get rid of the ' . $v_products_price .' line each place it occurs in this section and no more errors!

 

Hmm, well actually my uploaded prices unexpectedly have tax added when I don't want it but I think I can fix that with a switch somewhere which will be another story...

 

Eeek, I hope I remembered everything

HTH,

dcmo

 

Hi, Dcmo:

 

Thank for your threads. I tried and modified the php file and one thing I am not sure is that you stated to

 

Just get rid of the ' . $v_products_price .' line each place it occurs in this section and no more errors!

 

Can you be more speific on where are those line needed to be deleted?

 

Thanks

 

Spencer

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