Forums / All Other Contributions/Addons / Twitch Hidden Searchable Model Number

Twitch Hidden Searchable Model Number

Results 1 to 20 of 38
07 Dec 2013, 21:37
#1
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Twitch Hidden Searchable Model Number

Twitch Hidden Searchable Model Number
for ZenCart v1.51 - Version 13a
December 07.2013

Description:
- This module will add a products_model_spoon input for each product.
- It will be displayed and searchable in admin, searchable on the live site but not displayed there.

Bonus Feature [Optional]:
- Add Hidden Model to Admin->Edit Order
- Search orders by the new field in admin

Related Uses:
Second Model Number, Internal Part Number, UPC Barcode Number, Searchable Size, Stock SKU Number, Manufacturer Model Number.

It wouldn't take much to display the field in other locations in admin/live site... just ask :)
08 Dec 2013, 00:10
#2
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Posts:
3,427
Plugin Contributions:
2

Re: Twitch Hidden Searchable Model Number

twitchtoo:

Twitch Hidden Searchable Model Number
for ZenCart v1.51 - Version 13a
December 07.2013

Description:
- This module will add a products_model_spoon input for each product.
- It will be displayed and searchable in admin, searchable on the live site but not displayed there.
.......


Has it been submitted to the Plugins yet?
08 Dec 2013, 01:12
#3
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Twitch Hidden Searchable Model Number

I've submitted the complete ZC Plugin here:
http://www.zen-cart.com/downloads.php?do=file&id=1794

In the meantime screenshots and the complete package are available on my site.
16 Feb 2014, 17:00
#4
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Posts:
448
Plugin Contributions:
0

Re: Twitch Hidden Searchable Model Number

Hi This looks like a good attribute, can you set part numbers for attributes?

Basically we sell desks depending on size, top, adjustment and feet. We basically need part numbers for every attribute.

Please advise.
16 Feb 2014, 17:24
#5
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Posts:
448
Plugin Contributions:
0

Re: Twitch Hidden Searchable Model Number

Also I just tried to install this plugin and I get A warning message in Catalog > Categories/Products

Warning: an error occured, please refresh the page and try again


Please advise.
16 Feb 2014, 18:18
#6
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Twitch Hidden Searchable Model Number

dharrison:

Hi This looks like a good attribute, can you set part numbers for attributes?

Basically we sell desks depending on size, top, adjustment and feet. We basically need part numbers for every attribute.

Please advise.


Are you using any of the stock by attribute modules?

This plugin only includes a field for products.
16 Feb 2014, 18:20
#7
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Twitch Hidden Searchable Model Number

dharrison:

Also I just tried to install this plugin and I get A warning message in Catalog > Categories/Products



Please advise.


There should be an error log in your /logs folder from the admin to see where it failed to load.
16 Feb 2014, 18:46
#8
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Posts:
448
Plugin Contributions:
0

Re: Twitch Hidden Searchable Model Number

Hi

I'm on XAMPP but I have no error logs. Also I have uninstalled SBA as it was of no use to me.

Can this plugin be used for attributes?
16 Feb 2014, 18:57
#9
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Twitch Hidden Searchable Model Number

dharrison:

Hi

I'm on XAMPP but I have no error logs. Also I have uninstalled SBA as it was of no use to me.

Can this plugin be used for attributes?


Yes the products_model_spoon is not limited to the products, however no one has paid me to add the code to attributes... so it's not on my site priority list under 'current projects' yet.

To make it work for attributes - the product field would need to be added as an input in admin, a display in the attributes controller and a new table in the database beside the attributes.
16 Feb 2014, 18:58
#10
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Twitch Hidden Searchable Model Number

If you have no errors, my guess is the module was not installed correctly or the files were merged incorrectly. That WILL cause the error you're seeing as I have fixed this a number of times for various clients/forum members.
16 Feb 2015, 20:44
#11
gearheadniko avatar

gearheadniko

New Zenner

Join Date:
Oct 2009
Posts:
63
Plugin Contributions:
0

Re: Twitch Hidden Searchable Model Number

Hey Twitch, thanks for the plug in. I know this will do the trick for me, but alas I cannot get it to work. I have gone over you install every file etc. to confirm the code, aside from some code not being at the exact line number all is good, I re-installed again, uploaded the sql patches, still nothing shows.
I am using the following
Ver using: v1.5.4
Template westminster_new
Opps could it be the ver of ZC I am running?
16 Feb 2015, 21:01
#12
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Twitch Hidden Searchable Model Number

gearheadniko:

Hey Twitch, thanks for the plug in. I know this will do the trick for me, but alas I cannot get it to work. I have gone over you install every file etc. to confirm the code, aside from some code not being at the exact line number all is good, I re-installed again, uploaded the sql patches, still nothing shows.
I am using the following
Ver using: v1.5.4
Template westminster_new
Opps could it be the ver of ZC I am running?


I'm just finishing up the updates for 1.54 now... I'll let you know if I find anything soon!
17 Feb 2015, 03:06
#13
gearheadniko avatar

gearheadniko

New Zenner

Join Date:
Oct 2009
Posts:
63
Plugin Contributions:
0

Re: Twitch Hidden Searchable Model Number

I have reinstalled, now when I select Catalog - Categories/Products, I am now able to see the menu with your add in but am getting an error message above it that reads "WARNING: An Error occurred, please refresh the page and try again." and the category is not visible. Nothing changes on a refreash.
17 Feb 2015, 03:28
#14
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Twitch Hidden Searchable Model Number

What does your log file say for admin when you get that error?
19 Feb 2015, 03:26
#15
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Twitch Hidden Searchable Model Number

Twitch Hidden Searchable Model Number for ZC v1.54

Check the forum plugins or my website for your copy.

- This module will add a products_model_spoon input for each product.
- It will be displayed and searchable in admin, searchable on the live site but not displayed there.

Other Uses:

Second Model Number, Internal Part Number, UPC Barcode Number, Searchable Size, Stock SKU Number, Manufacturer Model Number.

What's New:
- Files included are now based on a stock 'vanilla' Zen Cart v1.54 install
- Instructions have been organized, line numbers updated for ZC v1.54

Optional Bonus Feature
- Add Hidden Model to Admin->Edit Order - Admin can see hidden model number while viewing orders
- Add Hidden Model to Admin Product Search

Yes it is compatible with ZC v1.53 - line numbers will be out by 2 - 5 digits.
19 Mar 2015, 10:01
#16
green_books avatar

green_books

New Zenner

Join Date:
Nov 2013
Posts:
44
Plugin Contributions:
0

Re: Twitch Hidden Searchable Model Number

Hi Twitch,

Thanks for your plugin, it is exactly what I need.
Unfortunately, I have the same problem with gearheadniko, that I can't see any products displayed in Categories/Product.


A error occurred: "WARNING: An Error occurred, please refresh the page and try again."
(Before & After)
http://i58.tinypic.com/dlt0ew.jpg

I take a look at my log file, it said:
[19-Mar-2015 17:02:26 Asia/Hong_Kong] PHP Fatal error:  1054:Unknown column 'p.products_model_spoon' in 'field list' :: select p.products_type, p.products_id, pd.products_name, p.products_quantity,                                        p.products_image, p.products_price, p.products_date_added,                                        p.products_last_modified, p.products_date_available,                                        p.products_status, p.products_model, p.products_model_spoon,                                         p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,                                        p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.product_is_always_free_shipping,                                        p.products_quantity_order_max, p.products_sort_order                                 from products p, products_description pd, products_to_categories p2c                                 where p.products_id = pd.products_id                                 and pd.language_id = '1'                                 and p.products_id = p2c.products_id                                 and p2c.categories_id = '23' order by p.products_sort_order, pd.products_name limit 0, 10 in /home/brightenbookscom/public_html/includes/classes/db/mysql/query_factory.php on line 120


Therefore, I went for the php file it mentioned:
/public_html/includes/classes/db/mysql/query_factory.php

Here is line 120, but I don't know how to fix the code.
[PHP]trigger_error($this->error_number . ':' . $this->error_text . ' :: ' . $this->zf_sql, E_USER_ERROR);[/PHP]

Could you please help me to due with this problem?

Thanks,
Eva



----------------------------------------------------------------------------------------------------------------
P.S. Since you may want to know more information, here is line 110~137 in query_factory.php:
[PHP] function show_error() {
if ($this->error_number == 0 && $this->error_text == DB_ERROR_NOT_CONNECTED && !headers_sent() && file_exists('nddbc.html') ) include('nddbc.html');
echo '<div class="systemError">';
if (defined('STRICT_ERROR_REPORTING') && STRICT_ERROR_REPORTING == true)
{
echo $this->error_number . ' ' . $this->error_text;
echo '<br />in:<br />[' . (strstr($this->zf_sql, 'db_cache') ? 'db_cache table' : $this->zf_sql) . ']<br />';
} else {
echo 'WARNING: An Error occurred, please refresh the page and try again.';
}
trigger_error($this->error_number . ':' . $this->error_text . ' :: ' . $this->zf_sql, E_USER_ERROR);
if (defined('IS_ADMIN_FLAG') && IS_ADMIN_FLAG==true) echo 'If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.<br />';
echo '</div>';
}

function Execute($zf_sql, $zf_limit = false, $zf_cache = false, $zf_cachetime=0) {
// bof: collect database queries
if (defined('STORE_DB_TRANSACTIONS') && STORE_DB_TRANSACTIONS=='true') {
global $PHP_SELF, $box_id, $current_page_base;
if (strtoupper(substr($zf_sql,0,6))=='SELECT' /*&& strstr($zf_sql,'products_id')*/) {
$f=@fopen(DIR_FS_SQL_CACHE.'/query_selects_' . $current_page_base . '_' . time() . '.txt','a');
if ($f) {
fwrite($f, "\n\n" . 'I AM HERE ' . $current_page_base . /*zen_get_all_get_params() .*/ "\n" . 'sidebox: ' . $box_id . "\n\n" . "Explain \n" . $zf_sql.";\n\n");
fclose($f);
}
unset($f);
}
}[/PHP]
----------------------------------------------------------------------------------------------------------------
19 Mar 2015, 10:15
#17
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Twitch Hidden Searchable Model Number

1054:Unknown column 'p.products_model_spoon'

This error is related to the php code running an SQL search for products_model_spoon in the products table.

Typically it means you have missed the SQL patch in Admin -> Tools -> Install SQL patches:

ALTER TABLE `products` ADD `products_model_spoon` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `products_model` ;

ALTER TABLE `orders_products` ADD `products_model_spoon` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `products_model` ;

The results of those two SQL scripts will add the products_model_spoon field to the products and orders products table in your database... where the SQL search is looking for the field data.

I'm glad this will work for you... once we get it working :)

Let me know if this works for you.
19 Mar 2015, 10:23
#18
green_books avatar

green_books

New Zenner

Join Date:
Nov 2013
Posts:
44
Plugin Contributions:
0

Re: Twitch Hidden Searchable Model Number

Sorry, I forgot to ask about the SQL thing.

It was sure that your plugin package doesn't included any sql file. But You mentioned this in the "twitch_hs_model_number_16a_for_154.txt", which was the only part I don't understand.

SQL Update - Add the products_model_spoon field to the products table:
ALTER TABLE `products` ADD `products_model_spoon` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `products_model` ;


Is it related to the error anyway?
19 Mar 2015, 10:41
#19
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Twitch Hidden Searchable Model Number

Green Books:

Sorry, I forgot to ask about the SQL thing.

It was sure that your plugin package doesn't included any sql file. But You mentioned this in the "twitch_hs_model_number_16a_for_154.txt", which was the only part I don't understand.


Is it related to the error anyway?


As with all of my other coding instructions, the .sql scripts are included in the install instructions. These install instructions are labelled with their relative version numbers or module names to ensure proper identification of the instruction set. Keeping the .sql within the installation instructions ensures you can see what you are doing if you run an SQL script and the process passes or fails.

They are also a start-to-finish installation guide that provides the exact installation point of the SQL/php code needed for each step of the install process. Great for anyone merging a modified Zen Cart or troubleshooting 'what went wrong' with the ability to step forward and backward through the code in the correct logical order... line by line if needed.
23 Mar 2015, 05:06
#20
green_books avatar

green_books

New Zenner

Join Date:
Nov 2013
Posts:
44
Plugin Contributions:
0

Re: Twitch Hidden Searchable Model Number

Sorry but I really don't understand this. I'm not that familiar in coding.
------------------------------------------------------------------
SQL Update - Add the products_model_spoon field to the products table:
ALTER TABLE `products` ADD `products_model_spoon` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL
AFTER `products_model` ;
------------------------------------------------------------------

1. What do you mean by "products table"? Where can I find it?
2. Which file should I add "`products_model_spoon` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL" in? OR should I simply paste it in the SQL Query Executor and press send?

I'd tried to search "ALTER TABLE" in the Developers Tool Kit, and can only find one file:
/home/brightenbookscom/public_html/administrator/includes/languages/english/sqlpatch.php

Million Thanks!!:smile: