Zen Cart Logo
Forums / Addon Admin Tools / Product Extra Fields for text, pdfs and flash

Product Extra Fields for text, pdfs and flash

Views: 74,446

Results 261 to 280 of 381
29 Nov 2012, 19:46
#261
exconrider avatar

exconrider

New Zenner

Join Date:
Apr 2011
Posts:
3
Plugin Contributions:
0

Product Extra Fields for text, pdfs and flash

I restored all of my site files, except the database, to a date well before I tried installing this. Do I need to change/fix a table on the database or something?

29 Nov 2012, 20:09
#262
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

no, the mod adds a table and changes none so you have missed a file somewhere.

21 Mar 2013, 17:42
#263
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,278
Plugin Contributions:
37

Re: Product Extra Fields for text, pdfs and flash

Thanks for the mod Delia... I have an issue i am hoping you can help me with.

Everything is working...

-Got fields in admin
-Even the file is uploaded
-The old files (existing) work in the catalog (new files cannot file the filename)
-No errors showing even in debug
-text is working, anchor, descriptions etc

However, it will not write the filename for the file upload to the database. I have checked the install several times and even installed it on a test site and it does not populate the database field for files... text yes, files not so much... they are in fact however being uploaded.

Zen Cart 1.5.1
PHP 5.3.21
MySQL 5.1.68-cll

any ideas?

21 Mar 2013, 19:18
#264
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

Without working with it myself, I can't answer that for sure. But I could see that there's a php problem if the code I used wasn't allowed on your server. It would not give an error; it would just not work. But as I'm not a php guru, I really can't be more specific.

I have not tested that part on that level of php but have heard no complaints so far. There were very few changes between the 1.3.9h files and the 1.5x files themselves so I would assume it normally works.

21 Mar 2013, 19:21
#265
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,278
Plugin Contributions:
37

Re: Product Extra Fields for text, pdfs and flash

I actually had to change the ability to include the url part in the PHP config, but got it going now

21 Mar 2013, 19:23
#266
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

Great! I was in the area of the right answer!

21 Mar 2013, 19:27
#267
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,278
Plugin Contributions:
37

Re: Product Extra Fields for text, pdfs and flash

Yes ma'am! Thanks again

24 May 2013, 15:11
#268
landron avatar

landron

New Zenner

Join Date:
Dec 2011
Posts:
23
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

Hi, I'm in the process of building a new site based on 1.5.1 and I could use more text fields but not video, links or PDF's. I'm new to ZenCart and not a coder. It's a wine site and I've set up categories for things like vintage, country, region, style, size, and a few more for search purposes. Ideally, I'd love to have the category info put into these fields. Minimally, I need all this same information to appear in the product descriptions and would like to add all your additional fields as text even if I manually or through EasyPopulate, fill out the fields. Any assistance would be appreciated.

24 May 2013, 15:17
#269
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

It's definitely possible to do that but it does require php skills. The database fields are all text fields so you just have to change the admin for input - and that's really what the mod does - so it is a fair amount of work that I suspect you aren't capable of doing.

Even writing up any instructions would be a long, drawn out thing.

25 May 2013, 12:05
#270
landron avatar

landron

New Zenner

Join Date:
Dec 2011
Posts:
23
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

Thank you for the response. I figured out how to do what I need using read-only attributes. Although I haven't tried it yet, I'm under the impression that EasyPolulate will allow the uploading of attributes.

25 May 2013, 12:49
#271
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

I have to recommend apsona store manager over easy populate. Just saying.... apsona.com

19 Feb 2014, 20:15
#272
bobc avatar

bobc

New Zenner

Join Date:
Jun 2013
Location:
UK
Posts:
49
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

Hi Delia

I have installed your plugin to my 1.5.1 development environment and have it working at least part of the way. It is worth pointing out, I am not a Zen Guru or PHP expert.

I can see the four fields when I add a product and I can see the content of those fields in your SQL table alongside the product ID I copied from the Zen Products table. So far, so good!

When I preview the product I can see Text which says files to download, and below that I see (in blue text) the title of

the file I entered in the field. However, if I click the blue text I get an error as shown here and when I view the page as a user I see this and this is what I can see in your SQL table

The product 'Seared Halibut' is created as a 'Product_general' class rather than a new class as previously suggested by another user.

I have edited my custom tpl_product_info.php as mentioned elsewhere on your site but still nothing shows in the user view also I have edited the downloads and product_extra_files folders to 777 for test purposes.

I hope you are able to understand my issue.

Many thanks in advance,

Bob

19 Feb 2014, 20:32
#273
bobc avatar

bobc

New Zenner

Join Date:
Jun 2013
Location:
UK
Posts:
49
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

delia:

Sorry about being awol, guys! Been under the weather.

First of all, the absolute best way to create the correct fields and rows after installing this is to do it via excel. lat9 is right about the way he did his cart. However, some folks may find that to be cumbersome and may not even work for others. You need to create a row for every product you have not just the ones you think you need this on.

First, export the product_extra_fields table via phpmyadmin. Choose excel csv as the type of export and you may need to experiment to see which opens correctly in your version of excel but the csv works for me. Be sure not to leave NULL in the blank for filler for empty space.

Open that file in excel. Fill in the product id numbers for every product (type 1,2,3,4,5 - select and draw the column down to easily create your product id numbers). Save the file as csv and import in phymyadmin. Put a comma in Fields terminated by where it defaults to semicolon. Be sure to check the box to replace the table data.

I am aware that copying and deleting the product does not work correctly and will be fixing once I get a chance to do that.

You can also use an SQL statement to copy ALL the product ID's from the products table - like this

Insert into Product_Extra_Description_Extra (product_id)
Select product_id from products

NOTE: products is the default zen table you may have a suffix or prefix.

19 Feb 2014, 20:54
#274
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

The first error message is saying that the files are not where the script is expecting to find them. The mod normally references the folder in the store root but for some reason yours is looking for the folder inside the download folder. Did you change anything beyond the instructions?

I will have to dig deep in the actual code itself to find out where and what controls this but I've never seen this go wrong before.

19 Feb 2014, 21:38
#275
bobc avatar

bobc

New Zenner

Join Date:
Jun 2013
Location:
UK
Posts:
49
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

No I have'nt changed anything apart from what the previous advisor suggested, that was create product types of PDF and DOC and assign them to the plugin php.

I have now moved the product_extra_files folder from within the downloads folder to the root of the cart and am getting a message

Error: Destination does not exist I:/xampp/htdocs/seafoodexpress/download/products_extra_files when creating a product. Yet I can see in /admin/includes/modules/new_product_preview.php the code is as follows which clearly calls for the file to be in the root.

if ($_POST['file_1_title'] != '') {
    $products_file_1 = new upload('file_1');
    $products_file_1->set_destination(DIR_FS_PRODUCT_EXTRA);
    if ($products_file_1->parse() && $products_file_1->save(true)) {
        $products_file_1_name = $products_file_1->filename;
    } else {
        $products_file_1_name = (isset($_POST['previous_file_1']) ? $_POST['previous_file_1'] : '');
    }
}

if ($_POST['file_2_title'] != '') {
    $products_file_2 = new upload('file_2');
    $products_file_2->set_destination(DIR_FS_PRODUCT_EXTRA);
    if ($products_file_2->parse() && $products_file_2->save(true)) {
        $products_file_2_name = $products_file_2->filename;
    } else {
        $products_file_2_name = (isset($_POST['previous_file_2']) ? $_POST['previous_file_2'] : '');
    }
}

if ($_POST['file_3_title'] != '') {
    $products_file_3 = new upload('file_3');
    $products_file_3->set_destination(DIR_FS_PRODUCT_EXTRA);
    if ($products_file_3->parse() && $products_file_3->save(true)) {
        $products_file_3_name = $products_file_3->filename;
    } else {
        $products_file_3_name = (isset($_POST['previous_file_3']) ? $_POST['previous_file_3'] : '');
    }
}

if ($_POST['file_4_title'] != '') {
    $products_file_4 = new upload('file_4');
    $products_file_4->set_destination(DIR_FS_PRODUCT_EXTRA);
    if ($products_file_4->parse() && $products_file_4->save(true)) {
        $products_file_4_name = $products_file_4->filename;
    } else {
        $products_file_4_name = (isset($_POST['previous_file_4']) ? $_POST['previous_file_4'] : '');
    }
}
if ($_POST['video_title'] != '') {
    $products_video = new upload('video');
    $products_video->set_destination(DIR_FS_PRODUCT_EXTRA);;
    if ($products_video->parse() && $products_video->save(true)) {
        $products_video_name = $products_video->filename;
    } else {
        $products_video_name = (isset($_POST['previous_video']) ? $_POST['previous_video'] : '');
    }
}

I think it would be better if i UNWIND the mod, and start again from step 1 what do you think?

Bob

19 Feb 2014, 21:42
#276
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

I:/xampp/htdocs/seafoodexpress/download/products_extra_files
That line says its looking for the products_extra_files folder inside a document folder of download in the root. Do you have zen cart installed in a folder named download? If not, I would be inclined to look at your config files for a reason that it's not looking in the right place.

19 Feb 2014, 23:33
#277
bobc avatar

bobc

New Zenner

Join Date:
Jun 2013
Location:
UK
Posts:
49
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

Hi Delia,

I decided to go back to basics! :blush: and wiped the plugin, restored my previous database and start over.

This time I renamed all the files being replaced as filename.php.keep before copying your files over. I created the new datatable and copied my products_id from products to the new table using my SQL statement (oh I had to change type=MyISAM to ENGINE=MyISAM) to get it to work.

I then recreated the product and added the PDF to file1 and previewed and got the same error ref I/xampp...../downloads/product_extra_files!!

I then went through each of the config file as you suggested and found in includes/modules/pages/product_extra_definitions_info/main_template_vars_product_type.php the following code which seems to indicate that the folder products_extra_files should be in /downloads rather than root or am I reading this wrong?

Kind regards

Bob

/**

  • Retrieve relevant data from relational tables, for the current products_id:
    */

    $tpl_page_body = '/tpl_product_info_display.php';

    $sql = "select * from " . TABLE_PRODUCT_EXTRA_DESCRIPTION_EXTRA . "
    where products_id = '" . (int)$_GET['products_id'] . "'";

    $files = $db->Execute($sql);

/*

  • extract info from queries for use as template-variables:
    */

$products_code = $files->fields['products_code'];
$products_file_1_title = $files->fields['file_1_title'];
$products_file_2_title = $files->fields['file_2_title'];
$products_file_3_title = $files->fields['file_3_title'];
$products_file_4_title = $files->fields['file_4_title'];
$products_file_1 = $files->fields['file_1'];
$products_file_2 = $files->fields['file_2'];
$products_file_3 = $files->fields['file_3'];
$products_file_4 = $files->fields['file_4'];
if (!empty($products_code)) $products_code = TEXT_PRODUCTS_CODE." ".$products_code;
if (!empty($products_file_1_title)) $products_file_1_link = '<a href="' . "/download/products_extra_files/" . $products_file_1 . '">'. $products_file_1_title . '</a>';
if (!empty($products_file_2_title)) $products_file_2_link = '<a href="' . "/download/products_extra_files/" . $products_file_2 . '">'. $products_file_2_title . '</a>';
if (!empty($products_file_3_title)) $products_file_3_link = '<a href="' . "/download/products_extra_files/" . $products_file_3 . '">'. $products_file_3_title . '</a>';
if (!empty($products_file_4_title)) $products_file_4_link = '<a href="' . "/download/products_extra_files/" . $products_file_4 . '">'. $products_file_4_title . '</a>';

20 Feb 2014, 00:15
#278
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

You are right. Crap, I do not have my files set up that way. Are you sure you downloaded the most recent version? What zen cart version are you on so that I can check the correct files on my computer?

20 Feb 2014, 21:09
#279
bobc avatar

bobc

New Zenner

Join Date:
Jun 2013
Location:
UK
Posts:
49
Plugin Contributions:
0

Re: Product Extra Fields for text, pdfs and flash

delia:

You are right. Crap, I do not have my files set up that way. Are you sure you downloaded the most recent version? What zen cart version are you on so that I can check the correct files on my computer?

Hi Delia

:blush::blush::blush: OK now who hasn't got their head screwed on???

After giving up last night at 01.45 I decided to attack the problem again when I got back from work today.

All the Errors were MY errors and the confusion ALL MINE!:blush:

I orginally downloaded your 1.6 version for Zen 1.5.1 and then somehow installed Extra description files mod by aetas!!!!

Thus after deleting all of that, and then installing the CORRECT plugin everything now works fine. :D

Attachment 13814

In actuality, the plugin is simply brilliant and EXACTLY what I was looking for. One final question, is it possible to get rid of the add to cart button when product is free and when any of fields 1-4 are populated?

Thanks again for all your help and please excuse my absolute stupidity!

Kind regards from the UK

Bob

20 Feb 2014, 21:31
#280
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Product Extra Fields for text, pdfs and flash

It can happen to anybody. Not to worry! Just glad you got it straightened out.

The add to cart button is always going to show - for good reason in case they have other products that aren't free. Everything usually still needs to added to the cart. If you only have free products then you can comment out the code - but you might as well, in that case, just turn the cart to show room mode instead. If you do have products for purchase then you are stuck with the add to cart unless....

Back to idea of having different product types and a lot of changes and configuration. So the answer is (don't shoot me), "it depends"!