Jump to content
sem101

QTPro 4.25 + Easy Populate 2.8 MS2 = almost working!

Recommended Posts

Hi there,

 

I have the standard generic attibutes in my store to begin with a clean DB (auto increment = 1):

 

Product: T-Shirt

Option Name: Size(id1), Color (id2)

Option Values: SM (id1), MED (id2), LG (id3), XL (id4), Black (id5)

You get the point :D

 

In Easy Populate I have enabled "Activate support for Quantity Tracking Professional?" to "true". This is excellent, because now I get the columns when I export a generic starter CSV:

 

v_attribute_values_stock_1_1

v_attribute_values_stock_1_2

v_attribute_values_stock_1_3

etc.

 

However, after triple-checking that I have set the QTYPro stock count for my product and it's attributes, the CSV only exports the column -- but not the stock quantity. So poking around, this seems fine, as now I have the column mapped and I'll just add stock quantity to that column and re-import the new CSV with a billion new products. However, now...

 

After changing the stock qty to say "5" in v_attribute_values_stock_1_1 it only maps to my 1st attribute: SM, for example. Guess this makes sense because the column title is 1_1.

 

So now, I go into phpMyAdmin and poke around the products_stock table. I find the column products_stock_attributes where it joins the attributes in the form of: 1-1,2-5. I'm assuming this translates to: 1(Product ID) 1(Size) + 2(Color) 5(Black) ??? The first thing that came to mind was that the Comma interfered with the Easy Populate export?

 

So then I took a look at Stock.php and found were the comma was used, played around with a new character but nothing seemed to work. The only thing I can think of is something in the easypopulate.php file around these lines:

 

(around line 378)

//// attributes stock add start		
									if (EP_CONTRIB_QTPRO == 'true') {
									$stock_attributes = $attribute_options['products_options_id'].'-'.$attribute_values['products_options_values_id'];

									$stock_quantity_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_id = '" . (int)$row['v_products_id'] . "' and products_stock_attributes = '" . $stock_attributes . "'");
									$stock_quantity = tep_db_fetch_array($stock_quantity_query);
									$row['v_attribute_values_stock_' . $attribute_options_count . '_' . $attribute_values_count] = $stock_quantity['products_stock_quantity'];
									}
									//// attributes stock add end

 

 

(around line 1168)

//// attributes stock add start		
									if (EP_CONTRIB_QTPRO == 'true') { 
													$key6 = 'v_attribute_values_stock_' . $attribute_options_count . '_' . $attribute_values_count;
													$header_array[$key6] = $iii++;
									}				
//// attributes stock add end

 

There's more in there, but I don't wanna post a shitload of code. If anyone can pick this apart or point me the right direction I'd be so grateful! It seems that given my limited knowledge, I can figure out how to add 1 attribute to a T-Shirt. I can set SM, MED, LG, XL quantities, but I can't set BLACK+SM, BLACK+MED, BLACK+LG, BLACK+XL :(

 

I guess my question is: How do we get the products_stock_attributes to map to the products_stock_quantity so it can be exported/imported via Easy Populate? Sorry for the long post. I'm tired and wired! Thanks!

Share this post


Link to post
Share on other sites

Hi Sem,

 

I'm working along the same lines at the moment using EP_v2_76_MS2_1 and QTPro.v4.25.

 

I've managed to upload stock for only one attribute option 'size'. The stuff I've read in the forum seems to suggest that EP will only cope with one attribute option.

 

Uploading stock for one option is ok but I can't get the damn thing to download the stock values for this option! You've stated that you've got the download partially working? Column headings but no stock figures? That's better than I've managed.

 

Have you made any progress?

 

Regards

 

Rhys


Regards

 

Rhys

Share this post


Link to post
Share on other sites

I don't know what's going on in the Easy Populate contrib download area. It's a mess. People are adding version numbers, modifications, stripping away working code to only suit their needs, getting over-ambitious. I know what it's like wanting to "geek out" and serve the community, but the mods are pure chaos...

 

People are even RE-NAMING both contribs to "EasyPopulater" and "QTYPro" in their modded versions -- wtf? I suggest downloading the clean base version of both and adding your own modifications that work for the time being. I have yet to find one forum post or accurate snippet that works with QTPro. And by "works" I mean 100%. The original authors did fine jobs - trust them.

 

Time spent in the forums and with mod tweaking: 2 WEEKS

Time spent starting from scratch: 2 DAYS

 

I've got a beta working solely for my client - but I'm not ready to release a contrib just yet because I don't want to further confuse the osC community. Good luck.

Share this post


Link to post
Share on other sites

Hi Sem,

 

An update - I've got EasyPopulate and QTPro working for one option (size) with stock for both uploads and downloads - fixed the download option by removing the If '..QTPRO=TRUEetc' statements in a number of places. Feck knows why this was stopping the downloads from working.

 

I'm now satisfied - one option is enough for my client.

 

I can email my easypopulate.php file if you want it - though again - it's been heavily modded (SPPC, hide products for SPPC, Multiple images, and of course... QTPro)

 

Hope your work goes well.

 

Regards

 

Rhys

Edited by lemonyellow

Regards

 

Rhys

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

×