VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: jlbarkas on September 24, 2012, 18:47:32 PM

Title: CustomFields with Stocks no recalculate as expected
Post by: jlbarkas on September 24, 2012, 18:47:32 PM
Hi all.

I am working with virtuemart2 (and joomla 1.5);  when I add a custom field that controls the stock, the frontend virtuemart does not behave as expected. The ajax call recalculate gives me the error in the response (you can see this with firebug):

Fatal error:  Call to undefined method JDocumentRAW::setName() in /components/com_virtuemart/controllers/productdetails.php on line 305.

You can see this problem in http://www.beluckykids.com/virtuemart.html?view=productdetails&virtuemart_category_id=1&virtuemart_product_id=6


There is two sizes: 4/5 and 6 (4/5 have stock, 6 no). The prices are the same.

I'm desperate for a solution to this error. Could someone give a hand with this? Thanks!
Title: Re: CustomFields with Stocks no recalculate as expected
Post by: bytelord on September 24, 2012, 18:53:06 PM
Hello,

Could you try with the default vm theme with no overrides? I use firebug but did not take an error, just huge time to execute js. So try it with the default theme and report your results back. Also you are loading a lot of javascript, if is working with default themes/templates then you should ask your template provider also.

Regards
Title: Re: CustomFields with Stocks no recalculate as expected
Post by: razor7 on December 10, 2012, 16:45:08 PM
Hi, this happens on j15 (1.5.26 in my case) only. To fix it, just add setName and getNAme methods to class JDocument, edit file libaries/joomla/document/document.php, and add the following code after line 678

    /**
     * Set the document name
     * @access public
     * @param string $name
     */
    public function setName($name) {
        $this->name = $name;
    }

    /**
     * Get the document name
     * @access public
     * @return string
     */
    public function getName() {
        return $this->name;
    }
Title: Re: CustomFields with Stocks no recalculate as expected
Post by: bytelord on December 10, 2012, 16:54:51 PM
Hello,

May be this have to do with your custom template that uses joomla 2.5 jdocument classes ... not sure. You could search your code to see when jdocument is called instead of jelement or japplication may be...
But you solve it :)

Regards
Title: Re: CustomFields with Stocks no recalculate as expected
Post by: jlbarkas on January 17, 2013, 17:54:53 PM
Quote from: razor7 on December 10, 2012, 16:45:08 PM
Hi, this happens on j15 (1.5.26 in my case) only. To fix it, just add setName and getNAme methods to class JDocument, edit file libaries/joomla/document/document.php, and add the following code after line 678

    /**
     * Set the document name
     * @access public
     * @param string $name
     */
    public function setName($name) {
        $this->name = $name;
    }

    /**
     * Get the document name
     * @access public
     * @return string
     */
    public function getName() {
        return $this->name;
    }



Thank you very much! This solve my problem!