Cart Module Questions
- condorazul
-
Topic Author
- Offline
2.- Is it possible to display the cart in a pop up window? just have an icon your cart an when they click on it displays the cart in a pop up.
Please Log in or Create an account to join the conversation.
You have to edit the view "product / cart" to display the images in the cart. The images are not loaded by default, but you can use a little request to have them.
Like on this topic: www.hikashop.com/fr/forum/5-support-en-f...-affiche-images.html
It's possible but will require too some custom code.
On the link, you will have to load the view "product / cart" and add at the end of the url "&tmpl=component".
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
2.- is it similar to when you create a popup with checkout once you choose an article or its more difficult than that?
Please Log in or Create an account to join the conversation.
Then you need to add the image in the cart table, you can add the image thanks to the code:
2. It easiest than the popup displayed when adding a product.
You need a link like:
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
The first line of code i should paste it at the start of product cart rigt?
and then where i wantthe image to be displayed add the <td> plus the code</td>.
I did that and did not work so something i did wrong. Sorry for inconvenience
And for the second one i sould create a custom module with that code or i sould paste it in other place?
Please Log in or Create an account to join the conversation.
1. In the view "product / cart" you need the var "$row->cart_product_id;" so put the code:
2. You can place this code where you want.
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
what i did is paste the code you gave:
foreach($this->rows as $i => $row){
$cart_id = $row->cart_id;
if(empty($row->cart_product_quantity)&& $cart_type != 'wishlist' || $row->hide == 1) continue;
if($group && $row->cart_product_option_parent_id) continue;
$productClass->addAlias($row);
$db = JFactory::getDBO();
$query = 'SELECT `file_path` FROM `#__hikashop_file` WHERE file_ref_id = "'.(int)$row->cart_product_id.'" LIMIT 1';
$db->setQuery($query);
$image = $db->loadResult();
?>
and in the table i added the <td><img....</td> code you gave me.
Please Log in or Create an account to join the conversation.
You need to replace "#_" by your database prefix. I think that's why you have an error.
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
<a title="<?php echo JText::_('SHOW_CART');?>" class="modal" rel="{handler: 'iframe', size: {x: 760, y: 480}}" href="<?php echo hikashop_completeLink('cart&task=showcart',true); ?>">
Show Cart
</a>
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
that is what i wrote
foreach($this->rows as $i => $row){
$cart_id = $row->cart_id;
if(empty($row->cart_product_quantity)&& $cart_type != 'wishlist' || $row->hide == 1) continue;
if($group && $row->cart_product_option_parent_id) continue;
$productClass->addAlias($row);
$db = JFactory::getDBO();
$query = 'SELECT `file_path` FROM `gp8u6_hikashop_file` WHERE file_ref_id = "'.(int)$row->cart_product_id.'" LIMIT 1';
$db->setQuery($query);
$image = $db->loadResult();
?>
and the other one
<tfoot>
<tr>
<td colspan="<?php echo $row_count;?>">
<hr />
</td>
</tr>
<tr>
<?php $colspan = '1';
if($this->params->get('show_cart_quantity',1)){
$colspan=2;
} ?>
<td class="hikashop_cart_module_product_total_title" colspan="<?php echo $colspan; ?>">
<?php echo JText::_('HIKASHOP_TOTAL'); ?>
</td>
<td class="hikashop_cart_module_product_total_value">
<?php
$this->row=$this->total;
echo $this->loadTemplate();
?>
</td>
<td><img src="/media/com_hikashop/upload/<?php echo $image; ?>" alt="<?php echo $image; ?>" /></td>
<?php if($this->params->get('show_cart_delete',1)){ ?>
<td>
</td>
<?php }?>
<?php
if($row_count<2){ ?>
<td>
</td>
<?php }?>
</tr>
</tfoot>
<?php } ?>
<tbody>
Please Log in or Create an account to join the conversation.
I just tried this code on my end, and it's displaying the cart in a popup when clicking on "show cart". This should work, even if it's in a custom html module.<a title="<?php echo JText::_('SHOW_CART');?>" class="modal" rel="{handler: 'iframe', size: {x: 760, y: 480}}" href="<?php echo hikashop_completeLink('cart&task=showcart',true); ?>">
Show Cart
</a>
For the other point, are you sure that you have an image for the product added in the cart ?
Thanks to use "<?php var_dump($row->cart_product_id); ?> to see if the product id is returned.
If not, you have to use another var, else there is no image for this product. In all cases you have to add a check to see if the image is present or not.
Something like:
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
new html module
paste the link and
when i use the
<a title="<?php echo JText::_('SHOW_CART');?>" class="modal" rel="{handler: 'iframe', size: {x: 760, y: 480}}" href="<?php echo hikashop_completeLink('cart&task=showcart',true); ?>">
Show Cart
</a>
what i get is forbidden access, the object is write protected or cant be readed by the server, error 403.
I´m runing the page in loclhost with xampp and las php version.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
Thank you
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
Show cart module: You can't add php inside Joomla article by default, you can use a plugin to add php inside.
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
and in the database i only have file_ref_id 1,2,3,4 no more.
What do you mean with try the previus request in phpmyadmin???
Please Log in or Create an account to join the conversation.
Cart image issue: You should have an entry for the file_ref_id '7'. You can try to remove the image and set it again.
We are adding an option to display the images in the cart. It will be in the next release.
Please Log in or Create an account to join the conversation.
- condorazul
-
Topic Author
- Offline
deleted image and reup and did not work too.
Next release when it would be ready?
Please Log in or Create an account to join the conversation.