Jump to content

I need to add filters to webservice


gusman126
 Share

Recommended Posts

I need to add filters to webservice
I need to make some modifications in the prestashop webservice
When I read the products, I don't have the option to filter by update date and added date
How can I add this filter?
I have learned to add the field to show the date, the "controller" product must be changed, but I cannot find how to add a date_upd filter

Share this post


Link to post
Share on other sites

Resolved :

Need change lib file 

public function get($options){
..............
if (count($url_params) > 0) {
$url .= '?' . http_build_query($url_params);
}

//add 
if($options['date'] == '1'){
	$url .= '&date=1';
}

}

Create order webservice :

$hoy = date('Y-m-d');
			$opt = array(
				'resource' => 'products',
				'date' => '1',
				'display' => 'full',
				
				'filter[date_upd]' => '>['.$hoy.']',
				
				
			);

IMPORTANT! SIMBOL ">" FOR greater than date or "<" smaller than

Dates = array

 

Webservice full of bugs!!!

 

Edited by gusman126 (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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