Get Mini Basket With Product Images also

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
awaidqureshi
Posts: 86
Joined: 12 Jan 2019, 15:17

Get Mini Basket With Product Images also

Post by awaidqureshi » 07 Feb 2019, 14:12

Is There Any Method In Which I can get mini basket with product images also.
Please give Info about that.

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

Re: Get Mini Basket With Product Images also

Post by aimeos » 08 Feb 2019, 13:01

You can change the template and add the product image link here:
https://github.com/aimeos/ai-client-htm ... d.php#L171

You can get the URL by using:

Code: Select all

<img src="<?= $this->content( $product->getMediaUrl() ) ?>" />
The methods of the ordered product are documented there:
https://aimeos.org/api/latest/class-Aim ... Iface.html
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
loeffe1
Posts: 49
Joined: 21 Feb 2020, 10:33

Re: Get Mini Basket With Product Images also

Post by loeffe1 » 02 Mar 2020, 15:52

How would we need to update the AimeosBasketMini updateBasket function to show the image without having to reload the page after adding a product to the basket?

I have modified my mini basket template and added the below to the AimeosBasketMini updateBasket function but the image will only show after a page reload

Code: Select all

$(".thumbnail--container img", product).attr("src", entry.attributes['order.base.product.mediaUrl']);
I am assuming that order.base.product.mediaUrl does not exists as my src is updated with (unknown)

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

Re: Get Mini Basket With Product Images also

Post by aimeos » 03 Mar 2020, 08:25

Dump the response or have a look into the web inspector of your browser to see the structure of the data.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
loeffe1
Posts: 49
Joined: 21 Feb 2020, 10:33

Re: Get Mini Basket With Product Images also

Post by loeffe1 » 07 Jul 2020, 13:08

The attribute is called order.base.product.mediaurl, not order.base.product.mediaUrl. I still had to edit the script to modify the path of the preview image but now it is working.

User avatar
harshithvemula
Posts: 33
Joined: 19 Jul 2020, 16:27

Re: Get Mini Basket With Product Images also

Post by harshithvemula » 09 Oct 2020, 04:05

I have added the product image to the mini cart but it updates only after reloading the page. i have tried adding code to update basket function but it didn't worked .please help me

User avatar
parmonov98
Posts: 33
Joined: 24 Sep 2020, 12:12

Re: Get Mini Basket With Product Images also

Post by parmonov98 » 09 Oct 2020, 17:34

how about to get a url of the product in basket?
I didn't find an url returner method on https://aimeos.org/api/latest/class-Aim ... ndard.html.


https://imgur.com/3vtF4is
there is not url. or how can I generate it?

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

Re: Get Mini Basket With Product Images also

Post by aimeos » 10 Oct 2020, 08:55

What's your code for adding the image in the mini basket?

The basket product itself has no URL because it depends on the configured target page. You can generate the URL easily using the URL view helper using:

Code: Select all

$this->link( 'client/html/catalog/detail/url', [<params>] )
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
parmonov98
Posts: 33
Joined: 24 Sep 2020, 12:12

Re: Get Mini Basket With Product Images also

Post by parmonov98 » 10 Oct 2020, 12:53

aimeos wrote: 10 Oct 2020, 08:55 What's your code for adding the image in the mini basket?

The basket product itself has no URL because it depends on the configured target page. You can generate the URL easily using the URL view helper using:

Code: Select all

$this->link( 'client/html/catalog/detail/url', [<params>] )
be kind, tell me what to pass in there as params?

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

Re: Get Mini Basket With Product Images also

Post by aimeos » 11 Oct 2020, 08:57

The parameters your can pass are described here:
https://aimeos.org/docs/latest/frontend ... ter-names/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply