VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Tonda24 on June 20, 2019, 10:39:09 AM

Title: List of all shoppers who bought the product in product detail
Post by: Tonda24 on June 20, 2019, 10:39:09 AM
Hello,
List of all shoppers who bought the product in product detail works only with "shipped" status. I cannot change another status or enter all statuses. If I need to find out which order is blocking the goods, I have no chance.
Thanks a lot.
Title: Re: List of all shoppers who bought the product in product detail
Post by: Jörgen on June 20, 2019, 10:51:15 AM
This work as expected since Years.

You give to little info, You have probably an old VM version or restricted access, only You can know that.

What VM version and Joomla version ?

Old install, update, has it ever worked etc ...

Jörgen @ Kreativ Fotografi
Title: Re: List of all shoppers who bought the product in product detail
Post by: Tonda24 on June 20, 2019, 12:37:42 PM
Hello,
thanks for your reply.

VirtueMart 3.4.5 10045
Joomla! 3.9.6
Title: Re: List of all shoppers who bought the product in product detail
Post by: Jörgen on June 20, 2019, 13:05:08 PM
Then please show an example with good screenshots. Because this is workning in a plain vanilla install.

Jörgen @ Kreativ Fotografi
Title: Re: List of all shoppers who bought the product in product detail
Post by: StefanSTS on June 20, 2019, 13:10:02 PM
The problem is, that regardless of the Status of the product (or the order), the status is always shown as Shipped in 3.4.2.

That looks like a bug in that VM version.

EDIT: No, all is good, the product had the status shipped, different from the order status, see below.
Title: Re: List of all shoppers who bought the product in product detail
Post by: Jörgen on June 20, 2019, 13:34:32 PM
Seems to be working with VM 3.4.2.10057

Make sure You untick (Select some options X). This is annoying though.

Jörgen @ Kreativ Fotografi
Title: Re: List of all shoppers who bought the product in product detail
Post by: StefanSTS on June 20, 2019, 14:49:53 PM
In VM 3.6.0.10075 that is working fine with a filter for the status.

Title: Re: List of all shoppers who bought the product in product detail
Post by: Tonda24 on June 20, 2019, 15:00:45 PM
This issue was also a problem with previous versions of VM. I don't have the VM version 3.6.0.10075.
Title: Re: List of all shoppers who bought the product in product detail
Post by: Jörgen on June 20, 2019, 15:05:31 PM
What is Your Issue? I can confirm that this work also on 3.2.12. and VM 3.4.2.10057

When stopped this working ? What VM version had this issue ?

The only thing that is annoying is that You get nothing when (Select some options X) is chosen together with other statuses.

Jörgen @ Kreativ Fotografi
Title: Re: List of all shoppers who bought the product in product detail
Post by: StefanSTS on June 20, 2019, 15:09:07 PM
The latest version will be available here in some time: http://dev.virtuemart.net/projects/virtuemart/files

Maybe the available 10063 got that solved.
Or you go to the SVN and pull the latest files: http://dev.virtuemart.net/projects/virtuemart/files

Title: Re: List of all shoppers who bought the product in product detail
Post by: Jörgen on June 20, 2019, 15:24:40 PM
3.4.5.10057 has it working.
3.2.12 has it working, when was it ever an issue ?

Jörgen @ Kreativ Fotografi
Title: Re: List of all shoppers who bought the product in product detail
Post by: StefanSTS on June 20, 2019, 15:40:55 PM
I thought it was an issue in 3.4.2.

Looking at it closer, the orders in my case are all Status C confirmed, but the products are with status shipped because of the download plugin I guess.
I never used it before so I didn't know that the status of the product was different compared to the order status.

So actually the list seems doing exactly what is should do.

@Tonda, you might want to check your browser console for errors when you try to add or change a status.
Title: Re: List of all shoppers who bought the product in product detail
Post by: Jörgen on June 20, 2019, 15:52:17 PM
Ok, that is probably cleared now.
the only issue I see is when You choose all options you also get the option (Select some options X) is also chosen. Unless you untick this you will get no search results. The revenue report gives you search results with this chosen.

Jörgen @ Kreativ Fotografi
Title: Re: List of all shoppers who bought the product in product detail
Post by: StefanSTS on June 20, 2019, 16:47:24 PM
The list is generated in orderstatus model:

array_unshift adds the empty option to the selection.
Might be a good idea to have another variable like $empty_option in the function:
function renderOSList($value,$name = 'order_status',$multiple=FALSE,$attrs='',$langkey='',$empty_option='yes/no')

There might be a way to ask chosen not to show the empty option.


function renderOSList($value,$name = 'order_status',$multiple=FALSE,$attrs='',$langkey=''){

$idA = $id = $name;
$attrs .= ' class="inputbox" ';
if ($multiple) {
$attrs .= ' multiple="multiple" ';
if(empty($langkey)) $langkey = 'COM_VIRTUEMART_DRDOWN_SELECT_SOME_OPTIONS';
$attrs .=  ' data-placeholder="'.vmText::_($langkey).'"';
$idA .= '[]';
} else {
if(empty($langkey)) $langkey = 'COM_VIRTUEMART_LIST_EMPTY_OPTION';
}

if(is_array($value)){
$hashValue = implode($value);
} else {
$hashValue = $value;
}

$hash = md5($hashValue.$name.$attrs);
if (!isset($this->_renderStatusList[$hash])) {
$orderStates = $this->getOrderStatusNames();
$emptyOption = JHtml::_ ('select.option', -1, vmText::_ ($langkey), 'order_status_code', 'order_status_name');
array_unshift ($orderStates, $emptyOption);
if ($multiple) {
$attrs .=' size="'.count($orderStates).'" ';
}

$this->_renderStatusList[$hash] = JHtml::_('select.genericlist', $orderStates, $idA, $attrs, 'order_status_code', 'order_status_name', $value,$id,true);
}
return $this->_renderStatusList[$hash] ;
}
Title: Re: List of all shoppers who bought the product in product detail
Post by: StefanSTS on June 20, 2019, 18:15:57 PM
I changed the function in models orderstatus.php to


function renderOSList($value,$name = 'order_status',$multiple=FALSE,$attrs='',$langkey='',$empty_opt='TRUE'){

$idA = $id = $name;
$attrs .= ' class="inputbox" ';
if ($multiple) {
$attrs .= ' multiple="multiple" ';
if(empty($langkey)) $langkey = 'COM_VIRTUEMART_DRDOWN_SELECT_SOME_OPTIONS';
$attrs .=  ' data-placeholder="'.vmText::_($langkey).'"';
$idA .= '[]';
} else {
if(empty($langkey)) $langkey = 'COM_VIRTUEMART_LIST_EMPTY_OPTION';
}

if(is_array($value)){
$hashValue = implode($value);
} else {
$hashValue = $value;
}

$hash = md5($hashValue.$name.$attrs);
if (!isset($this->_renderStatusList[$hash])) {
$orderStates = $this->getOrderStatusNames();
if ($empty_opt) {
$emptyOption = JHtml::_ ('select.option', -1, vmText::_ ($langkey), 'order_status_code', 'order_status_name');
array_unshift ($orderStates, $emptyOption);
}
if ($multiple) {
$attrs .=' size="'.count($orderStates).'" ';
}

$this->_renderStatusList[$hash] = JHtml::_('select.genericlist', $orderStates, $idA, $attrs, 'order_status_code', 'order_status_name', $value,$id,true);
}
return $this->_renderStatusList[$hash] ;
}


and in view.html.php of administrator view product I changed line 197 to:


    $lists['OrderStatus'] = $orderstatusModel->renderOSList($order_status,'order_status',TRUE,'','',FALSE);


Works for me. Please test if it bothers you.
Title: Re: List of all shoppers who bought the product in product detail
Post by: Milbo on June 21, 2019, 10:44:00 AM
Is added, but a bit different.

It works, but there is "of course" no update of the list, when you select no order status, which is imho good.
Title: Re: List of all shoppers who bought the product in product detail
Post by: Jörgen on June 21, 2019, 11:21:04 AM
Thank You, was a little confusing.

Jörgen @ Kreativ Fotografi