Jump to content

Recommended Posts

  • 2 weeks later...

Hi hollandtextiles,

 

Are you want like that if i select "ipod" then it will be return all orders which have "ipod" word in product name ?

Ok... I will do it :)

 

My skype id is ittu.serk

Please let me know your email id or skype id so i will be communicate with you easily

Share this post


Link to post
Share on other sites

thanks for your module

 

Do you would know say me code to add for sort by genders in "Orders" replacing it for the code of sort by "customers new"  ??

I think it would be replacing around line 74 in AdminOrdersController.php:

'new' => array(
'title' => $this->l('New'),
'width' => 25,
'align' => 'center',
'type' => 'bool',
'tmpTableFilter' => true,
'icon' => array(
0 => 'blank.gif',
1 => array(
'src' => 'note.png',
'alt' => $this->l('First customer order'),
)
),
'orderby' => false

If I change that code for this then it don´t work:

 

'id_gender' => array(
'title' => $this->l('Title'),
'width' => 70,
'align' => 'center',
'icon' => $genders_icon,
'orderby' => false,
'type' => 'select',
'list' => $genders,
'filter_key' => 'a!id_gender',
),

Best regards

Edited by seog (see edit history)

Share this post


Link to post
Share on other sites

Hi hollandtextiles,

 

Can you share your admin detail then i will check it ?

Because i test it and it is working on multishop. Have you pressed enter after select product ?

Share this post


Link to post
Share on other sites

Hi seog,

 

Please edit your AdminOrdersController.php

replace $this->select value with this query

 

$this->_select = '
a.id_currency,c.id_gender,
a.id_order AS id_pdf,
CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`,
osl.`name` AS `osname`,
os.`color`,
IF((SELECT COUNT(so.id_order) FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new';
 
$this->_join = '
LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`)
LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`)
LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)$this->context->language->id.')';
$this->_orderBy = 'id_order';
$this->_orderWay = 'DESC';
 
after this put this code 
 
$genders = array();
$genders_icon = array();
$genders_icon[] = array('src' => '../genders/Unknown.jpg', 'alt' => '');
foreach (Gender::getGenders() as $gender)
{
$gender_file = 'genders/'.$gender->id.'.jpg';
if (file_exists(_PS_IMG_DIR_.$gender_file))
$genders_icon[$gender->id] = array('src' => '../'.$gender_file, 'alt' => $gender->name);
else
$genders_icon[$gender->id] = array('src' => '../genders/Unknown.jpg', 'alt' => $gender->name);
$genders[$gender->id] = $gender->name;
}
 
 
Add this value in $this->fields_list
 
'id_gender' => array(
'title' => $this->l('Title'),
'width' => 70,
'align' => 'center',
'icon' => $genders_icon,
'orderby' => false,
'type' => 'select',
'list' => $genders,
'filter_key' => 'c!id_gender',
),

 

 

then your problem will be solved :)

Sky id ittu.serk

Edited by Ittu (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Please don't upload this my module on addon with your name. I am just helping you so make this module free. I see that someone edited my module and upload on addon :( Its not fair

Share this post


Link to post
Share on other sites

Please don't upload this my module on addon with your name. I am just helping you so make this module free. I see that someone edited my module and upload on addon :( Its not fair

definitely, 

if I were you I'd report it to PS team.

Share this post


Link to post
Share on other sites

Hi seog,

 

Please edit your AdminOrdersController.php

replace $this->select value with this query

 

$this->_select = '
a.id_currency,c.id_gender,
a.id_order AS id_pdf,
CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`,
osl.`name` AS `osname`,
os.`color`,
IF((SELECT COUNT(so.id_order) FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new';
 
$this->_join = '
LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`)
LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`)
LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)$this->context->language->id.')';
$this->_orderBy = 'id_order';
$this->_orderWay = 'DESC';
 
after this put this code 
 
$genders = array();
$genders_icon = array();
$genders_icon[] = array('src' => '../genders/Unknown.jpg', 'alt' => '');
foreach (Gender::getGenders() as $gender)
{
$gender_file = 'genders/'.$gender->id.'.jpg';
if (file_exists(_PS_IMG_DIR_.$gender_file))
$genders_icon[$gender->id] = array('src' => '../'.$gender_file, 'alt' => $gender->name);
else
$genders_icon[$gender->id] = array('src' => '../genders/Unknown.jpg', 'alt' => $gender->name);
$genders[$gender->id] = $gender->name;
}
 
 
Add this value in $this->fields_list
 
'id_gender' => array(
'title' => $this->l('Title'),
'width' => 70,
'align' => 'center',
'icon' => $genders_icon,
'orderby' => false,
'type' => 'select',
'list' => $genders,
'filter_key' => 'c!id_gender',
),

 

 

then your problem will be solved :)

Sky id ittu.serk

 

Hi lttu

 

This works !!  You are a great programmer

 

Now we can make gifts according to gender

 

Best regards and thank you very much

Share this post


Link to post
Share on other sites

Hi lttu

 

This works !!  You are a great programmer

 

Now we can make gifts according to gender

 

Best regards and thank you very much

Welcome :)

If you have any requirement or help then add me on skype. I will be solve your problem :)

Share this post


Link to post
Share on other sites
  • 2 years later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More