Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

image from products in mini cart

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 05-30-2014, 01:41 AM
 
Gabone Gabone is offline
 

Advanced Member
  
Join Date: May 2014
Location: Bucharest
Posts: 37
 

Default image from products in mini cart

how can i extend or where can i find the query for products in cart so i can join product_image table?
__________________
xcart 5
Reply With Quote
  #2  
Old 06-02-2014, 02:41 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: image from products in mini cart

Please put your X-Cart version to your signature so that forum users could help you.

Also, please explain what you want to achieve.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 06-02-2014, 03:00 AM
 
Gabone Gabone is offline
 

Advanced Member
  
Join Date: May 2014
Location: Bucharest
Posts: 37
 

Default Re: image from products in mini cart

i dont need X-Cart version in my signature because i post in xcart 5 customization and design.
i wanna add product image in mini cart.thanks.
__________________
xcart 5
Reply With Quote
  #4  
Old 06-02-2014, 05:15 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: image from products in mini cart

Hi!

This is the example of test script that will be helpful for you. It will work only when there are some products in your cart.

PHP Code:
<?php

require_once 'top.inc.php';

$itemCount 0;
$cart = \XLite\Controller\Customer\Cart::getInstance()->getCart();

foreach (
$cart->getItems() as $item) {
    if (
$item->getProduct()) {
        foreach (
$item->getProduct()->getImages() as $image) {
            echo 
$image->getFrontURL() . '<br />';
        }

        
$itemCount += 1;
    }
}

if (
$itemCount == 0) {
    echo 
'No products in the cart';
}

You should put this code into any script (test.php for example) in the root folder of your X-Cart 5 installation and it will work. Hopefully, it will give you an idea of how to get info about product images.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #5  
Old 06-02-2014, 09:02 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: image from products in mini cart

Quote:
Originally Posted by Gabone
i dont need X-Cart version in my signature because i post in xcart 5 customization and design.

Please read forum rules:
http://forum.x-cart.com/showthread.php?p=251456#post251456

Thanks!
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #6  
Old 06-02-2014, 10:44 AM
 
Gabone Gabone is offline
 

Advanced Member
  
Join Date: May 2014
Location: Bucharest
Posts: 37
 

Default Re: image from products in mini cart

I can't see my profile,can't pm
Gabone,

you do not have permission to access this page
__________________
xcart 5
Reply With Quote
  #7  
Old 06-03-2014, 01:27 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: image from products in mini cart

Quote:
Originally Posted by Gabone
I can't see my profile,can't pm

This should be fixed now.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #8  
Old 06-03-2014, 01:49 AM
 
Gabone Gabone is offline
 

Advanced Member
  
Join Date: May 2014
Location: Bucharest
Posts: 37
 

Default Re: image from products in mini cart

yes thank you
__________________
xcart 5
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:33 PM.

   

 
X-Cart forums © 2001-2020