If this is your first visit, check our documentation. To post, register or login.
Forums / Setting Up Your Zen Cart Products / Setting Up Categories, Products, Attributes / Warning: Division by zero in attributes_controller.php

Warning: Division by zero in attributes_controller.php

Locked

Started by snicklefritz on 11 May 2010, 6:11 AM · Views: 2,888

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
11 May 2010, 6:11 AM
#1
snicklefritz avatar

snicklefritz

New Zenner

Join Date:
Aug 2009
Posts:
60
Plugin Contributions:
0

Post #1 by snicklefritz

I too am having trouble with making certain products "downloadable". I followed the attributes and download tutorial on the zencart site and then read some of the related posts here.

When I go to the attributes controller and select "patterns", I see two products listed, both of which are eventually supposed to be downloadable. I click on one of the products and then "display" which then directs me to a page that says "preview attributes display for ID #201 Golden Tulip Cowl Pattern". Below that is a radio button that says "download: (o) pdf file", where (o) is the radiobutton.

If I go back to the "attributes controller page", there is a legend, then two lines below that which say:

"Warning: Division by zero in /home/vg002web00/80/04/2000480/web/estore2/admin/attributes_controller.php on line 1006

Warning: Division by zero in /home/vg002web00/80/04/2000480/web/estore2/admin/attributes_controller.php on line 1007"

Then at the bottom of the attributes page it has a thing that says "No Attributes Defined for Product ID#201 - Golden Tulip Cowl Pattern"

How could that be true if the preview did show the correct radiobutton?

When I login as a test user and try to purchase this pattern, I see a comment during checkout that says something about the pdf download which came about only after I added the radio button. However, I never get any message or thing that starts the download.

I have no idea what to do next even after reading some of the tutorials and posts. Any idea what is going wrong?

11 May 2010, 6:54 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #2 by drbyte

Snicklefritz:

"Warning: Division by zero in /home/vg002web00/80/04/2000480/web/estore2/admin/attributes_controller.php on line 1006

Warning: Division by zero in /home/vg002web00/80/04/2000480/web/estore2/admin/attributes_controller.php on line 1007"
Those are a result of you having set the Maximum number of attributes displayed per page to 0.

Admin->Configuration->Maximum Values->Products Attributes - Attributes Controller Display ... set this to something usable, like maybe 20 or 30

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 May 2010, 8:04 AM
#3
snicklefritz avatar

snicklefritz

New Zenner

Join Date:
Aug 2009
Posts:
60
Plugin Contributions:
0

Post #3 by snicklefritz

ok. I went to the location you suggestion and saw that yeah, those things were zero so I changed them.

Is there a way to set myself up as a test customer so I can see how this works without using an actual cc card? I forgot how to do this...

11 May 2010, 11:37 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #4 by drbyte

Snicklefritz:

Is there a way to set myself up as a test customer so I can see how this works without using an actual cc card? I forgot how to do this...

You could turn on the MoneyOrder module temporarily. Remember in this case you'll need to manually update the order's status from Pending to Processing before the downloads will be available to the customer.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 May 2010, 4:50 PM
#5
snicklefritz avatar

snicklefritz

New Zenner

Join Date:
Aug 2009
Posts:
60
Plugin Contributions:
0

Post #5 by snicklefritz

DrByte:

You could turn on the MoneyOrder module temporarily. Remember in this case you'll need to manually update the order's status from Pending to Processing before the downloads will be available to the customer.

Ok I turned on the money order module and placed an "order" for the troublesome product. The order is now listed as "processing", but I don't see anything anywhere about downloading it. When I looked at the order information under "my account", I see the pattern listed there "Golden Tulip Cowl Pattern", with the note "download pdf file" listed below it. Order status appears there as "processing" so I know I set that part correctly.

When I added the item to my cart I did see the radiobutton. Where and how is the download supposed to appear? In the attribute section I remember uploading the pdf file to the download folder so the file is there, but not sure what to do next.

12 May 2010, 1:05 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #6 by drbyte

The download link will show in your My Account area, when viewing the order details. You'll see the filename, and it will be clickable.
If the download has expired, you will see a message about that instead of the filename and link.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

12 May 2010, 2:05 AM
#7
snicklefritz avatar

snicklefritz

New Zenner

Join Date:
Aug 2009
Posts:
60
Plugin Contributions:
0

Post #7 by snicklefritz

DrByte:

The download link will show in your My Account area, when viewing the order details. You'll see the filename, and it will be clickable.
If the download has expired, you will see a message about that instead of the filename and link.

I checked "My Account" and saw the following:

1 ea. Golden Tulip Cowl Pattern

  • Download - PDF file $3.00

below that is a line for sales tax and total.

The line that says "*download - PDF file" isn't clickable and the name of the actual pdf file doesn't appear anywhere, even though I did upload it on the attributes controller or whatever other page it was where zencart asks for that.

I must have something set incorrectly somewhere or perhaps missed a step. Any thoughts on what else I should try to get this to work?

12 May 2010, 3:08 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #8 by drbyte

What are your settings in Admin->Configuration->Attribute Settings?
Which ones have you changed from defaults, and why?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

12 May 2010, 3:26 AM
#9
snicklefritz avatar

snicklefritz

New Zenner

Join Date:
Aug 2009
Posts:
60
Plugin Contributions:
0

Post #9 by snicklefritz

DrByte:

What are your settings in Admin->Configuration->Attribute Settings?
Which ones have you changed from defaults, and why?

enable downloads: true
download by redirect: true
download by streaming: false
download expiration: 2

downloads per product: 1

update status value: 4
status value >= lower value: 2
status Value <= upper value: 4
enable price factor: true
Enable quantity discount: false
enable attribute images: false
enable text pricing by word or letter: true
text pricing spaces are free: 1
read only option type - ignore: 1

12 May 2010, 3:29 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #10 by drbyte

When you click on the order in your Admin side, and click Edit, it shows you the downloadable files on the left side below the order details/pricing/etc. It includes the download count and expiry date. What are those showing?
And then below that is the order-status-history area which records customer comments and admin comments, along with order status level. What's the history showing on this order?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

12 May 2010, 3:55 AM
#11
snicklefritz avatar

snicklefritz

New Zenner

Join Date:
Aug 2009
Posts:
60
Plugin Contributions:
0

Post #11 by snicklefritz

DrByte:

When you click on the order in your Admin side, and click Edit, it shows you the downloadable files on the left side below the order details/pricing/etc. It includes the download count and expiry date. What are those showing?
And then below that is the order-status-history area which records customer comments and admin comments, along with order status level. What's the history showing on this order?

When I go to the order via the admin panel, I don't see anything regarding the download count and expiry date. The status is listed as "processing".

12 May 2010, 4:10 AM
#12
snicklefritz avatar

snicklefritz

New Zenner

Join Date:
Aug 2009
Posts:
60
Plugin Contributions:
0

Post #12 by snicklefritz

Snicklefritz:

When I go to the order via the admin panel, I don't see anything regarding the download count and expiry date. The status is listed as "processing".

I do recall entering the info when I go to the attributes setting page for this particular item. However, after typing in the info for filename, # of downloads, etc, I then click "insert", but when I go back to look at that item, I don't see any indication that it stored anything which is weird since there were no further error messages such as the ones I had earlier (referenced several posts above)

12 May 2010, 4:27 AM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #13 by drbyte

If you delete that attribute and add it back again now, what happens? Does it now store that information? And, does that information now transfer to new orders?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

12 May 2010, 4:57 AM
#14
snicklefritz avatar

snicklefritz

New Zenner

Join Date:
Aug 2009
Posts:
60
Plugin Contributions:
0

Post #14 by snicklefritz

DrByte:

If you delete that attribute and add it back again now, what happens? Does it now store that information? And, does that information now transfer to new orders?

YES!!! It works!!

What was it about erasing and starting over that took care of this? I'd like to make a note of it for future reference. :clap:

thanks so much for your help.

12 May 2010, 3:19 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #15 by drbyte

Probably a result of the problems created previously when you had the Maximum Value set to 0 and were getting errors. I'm guessing it failed to save the data properly when you were making those edits.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.