Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / General Questions / error when adding product to cart

error when adding product to cart

Locked

Started by mazzifer on 13 May 2006, 5:38 PM · Views: 3,684

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
13 May 2006, 5:38 PM
#1
mazzifer avatar

mazzifer

New Zenner

Join Date:
Feb 2006
Posts:
22
Plugin Contributions:
0

error when adding product to cart

I'm getting this error when adding a cart to the shopping cart:

Fatal error: Call to undefined function: actionaddproduct() in /home/smilingcross/www/www.smilingcross.com/zc/includes/main_cart_actions.php on line 36

the URL is http://www.smilingcross.com/zc/index.php?main_page=product_info&products_id=3&action=add_product

I guess the function actionaddproduct() is misnamed or is missing? In the main_cart_actions page there is a call to a function called actionAddProduct($goto, $parameters).

I have version 1.3 and this hasn't always been broken. I know some php so if I can just get pointed to the file that has this function I might be able to figure it out.

Can anyone help? Thanks!

13 May 2006, 5:44 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: error when adding product to cart

Go to the Admin ... Tools ... Developer's Tool Kit ...

In the bottom input box, type in: actionaddproduct

Select Catalog from the dropdown and click Search ...

What comes up for these?

What kind of server are you on, unix or windows?

Was this a clean install or an upgrade?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

15 May 2006, 4:32 PM
#3
mazzifer avatar

mazzifer

New Zenner

Join Date:
Feb 2006
Posts:
22
Plugin Contributions:
0

Re: error when adding product to cart

this is what comes up
/home/smilingcross/www/www.smilingcross.com/zc/includes/main_cart_actions.php

Line #0 : <?php /** * Main shopping Cart actions supported. * * The main cart actions supported by the current shoppingCart class. * This can be added to externally using the extra_cart_actions directory. * * @package initSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: main_cart_actions.php 3066 2006-02-25 22:14:00Z wilt $ */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } /** * include the list of extra cart action files (*.php in the extra_cart_actions folder) */ if ($za_dir = @dir(DIR_WS_INCLUDES . 'extra_cart_actions')) { while ($zv_file = $za_dir->read()) { if (preg_match('/\.php$/', $zv_file) > 0) { /** * get user/contribution defined cart actions */ include(DIR_WS_INCLUDES . 'extra_cart_actions/' . $zv_file); } } } switch ($_GET['action']) { /** * customer wants to update the product quantity in their shopping cart * delete checkbox or 0 quantity removes from cart */ case 'update_product' : $_SESSION['cart']->actionUpdateProduct($goto, $parameters); break; /** * customer adds a product from the products page */ case 'add_product' : $_SESSION['cart']->actionAddProduct($goto, $parameters); break; case 'buy_now' : /** * performed by the 'buy now' button in product listings and review page */ $_SESSION['cart']->actionBuyNow($goto, $parameters); break; case 'multiple_products_add_product' : /** * performed by the multiple-add-products button */ $_SESSION['cart']->actionMultipleAddProduct($goto, $parameters); break; case 'notify' : $_SESSION['cart']->actionNotify($goto, $parameters); break; case 'notify_remove' : $_SESSION['cart']->actionNotifyRemove($goto, $parameters); break; case 'cust_order' : $_SESSION['cart']->actionCustomerOrder($goto, $parameters); break; case 'remove_product' : $_SESSION['cart']->actionRemoveProduct($goto, $parameters); break; case 'cart' : $_SESSION['cart']->actionCartUserAction($goto, $parameters); break; } ?>

this was an upgrade. this error didn't show up at the same time as the upgrade however. it was working at first. haven't customized this page at all yet.

linux OS, apache 2.0

15 May 2006, 7:07 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: error when adding product to cart

Reload the file:
/includes/main_cart_actions.php

From your clean download of Zen Cart v1.3.0.1 ... looks like a bad upload ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

15 May 2006, 7:59 PM
#5
mazzifer avatar

mazzifer

New Zenner

Join Date:
Feb 2006
Posts:
22
Plugin Contributions:
0

Re: error when adding product to cart

tried it. got the same error.

16 May 2006, 12:01 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: error when adding product to cart

What are you using to edit files with?

How about to load the files to your site?

It looks like either you are editing your files with CPanel or something similar or you are loading files and getting bad uploads so the files are getting trashed ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

16 May 2006, 1:12 AM
#7
mazzifer avatar

mazzifer

New Zenner

Join Date:
Feb 2006
Posts:
22
Plugin Contributions:
0

Re: error when adding product to cart

I use Dreamweaver. I use Dreamweaver a lot, for a dozen other sites. No other problems. Is there another file besides main_cart_actions.php which may be corrupt?

16 May 2006, 1:35 AM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: error when adding product to cart

Do you have something like Beyond Compare that you can do an FTP compare of a clean checkout to your site and see what files Dreamweaver may have corrupted? Or what files did not upload correctly?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

16 May 2006, 2:24 AM
#9
mazzifer avatar

mazzifer

New Zenner

Join Date:
Feb 2006
Posts:
22
Plugin Contributions:
0

Re: error when adding product to cart

I found it! It was the classes/shopping_cart.php file that was off. Just uploaded a fresh one and all is good. Thanks a lot.

16 May 2006, 2:35 AM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: error when adding product to cart

Thanks for the update ... that will be of help to others with similar problems ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Jun 2006, 3:36 AM
#11
viss avatar

viss

New Zenner

Join Date:
Jun 2006
Posts:
38
Plugin Contributions:
0

Re: error when adding product to cart

Hi Guys,

Im it the throws of converting from cubecart :yuck: to ZenCart, Ive just done a clean install of the latest version and the only mod I have installed is the dual price v1.5. Ive added a product and given it some attributes but when I add it to the cart I get the same error as above.

Fatal error: Call to undefined function: actionaddproduct() in /var/www/html/zencart/includes/main_cart_actions.php on line 42

Ive tried repacing classes/shopping_cart.php with the one that comes with DP v1.5 but it still does the same thing, can any one tell me if there is an issue with this mod that is causing this.

Cheers Richard.

Ohh and PS: Where has ZC been all my life. :thumbsup:

21 Jun 2006, 3:46 AM
#12
viss avatar

viss

New Zenner

Join Date:
Jun 2006
Posts:
38
Plugin Contributions:
0

Re: error when adding product to cart

Umm im a little embarest :blush: I had the wrong version. lol

I will be back :D

6 Sep 2006, 3:18 AM
#13
tinas avatar

tinas

Totally Zenned

Join Date:
Jan 2005
Location:
Lake Havasu, AZ
Posts:
1,090
Plugin Contributions:
0

Re: error when adding product to cart

I am indeed having this problem as described above with the dual pricing mod and version 1.3.5.

That mod does not appeaar to be working properly with the latest version.

Has anyone gotten it working ?

When the world gets in my face I say Have A Nice Day.