Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / number_of_uploads - Remove?

number_of_uploads - Remove?

Views: 2,328

Results 1 to 6 of 6
18 May 2008, 12:13 AM
#1
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

number_of_uploads - Remove?

I've not seen this before so I must have turned it off somewhere but I can't find where.
When adding something to the cart get this in the URL:

number_of_uploads=0

There are no uploads allowed anywhere so I am puzzled as to where it could have come from.

How do I get rid of this?

1.3.8a + SEO URL's + PHP5

1 Aug 2009, 7:42 AM
#2
sohotech avatar

sohotech

New Zenner

Join Date:
Mar 2008
Posts:
13
Plugin Contributions:
0

Re: number_of_uploads - Remove?

I have edited the includes/modules/attributes.php file to remove the number_of_uploads parameter. hopefully from everywhere but I need a Zen-cart Guru to check I havent done anything that will cause other problems.

Around Line 54 commented out as follows:

// $number_of_uploads = 0;

Around line 458 commented out as follows:

// $number_of_uploads++;

Around line 462 & 463
Commented out

// zen_draw_hidden_field(UPLOAD_PREFIX . $number_of_uploads, $products_options_names->fields['products_options_id']) . "\n" .
// zen_draw_hidden_field(TEXT_PREFIX . UPLOAD_PREFIX . $number_of_uploads, $_SESSION['cart']->contents[$prod_id]['attributes_values'][$products_options_names->fields['products_options_id']]);

Replaced line 462 & 463 with following:

zen_draw_hidden_field( $products_options_names->fields['products_options_id']) . "\n" .
zen_draw_hidden_field( $_SESSION['cart']->contents[$prod_id]['attributes_values'][$products_options_names->fields['products_options_id']]);

Around line 612 613 614 commented out

// $_GET['number_of_uploads'] = $number_of_uploads;
// zen_draw_hidden_field('number_of_uploads', $_GET['number_of_uploads']);
// zen_draw_hidden_field('number_of_uploads', $number_of_uploads);

Any feedback would be appreciated.

6 Apr 2011, 6:15 AM
#3
panservolvo avatar

panservolvo

New Zenner

Join Date:
Sep 2010
Posts:
38
Plugin Contributions:
0

Re: number_of_uploads - Remove?

How did this work out? The number_of_uploads is annoying me too!

15 Sep 2012, 12:06 PM
#4
jaszin avatar

jaszin

New Zenner

Join Date:
Jun 2012
Posts:
1
Plugin Contributions:
0

Re: number_of_uploads - Remove?

Hi.... Any updates for this thread? I have the same problem

20 Jan 2013, 6:19 PM
#5
rony avatar

rony

New Zenner

Join Date:
Aug 2010
Posts:
77
Plugin Contributions:
0

Re: number_of_uploads - Remove?

Count me in. Same problem here.

30 Jan 2014, 5:35 PM
#6
bobthemolder avatar

bobthemolder

Zen Follower

Join Date:
Nov 2008
Posts:
164
Plugin Contributions:
0

Re: number_of_uploads - Remove?

Ran into this today and saw no one had posted a fix. Don't go editing the functions files.

FILE: includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_display.php
Locate:

echo zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product'), 'post', 'enctype="multipart/form-data"') . "\n";

Change to (changes in red):

echo zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('action','number_of_uploads')) . 'action=add_product'), 'post', 'enctype="multipart/form-data"') . "\n";

The change is to add the "number_of_uploads" parameter to the array of parameters excluded when building a URL with the zen_get_all_get_params function. This makes use of the built-in Zen-Cart function that omits parameters when building a URL (in this case, the URL the visitor ends up at after submitting the "add to cart" form), which should keep anything from breaking.

Note that this will disable all file uploads - so only make the change if you don't ever plan on using the uploads feature on any products you sell.

It may also make the 'enctype='"multipart/form-data"' unnecessary, but doesn't seem to affect my site so I've left it in.