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

three small things with vm 2.6.10

Started by slammy, September 13, 2014, 19:40:40 PM

Previous topic - Next topic

slammy

Hello vm-community,

I am since today on Jml 2.5.24 and vm 2.6.10sr, coming from vm 2.6.6 and jml 2.5.22. Three small things I noticed with the new version:

1. the user-adressdata (edited while registration) isn´t included anymore in the email to user and admin. Only the lable displayed there for the JTXT::_('COM_VIRTUEMART_YOUR_ADDRESS') in your choosen language. Taking a look into components/com_virtuemart/views/user/tmpl/mail_html_reguser I found this

    foreach ($this->userFields['fields'] as $userField) {
if (!empty($userField['value']) && $userField['type'] != 'delimiter' && $userField['type'] != 'BT' && $userField['type'] != 'hidden') {
    echo $userField['title'] . ': ' . $userField['value'] . $li;

}
    }


what looks absolut ok for me. I don´t get whats wrong here ...


2. if you like to see the latest-products-module on your FrontPage you will notice that the choosen products are static now, therefore I used to replace this code in /administrator/components/com_virtuemart/models/product.php

case 'latest':
$date = JFactory::getDate (time () - (60 * 60 * 24 * $latest_products_days));
$dateSql = $date->toMySQL ();
//$where[] = 'p.`' . $latest_products_orderBy . '` > "' . $dateSql . '" ';
$orderBy = 'ORDER BY p.`' . $latest_products_orderBy . '`';
$this->filter_order_Dir = 'DESC';
break;


with this RAND()-code

        case 'latest':
                                                $date = JFactory::getDate (time () - (60 * 60 * 24 * $latest_products_days));
                                                $dateSql = $date->toMySQL ();
                                                $where[] = 'p.`' . $latest_products_orderBy . '` > "' . $dateSql . '" ';
                                                //$orderBy = 'ORDER BY p.`' . $latest_products_orderBy . '`';
                                                $orderBy = 'ORDER BY RAND() ';

$this->filter_order_Dir = 'DESC';
                                                break;



3. this issue is still present: http://forum.virtuemart.net/index.php?topic=125572.0
greetings jens


daanvanberkel

Is there already a solution for the first problem you are writing about? Because I have the same problem and I would like to fix it.

slammy

Hi, I noticed more threads concerning user data fields, for example here http://forum.virtuemart.net/index.php?topic=125708.0
i don't have a solution yet but will post when find one. Or anyone else knows? Regards jens

seyi

Ok, here is how I solved it.

in www/components/com_virtuemart/views/user/view.html.php, around line 423 is this:
<?php
$this->userFields $userFieldsModel->getUserFieldsFilled($userFields$this->user);
?>


I changed it to this:
<?php
//$this->userFields = $userFieldsModel->getUserFieldsFilled($userFields, $this->user);
# seyi_code
$usermodel VmModel::getModel('user');
$vmuser $usermodel->getUser();
$vmuser current($vmuser->userInfo);
$this->userFields $userFieldsModel->getUserFieldsFilled($userFields$vmuser);
}

?>


This can be added into the mail template file itself so it cannot be overriden on updates, but figured this is something that will be fixed anyway so should not really need that.
Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

Milbo

Quote from: slammy on September 13, 2014, 19:40:40 PM
2. if you like to see the latest-products-module on your FrontPage you will notice that the choosen products are static now, therefore I used to replace this code in /administrator/components/com_virtuemart/models/product.php

case 'latest':
$date = JFactory::getDate (time () - (60 * 60 * 24 * $latest_products_days));
$dateSql = $date->toMySQL ();
//$where[] = 'p.`' . $latest_products_orderBy . '` > "' . $dateSql . '" ';
$orderBy = 'ORDER BY p.`' . $latest_products_orderBy . '`';
$this->filter_order_Dir = 'DESC';
break;


with this RAND()-code

        case 'latest':
                                                $date = JFactory::getDate (time () - (60 * 60 * 24 * $latest_products_days));
                                                $dateSql = $date->toMySQL ();
                                                $where[] = 'p.`' . $latest_products_orderBy . '` > "' . $dateSql . '" ';
                                                //$orderBy = 'ORDER BY p.`' . $latest_products_orderBy . '`';
                                                $orderBy = 'ORDER BY RAND() ';

$this->filter_order_Dir = 'DESC';
                                                break;



We have now just


$orderBy = 'ORDER BY p.`' . $latest_products_orderBy . '`';
$this->filter_order_Dir = 'DESC';


The shuffle is a good idea, but I fear we must do it with the result.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

Thank you Seyi,

I take your suggestion, sounds good. Thx.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

seyi

Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

al1

Hi seyi,
Thanks for sharing, i've tried your solution but it seems that the adressdata in the email isn't the userdata but the admindata... do you have the same issue ?

Don't know if it helps but i saw the problem before the update when i change only the security part's code in" /administrator/components/com_virtuemart/models/user.php "

Replace if (!$user->bind($data)) { with

if(!$user->authorise('core.admin','com_virtuemart')){
   $whiteDataToBind = array();
   $whiteDataToBind['name'] = $data['name'];
   $whiteDataToBind['username'] = $data['username'];
   $whiteDataToBind['email'] = $data['email'];
   if(isset($data['password'])) $whiteDataToBind['password'] = $data['password'];
   if(isset($data['password2'])) $whiteDataToBind['password2'] = $data['password2'];
   } else {
      $whiteDataToBind = $data;
   }
// Bind Joomla userdata
if (!$user->bind($whiteDataToBind)) {


That's the change that made the adress disappears.


Milbo

The solution was wrong, because a user is not allowed to take the data of another user. But it looks like we found the fix.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

antonino78

Hello Milbo,
please you can have the file with the fix?

Milbo

Is in the svn, will be released soon.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/