I have to recommend apsona store manager over easy populate. Just saying.... apsona.com
I have to recommend apsona store manager over easy populate. Just saying.... apsona.com
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
Last edited by bobc; 19 Feb 2014 at 09:17 PM. Reason: typo error
Last edited by bobc; 19 Feb 2014 at 09:34 PM. Reason: missed a word in the last line!
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.
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.
I think it would be better if i UNWIND the mod, and start again from step 1 what do you think?PHP Code:
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'] : '');
}
}
Bob
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.
Hi Delia,
I decided to go back to basics!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>';
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
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!
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.
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
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"!
Bookmarks