Page 1 of 1

USD Price is not coming in the product listing and detail.

Posted: 19 Mar 2018, 08:16
by Anshul Dua
Hi Team,

I am doing through the JSONAPI, But I am not getting the USD price of product in the product listing API. BUT EUR is coming. Even i included the price in the URL.

jsonapi/product?filter[f_attrid][]=18&include=media,price,text

I am getting the media and text. But not the price

Re: Price is not coming in the product listing and detail pa

Posted: 19 Mar 2018, 08:22
by aimeos
Most of the time, the currency of the prices you've added in the admin interface doesn't match the currency of your locale. Have a look into the locale panel of the admin interface to see what is the first combination of site/language/currency that is used if you are not adding this information to the routes and URLs

Re: USD Price is not coming in the product listing and detai

Posted: 20 Mar 2018, 07:00
by Anshul Dua
Thanks this is working.

Can you tell me how to add the product into a particular customer basket.

```http://localhost/jsonapi/basket?id=defa ... es][id][12]```
I am using this and getting the response

```
{
"errors": [
{
"title": "Not allowed for this resource"
}
]
}
```

Re: USD Price is not coming in the product listing and detai

Posted: 20 Mar 2018, 16:28
by aimeos
Have you read this section in the docs?
https://aimeos.org/docs/Developers/Clie ... d_products

Re: USD Price is not coming in the product listing and detai

Posted: 21 Mar 2018, 04:33
by Anshul Dua
Yes, I read that. Even i am trying to add the product into baseket. Not able to add the product into the baseket.
Can you plesae help me through URL how can i add?

Re: USD Price is not coming in the product listing and detai

Posted: 22 Mar 2018, 08:12
by aimeos
The important thing is that you take the URL from the products:

Code: Select all

    "data": [{
        "id": "1",
        "type": "product",
        "links": {
            "basket\/product": {
                "href": "http://localhost/default/jsonapi/basket?id=default&related=product",
                "allow": ["POST"]
            }
        },
The link (http://localhost/default/jsonapi/basket ... ed=product) might be different in your response. You need to take that and use a POST request to POST this data to the JSON API:

Code: Select all

var data = {data: [{
    attributes: {
        "product.id": response[0]['id'], // from product response
        quantity: 1, // optional
        stocktype: "default", // warehouse code (optional)
        variant: [], // variant attribute IDs for selection products (optional)
        config: [], // config attribute IDs (optional)
        hidden: [], // hidden attribute IDs (optional)
        custom: {} // custom attribute ID/value pairs (optional)
    }
}]};

Re: USD Price is not coming in the product listing and detai

Posted: 22 Mar 2018, 13:48
by Anshul Dua
I am getting this error. when trying to post the data for base
Please find the attachment

Re: USD Price is not coming in the product listing and detai

Posted: 22 Mar 2018, 16:00
by aimeos
You forgot to include the CSRF token like in the example code there:
https://aimeos.org/docs/Developers/Clie ... d_products

Re: USD Price is not coming in the product listing and detai

Posted: 26 Mar 2018, 12:27
by Anshul Dua
After all these. How can a user see his/her previous order, I think there is no option to attach a order with any user?
Because When i am saving the basket and creating the order there is no parameter to send the customer id.

Re: USD Price is not coming in the product listing and detai

Posted: 27 Mar 2018, 07:39
by aimeos
Can you please open one topic for each kind of question?