News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Can't edit products

Started by cmatte, December 23, 2011, 14:29:36 PM

Previous topic - Next topic

cmatte

Hi.
I had already and succesfully developed a shop with vm 1.x.
Now I am trying to develop a new online shop based on J!1.7.3 and the new beast Vm 2.0.0.
Server is aruba.it with Php 5.3.8 with out_buffering_off option, linux of course.   
I've correctly installed j!, vm and aio and the shop is up and running, the new interface is very clean and satisfactional!
The problem is I always get the error:
Fatal error: Call to a member function getProduct() on a non-object in /web/htdocs/www.mywebsite.it/home/negozio/components/com_virtuemart/views/productdetails/view.html.php on line 78
when I try to edit every (sample) product from the frontend.
The edit from the admin page works.
Checking out line 78 I see an empty line and there is only a call to that function at $product = $product_model->getProduct($virtuemart_product_id); in line 155.
Seems like I'm unable to troubleshoot the problem more than this right now :-\
Ideas?



Studio 42

#1
replace line 69
$product_model = $this->getModel('product');
by
if (!class_exists('VirtueMartModelProduct')) require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'product.php');
$productModel = new VirtueMartModelProduct();

must solve this
We had many trouble with joomla function getmodel() and swaped to this method in the code give always syccesfull result

Oups right syntax is
if (!class_exists('VirtueMartModelProduct')) require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'product.php');
$product_model = new VirtueMartModelProduct();

:)

cmatte

#2
That code here was at line 155, do you think this is normal? I see my code has a blank line every line.
Anyway, doing that modification made another error appear:
Fatal error: Call to a member function allowReview() on a non-object in /web/htdocs/www.mywebsite.it/home/negozio/components/com_virtuemart/views/productdetails/view.html.php on line 334
:-\
Another fact I notice is the edit button hasn't any image, but of course this is a minor problem :)
Btw, do you think I should select php 5.3.8 or php 5.2.17 for this combination of J! 1.7.3 and vm 2.?
--edit1--
Sorry I made confusion while testing.
I see using php 5.2.17 with or without your mod, makes a 500 internal server error appear. 5.3.8 gives the fatal error.

dontflinch

Quote from: Electrocity on December 23, 2011, 21:39:29 PM
replace line 69
$product_model = $this->getModel('product');
by
if (!class_exists('VirtueMartModelProduct')) require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'product.php');
$productModel = new VirtueMartModelProduct();

must solve this
We had many trouble with joomla function getmodel() and swaped to this method in the code give always syccesfull result

Oups right syntax is
if (!class_exists('VirtueMartModelProduct')) require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'product.php');
$product_model = new VirtueMartModelProduct();

:)

hi again,

I am having this problem too.  minor compared to the cart issue but still there.

I tried to make the mod that electrocity suggested but then I get a similar error about allowReview 'on line 334'.

Studio 42

after
   // Load the category
replace the line 125
$category_model = $this->getModel('category');
by
if (!class_exists('VirtueMartModelCategory')) require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'category.php');
$category_model = new VirtueMartModelCategory();


and

$ratingModel = $this->getModel('ratings');
by
if (!class_exists('VirtueMartModelRatings')) require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'ratings.php');
$ratingModel = new VirtueMartModelRatings();


Is i said getModel() is a joomla core function but does not work time to time.
We modify it in next release...

cmatte

#5
This hasn't worked here.
Fatal error: Call to a member function getProduct() on a non-object in components/com_virtuemart/views/productdetails/view.html.php on line 78

Rabble

I have this problem too.  No image on the Edit Product button and the following error: Fatal error: Call to a member function getProduct() on a non-object in /components/com_virtuemart/views/productdetails/view.html.php on line 78

My Add to Cart button doesn't work either, and JQuery is only loading once on the page.  :/

Running VM 2.0 on Joomla 1.7.3 with PHP 5.3.5.

mangotti

I as well was experiencing this problem. I made the three edits to view.html.php and the errors are gone. However, when I click to edit, the page is just blank. Please advise as this is a very frustrating situation.

cmatte

There's still something more to do before making front end admin functions available. Only back end edit can be used atm.

mangotti

Thanks, Cmatte. Where di you obtain this information? Do you know what the roadmap is for this?


John2400

Fatal error: Class 'VirtuemartControllerProduct' not found in /home/*******/public_html/components/com_virtuemart/virtuemart.php on line 91

From the front end login I get this message when I try to edit any image or try to resize a product By clcicking on the edit buttin + - 16 or edit info.

* I can do this from the back end - this is jsut to let some one know -
1.7.5 - VM 2.0.1 f