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

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Anshul Dua
Posts: 24
Joined: 15 Mar 2018, 10:04

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

Post by Anshul Dua » 19 Mar 2018, 08:16

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

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

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

Post by aimeos » 19 Mar 2018, 08:22

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
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Anshul Dua
Posts: 24
Joined: 15 Mar 2018, 10:04

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

Post by Anshul Dua » 20 Mar 2018, 07:00

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"
}
]
}
```

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

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

Post by aimeos » 20 Mar 2018, 16:28

Have you read this section in the docs?
https://aimeos.org/docs/Developers/Clie ... d_products
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Anshul Dua
Posts: 24
Joined: 15 Mar 2018, 10:04

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

Post by Anshul Dua » 21 Mar 2018, 04:33

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?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

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

Post by aimeos » 22 Mar 2018, 08:12

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)
    }
}]};
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Anshul Dua
Posts: 24
Joined: 15 Mar 2018, 10:04

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

Post by Anshul Dua » 22 Mar 2018, 13:48

I am getting this error. when trying to post the data for base
Please find the attachment
Attachments
Untitled.png
Untitled.png (15.32 KiB) Viewed 3075 times

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

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

Post by aimeos » 22 Mar 2018, 16:00

You forgot to include the CSRF token like in the example code there:
https://aimeos.org/docs/Developers/Clie ... d_products
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Anshul Dua
Posts: 24
Joined: 15 Mar 2018, 10:04

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

Post by Anshul Dua » 26 Mar 2018, 12:27

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.

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

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

Post by aimeos » 27 Mar 2018, 07:39

Can you please open one topic for each kind of question?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply