Hi,
I have to hack VM after every update to work properly, so I tried to contribute on the source code. At this page:
http://virtuemart.net/community/support-the-projectis written:
Help speed up the development of the project by taking care of bug reports at the Feature & Bug Tracker.
with link to:
http://dev.virtuemart.net/login?back_url=http%3A%2F%2Fdev.virtuemart.net%2Fprojects%2Fvirtuemart%2Fissueswhere is login form but I couldn't find where to register. Anybody know where can I register?
I'll describe my hacks / suggestions here:
1) /administrator/components/com_virtuemart/helpers/config.php function vmInfo
Instead of
$app ->enqueueMessage('Info: '.JText::_($publicdescr),'info');
use this line
$app ->enqueueMessage(JText::_($publicdescr),'info');
Why is there string 'Info: ' hardcoded? It happens that messages are showing only with this string. It is useless.
2) /components/com_virtuemart/controllers/cart.php function setpayment
2.1) there is $app variable used in this method, but not defined. Place
$app = JFactory::getApplication();
at the begining of this method.
2.2) at the end of this method there is redirect like this
parent::display();
What it does is that when you change payment method from the cart and save it, it will redirect you to homepage. That means you lost itemId and the whole page can be destroyed. And it does in our case. It is better to use
$app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart'));
3) /components/com_virtuemart/controllers/user.php
There is so many unimportant messages in the user controller. Checkout process is very delicate procedure where we don't want to disturb the customer. Why do we have to tell him things like "User data stored"? What can he possibly take from this message?
3.1) function saveCheckoutUser
instead of
$msg = $this->saveData(true);
we are using
$msg = $this->saveData(true, true);
What it does is that it will automatically register AND LOG IN the user during checkout process. Another big improvement for seamlessness of the checkout process. Of course there is problem when you want to confirm email address before. But if not, why bother customer with login?
3.2) Redirect without message or only if the message is error.
instead of
$this->setRedirect( JRoute::_('index.php?option=com_virtuemart&view=cart&task=checkout',$this->useXHTML,$this->useSSL), $msg );
easy solution is
$this->setRedirect( JRoute::_('index.php?option=com_virtuemart&view=cart&task=checkout',$this->useXHTML,$this->useSSL));
3.3) function saveCartUser
This method does the same thing as saveCheckoutUser, but with different redirect. I don't understand the reason for that. I just call the
$this->saveCheckoutUser();
method again instead of code inside this method.
3.4) function saveData
There is line
$msg = (is_array($ret)) ? $ret['message'] : $ret;
again with useless information for the customer. Should we get rid of it?
Please, let me know if you can use some of these suggestions to the next release and if not, why not.