Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Easy Populate & Products Attributes


VJ

Recommended Posts

i'm on 2.2ms2 with separate pricing 3.5 and i thought i'd load easypopulate2.72 to get attrib upload/download functionality

 

all excellent modules BTW and thanks to all concerned - the problem i'm having is one of coexistence

 

easypopulate2.72 appears to have broken the separate pricing upload/download i was enjoying with 2.62 - i hacked about and seem to have download functionality back again (see diff - my mods vs admin/eaypopulate.php.original) but upload of attribs is still broken

 

if you have the same problem an answer to the download problem is in the diff.

 

i don't appear to be getting beyond VJs while statement duing an upload

 

while (isset($$v_attribute_options_id_var) && !empty($$v_attribute_options_id_var)) {

 

which is where ALL the attrib upload code lives ?

 

hoping someone familiar with easypoulate could explain it to me - i haven't got my head around th $$ thing at all

 

the log file shows what happens in an upload

 

if anyone is working on this and needs a tester or collaborator pls let me know especially separate pricing for attributes and/or attrib upload with easypopulate

 

thanks in advance

 

diff easypopulate.php easypopulate.php.hacked

 

21,22c21,22
< $tempdir = "/catalog/temp/";
< $tempdir2 = "/catalog/temp/";
---
> $tempdir = "/gallery/temp/";
> $tempdir2 = "/gallery/temp/";
280c280
<       // now lop off the trailing tab
---
>       // now Lop off the trailing tab
920d919
<               // uncomment the customer_price and customer_group to
support multi-price per product contrib
929c928,936
<                       );
---
>                         'v_customer_price_1'          => $iii++,
>                       'v_customer_group_id_1'         => $iii++,
>                       #'v_customer_price_2'           => $iii++,
>                       #'v_customer_group_id_2'                => $iii++,
>                       #'v_customer_price_3'           => $iii++,
>                       #'v_customer_group_id_3'                => $iii++,
>                       #'v_customer_price_4'           => $iii++,
>                       #'v_customer_group_id_4'                => $iii++,
>                         );
971c978
<
---
> // uncomment the customer_price and customer_group to support multi-price
per product contrib
1017,1018c1024,1025
<                       #'v_customer_price_1'           => $iii++,
<                       #'v_customer_group_id_1'                => $iii++,
---
>                       'v_customer_price_1'            => $iii++,
>                       'v_customer_group_id_1'         => $iii++,
1923a1931,1932
>                         error_log("$v_attribute_options_id_var", 0);
>                       error_log("$$v_attribute_options_id_var", 0);
1926a1936,1937
>                                 error_log("VJs remove loop", 0);
>                                 error_log("$$v_attribute_options_id_var",
>                                 0);1981c1992
<
---
>                                 error_log("$v_attribute_values_id_var", 0);
1987a1999
>                                         error_log("iVJs value table update
loop", 0);
2004a2017
>
error_log("pov2po loop", 0);
2081a2095
>

 

php log for an upload

 

[06-Feb-2004 23:08:46] $v_attribute_options_id_1
[06-Feb-2004 23:08:46] v_attribute_options_id_1
[06-Feb-2004 23:08:46] $v_attribute_options_id_1
[06-Feb-2004 23:08:46] v_attribute_options_id_1
[06-Feb-2004 23:08:46] $v_attribute_options_id_1
[06-Feb-2004 23:08:46] v_attribute_options_id_1
[06-Feb-2004 23:08:46] $v_attribute_options_id_1
[06-Feb-2004 23:08:46] v_attribute_options_id_1
[06-Feb-2004 23:08:46] $v_attribute_options_id_1
[06-Feb-2004 23:08:46] v_attribute_options_id_1
[06-Feb-2004 23:08:46] $v_attribute_options_id_1

Link to comment
Share on other sites

Help,

 

Am having trouble with the v_attribute_values_price field with easypopulate.

 

It exports absolutely fine but when you import it back (even without editing at all) it rounds the price down to the nearest whole number. eg +9.25 becomes 9.00 in attributes.

 

Am running oscommerce 2.2ms2 with easy populate 2.73ms2.

 

have tried everything I can think of and dont know much php so any help would be greatly appreciated.

 

 

Thanks in advance

 

Ian

Link to comment
Share on other sites

I have the exact same problem as Ian -- which I only just noticed after doing a large attribute update in Excel and then uploading the file. Fortunately I'd taken a backup prior to performing the update. I'm not convinced that the problem is that of rounding though -- all my figures are rounded down, i.e. ?349.99 becomes ?349.00. It may be that the information after the decimal point is simply being ignored. I'm not sure enough of PHP's rounding rules, although rounding down in all cases sounds like an unlikely way of dealing with float -> integer conversions.

 

I'll have a look at the code this evening and see if I can figure anything out.

 

Cheers,

Chris

Link to comment
Share on other sites

Aha! Found it (after sifting through over 2000 lines of code). On around line 2047 of admin/easypopulate.php, the following code exists:

 

if (tep_db_num_rows($attribute_prices_values) <= 0) {
$attribute_prices_insert_query = "insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_id, options_id, options_values_id, options_values_price, price_prefix) values ('" . (int)$v_products_id . "', '" . (int)$$v_attribute_options_id_var . "', '" . (int)$$v_attribute_values_id_var . "', '" . (int)$$v_attribute_values_price_var . "', '" . $attribute_values_price_prefix . "')";

 

The culprit is this part:

 

(int)$$v_attribute_values_price_var

 

Turns out the attribute prices were being converted to ints. What I did to fix it was a simple cast from integer to floating point like so:

 

(float)$$v_attribute_values_price_var

 

So the whole line likes like:

 

if (tep_db_num_rows($attribute_prices_values) <= 0) {
$attribute_prices_insert_query = "insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_id, options_id, options_values_id, options_values_price, price_prefix) values ('" . (int)$v_products_id . "', '" . (int)$$v_attribute_options_id_var . "', '" . (int)$$v_attribute_values_id_var . "', '" . (float)$$v_attribute_values_price_var . "', '" . $attribute_values_price_prefix . "')";

 

I'm no PHP coder (rather a C++/Java coder), and would recommend those in the know take a look at my change before you all go and update your easypopulate code. This has solved the problem for me however!

 

Cheers,

Chris

Link to comment
Share on other sites

Chris,

 

thanks a lot mate, that fixed it. I need to get a book and get my brain round php so I can be of more help to myself and this community. Any recomendations?

 

Also just wanted to slip in a cheeky question someone may know the answer to -

 

Am using the actual attributes price mod, any ideas how to stop easypopulate adding a + or - price prefix if one isn't entered, or failing that is there a way to purge the price_prefix field in the database with phpmyadmin??

 

Thanks muchly for the help!

 

Cheers

 

Ian :D

Link to comment
Share on other sites

No worries Ian, glad to be of help! Nice to finally be able to contribute something. Can't really help with the actual attributes thing though -- I'm using "Product Attributes/Item Editor/Price v. 1.1". Not sure if it's the best, but it does the job!

 

As far as PHP books go, I don't even have any myself, using http://www.php.net whenever I need to look something up, although a reference book is definitely a must for any serious coding. You might want to get a book for a general introduction, and I would generally recommend the O'Reilly "In a Nutshell" series, of which I own a good few. They are concise and to the point, and I have not been disappointed by one yet. Have a look in your local library, I've been doing that of late, and have been surprised at some of the recent books they have (Macromedia Flash, 3D studio). Or just see what's popular on Amazon, the reviews section really helps avoid buying duff books (I wish they had it when I was at university!)

 

Cheers,

Chris

Link to comment
Share on other sites

Thanks mate will look Mr O'Reilly up and see whats what.

 

Quiet Chuckle to myself about the library, I live out in the sticks in deepest darkest essex - be lucky if they have a beginers guide to the vic 20 in there.

 

Anyways, eyes are going 4:3 and bed becons.

 

Thanks again.

 

Ian

Link to comment
Share on other sites

It''s been a long week and I am to tired to see the problem. I uncommented the section for the image mods, but get the following error.

 

Parse error: parse error in /homepages/.../admin/easypopulate.php on line 1682

 

Here is the ofendding line

$query .= .v_products_mimage . '", "'

 

 

What did I do wrong?

 

Don

Link to comment
Share on other sites

is there a way of adding additional attributes via Easy Populate? do I just need to add the specific fields, increasing the option number and respective fields so it goes further out?

 

currently my EP file is like this:

v_products_model v_products_image v_products_name_1 v_products_description_1 v_products_info_1 v_products_url_1 v_products_head_title_tag_1 v_products_head_desc_tag_1 v_products_head_keywords_tag_1 v_products_price v_products_weight v_date_avail v_date_added v_products_quantity v_dvd_star v_dvd_director v_dvd_release_date v_dvd_type v_dvd_features v_dvd_studio v_dvd_categories v_dvd_movie_length v_dvd_also_available v_products_bimage v_products_subimage1 v_products_bsubimage1 v_products_subimage2 v_products_bsubimage2 v_products_subimage3 v_products_bsubimage3 v_products_subimage4 v_products_bsubimage4 v_products_subimage5 v_products_bsubimage5 v_products_subimage6 v_products_bsubimage6 v_attribute_options_id_1 v_attribute_options_name_1_1 v_attribute_values_id_1_1 v_attribute_values_price_1_1 v_attribute_values_name_1_1_1 v_attribute_values_id_1_2 v_attribute_values_price_1_2 v_attribute_values_name_1_2_1 v_attribute_values_id_1_3 v_attribute_values_price_1_3 v_attribute_values_name_1_3_1 v_attribute_values_id_1_4 v_attribute_values_price_1_4 v_attribute_values_name_1_4_1 v_attribute_values_id_1_5 v_attribute_values_price_1_5 v_attribute_values_name_1_5_1 v_attribute_values_id_1_6 v_attribute_values_price_1_6 v_attribute_values_name_1_6_1 v_attribute_values_id_1_7 v_attribute_values_price_1_7 v_attribute_values_name_1_7_1 v_attribute_values_id_1_8 v_attribute_values_price_1_8 v_attribute_values_name_1_8_1 v_attribute_values_id_1_9 v_attribute_values_price_1_9 v_attribute_values_name_1_9_1 v_attribute_values_id_1_10 v_attribute_values_price_1_10 v_attribute_values_name_1_10_1 v_attribute_values_id_1_11 v_attribute_values_price_1_11 v_attribute_values_name_1_11_1 v_attribute_values_id_1_12 v_attribute_values_price_1_12 v_attribute_values_name_1_12_1 v_attribute_values_id_1_13 v_attribute_values_price_1_13 v_attribute_values_name_1_13_1 v_attribute_values_id_1_14 v_attribute_values_price_1_14 v_attribute_values_name_1_14_1 v_attribute_values_id_1_15 v_attribute_values_price_1_15 v_attribute_values_name_1_15_1 v_attribute_values_id_1_16 v_attribute_values_price_1_16 v_attribute_values_name_1_16_1 v_attribute_values_id_1_17 v_attribute_values_price_1_17 v_attribute_values_name_1_17_1 v_attribute_values_id_1_18 v_attribute_values_price_1_18 v_attribute_values_name_1_18_1 v_attribute_values_id_1_19 v_attribute_values_price_1_19 v_attribute_values_name_1_19_1 v_attribute_values_id_1_20 v_attribute_values_price_1_20 v_attribute_values_name_1_20_1 v_attribute_values_id_1_21 v_attribute_values_price_1_21 v_attribute_values_name_1_21_1 v_attribute_values_id_1_22 v_attribute_values_price_1_22 v_attribute_values_name_1_22_1 v_attribute_values_id_1_23 v_attribute_values_price_1_23 v_attribute_values_name_1_23_1 v_attribute_values_id_1_24 v_attribute_values_price_1_24 v_attribute_values_name_1_24_1 v_attribute_values_id_1_25 v_attribute_values_price_1_25 v_attribute_values_name_1_25_1 v_attribute_values_id_1_26 v_attribute_values_price_1_26 v_attribute_values_name_1_26_1 v_attribute_values_id_1_27 v_attribute_values_price_1_27 v_attribute_values_name_1_27_1 v_attribute_options_id_2 v_attribute_options_name_2_1 v_attribute_options_id_3 v_attribute_options_name_3_1 v_attribute_values_id_3_1 v_attribute_values_price_3_1 v_attribute_values_name_3_1_1 v_attribute_values_id_3_2 v_attribute_values_price_3_2 v_attribute_values_name_3_2_1 v_attribute_values_id_3_3 v_attribute_values_price_3_3 v_attribute_values_name_3_3_1 v_attribute_values_id_3_4 v_attribute_values_price_3_4 v_attribute_values_name_3_4_1 v_attribute_values_id_3_5 v_attribute_values_price_3_5 v_attribute_values_name_3_5_1 v_attribute_values_id_3_6 v_attribute_values_price_3_6 v_attribute_values_name_3_6_1 v_attribute_values_id_3_7 v_attribute_values_price_3_7 v_attribute_values_name_3_7_1 v_attribute_values_id_3_8 v_attribute_values_price_3_8 v_attribute_values_name_3_8_1 v_attribute_values_id_3_9 v_attribute_values_price_3_9 v_attribute_values_name_3_9_1 v_attribute_values_id_3_10 v_attribute_values_price_3_10 v_attribute_values_name_3_10_1 v_attribute_values_id_3_11 v_attribute_values_price_3_11 v_attribute_values_name_3_11_1 v_attribute_values_id_3_12 v_attribute_values_price_3_12 v_attribute_values_name_3_12_1 v_attribute_values_id_3_13 v_attribute_values_price_3_13 v_attribute_values_name_3_13_1 v_attribute_values_id_3_14 v_attribute_values_price_3_14 v_attribute_values_name_3_14_1 v_attribute_values_id_3_15 v_attribute_values_price_3_15 v_attribute_values_name_3_15_1 v_attribute_values_id_3_16 v_attribute_values_price_3_16 v_attribute_values_name_3_16_1 v_attribute_options_id_4 v_attribute_options_name_4_1 v_attribute_values_id_4_1 v_attribute_values_price_4_1 v_attribute_values_name_4_1_1 v_attribute_values_id_4_2 v_attribute_values_price_4_2 v_attribute_values_name_4_2_1 v_attribute_values_id_4_3 v_attribute_values_price_4_3 v_attribute_values_name_4_3_1 v_attribute_values_id_4_4 v_attribute_values_price_4_4 v_attribute_values_name_4_4_1 v_attribute_values_id_4_5 v_attribute_values_price_4_5 v_attribute_values_name_4_5_1 v_attribute_options_id_5 v_attribute_options_name_5_1 v_attribute_values_id_5_1 v_attribute_values_price_5_1 v_attribute_values_name_5_1_1 v_attribute_values_id_5_2 v_attribute_values_price_5_2 v_attribute_values_name_5_2_1 v_attribute_values_id_5_3 v_attribute_values_price_5_3 v_attribute_values_name_5_3_1 v_attribute_values_id_5_4 v_attribute_values_price_5_4 v_attribute_values_name_5_4_1 v_attribute_values_id_5_5 v_attribute_values_price_5_5 v_attribute_values_name_5_5_1 v_attribute_values_id_5_6 v_attribute_values_price_5_6 v_attribute_values_name_5_6_1 v_attribute_values_id_5_7 v_attribute_values_price_5_7 v_attribute_values_name_5_7_1 v_attribute_values_id_5_8 v_attribute_values_price_5_8 v_attribute_values_name_5_8_1 v_attribute_values_id_5_9 v_attribute_values_price_5_9 v_attribute_values_name_5_9_1 v_attribute_values_id_5_10 v_attribute_values_price_5_10 v_attribute_values_name_5_10_1 v_attribute_options_id_6 v_attribute_options_name_6_1 v_manufacturers_name v_categories_name_1 v_categories_name_2 v_categories_name_3 v_tax_class_title v_status EOREOR

 

this, do i bump the attribute options and respective by 1?

Link to comment
Share on other sites

Does anyone know how to incorprate the specials section of products into the text file?

 

Also I was wondering how would you delete products from the website, is it possible through excel?

I'm also very interested in the specials idea, that'd save me an absolute age.

 

So far as deleting through excel, that's definately a no.

 

all you could do is set the items to inactive and then delete them on mass through sql, could get messy though. Make sure you back up first!

Link to comment
Share on other sites

  • 2 weeks later...

ok, help me here,

 

We got a bookshop, that sells books as pdf, mp3, hard cover and softcover.

 

all of these are options, but if they dont selec an option at all we end up with orders for zero dollars and we need to know if there is a way to REQUIRE at least one option before they can check out?

 

 

 

 

Cliff....

Link to comment
Share on other sites

I have this installed in my site, it looks like it would be awesome since I have 300 hundred products and need to add about 1000

 

Problem is I have all the product_numbers the actual part number for easier data entry into our quickbooks. Is there a way to ad an extra field? some of my part numbers are the same, in different categories.. EP seems to get really confused. Any possible way to append the real product number onto the back of the EP product number??

 

Kinda really limits the usability of the contrib since everyone uses parts numbers

Link to comment
Share on other sites

Also, I was wondering how does EP handle if a product is in more than one category?

 

Just messing around with the contrib seems like it got totally confused when I put the product back up into the site.

 

Say for example., I have 1 product, it has 3 categories, 2 of those 3 have sub categories.

Link to comment
Share on other sites

one more question! honest.

 

How does EP look at the attributes to ad them into the Database? the few products I messed with seemed to get the attributes upside down compared to the product I copied the attribute info from.

Link to comment
Share on other sites

I myself have not figured out on the inventory item being 'linked' to multiple categories, thus I am going to do that part manually after installation. perhaps use the quickbooks link to tie things in from the store to the acounting.

adding fields to EP is very easy, you need to add them to the database all the way.

Link to comment
Share on other sites

I think I have figured out how to add additional attributes, just want clarificatoin. Unfortulately for me, my current spreadsheet goes out to column IN and I think the spreadsheet goes to column IV.

 

So what I am thinking, if I have additional attributes, I can leave out the attributes I am not using, on another spread sheet, and by incrementing the attribute number per the example on or about page 2 of this thread, I can add additional attributes to the database through EP.

 

If I am going in the right direction, please let me know, if not please let me know.

Link to comment
Share on other sites

Hi, I've been using EP for a while now and it's saved me hours of work, my store has 2500 products and without this contrib I'd still be entering product #99.

 

Thanks for a great job.

 

Anyway my questions...

 

1, The product added is not working. I think this is something to do with MS Excell, i enter the date as '03/03/2004 10:46:00' but excell changes it to '03/03/2004 10:46'. Is there any way to rectify this?

 

2, I am unable to download the compleate tab deliminated file from my server, it gives me an error message 'The server encountered an internal error or misconfiguration...etc'. I guess this is because of the size of the file. Is there any way to fix this (I'm sure I've read something about this before but I can't remember where, sorry if I'm repeating a previous post)

 

Thanks again

 

Craig

Link to comment
Share on other sites

Try downloading

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

 

ps I?ve have an updated version so you have model prise qty only

 

If you can download this then it probebly is the size of the file..

 

The script time takes to long..

You split when uploading?

 

Date in excel

Do you want to display seconds ?

 

look in excel formatting cells / time

Link to comment
Share on other sites

Hello

 

I just tried to use this contribution for the second time ( first was with EPV2 ) this time with Vers2.72.

 

I get this message when I try to go to the easypopulate.php page

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/purchaseit/public_html/catalog/admin/easypopulate.php on line 659

 

 

Any help would be appreciated.

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