Markup for when cart module is updated

  • Posts: 20
  • Thank you received: 0
13 years 4 months ago #3651

I've made substantial changes to CSS and PHP for the cart module, but I'm having trouble locating the markup for when the cart gets updated. The far left images is the empty cart, the middle is image is what I'm trying to locate (cart display when product is being added), and the right image is the cart once product has been added.



What tmpl file has the html for the middle image? I've looked through most of the php files, but can't seem to find it. The pages changes too quick for me to use Firebug to see what class or id attributes are being used.

TIA,
Shannon

Attachments:
Last edit: 13 years 4 months ago by onisama.

Please Log in or Create an account to join the conversation.

  • Posts: 81591
  • Thank you received: 13079
  • MODERATOR
13 years 4 months ago #3655

Tha same template is used. The cart module uses only one tmpl file. However, if you use an old version of HikaShop you might see the default tmpl cart file instead of the override tmpl file. That was corrected 1 month ago: www.hikashop.com/en/support/forum/4-how-...n-checkout.html#1852

Please Log in or Create an account to join the conversation.

  • Posts: 20
  • Thank you received: 0
13 years 4 months ago #3667

Hmm, that did not seem to help.

Here is my url if it helps: www.nezumidesign.com/chris/

It's grabbing the language string, HIKASHOP_TOTAL, from somewhere. In views/product/tmpl/cart.php, I've commneted this out: <?php echo JText::_('HIKASHOP_TOTAL'); ?> both through the GUI admin and in the file directly via FTP, but it is still parsing that line from somewhere.

This is a bit of a showstopper for me. If I can't get it resolved, I'll either have to re-evaluate how I'm styling the cart, or switch to a different cart extension.

Thanks for you help,
Shannon

Last edit: 13 years 4 months ago by onisama.

Please Log in or Create an account to join the conversation.

  • Posts: 81591
  • Thank you received: 13079
  • MODERATOR
13 years 4 months ago #3670

It seems that you changed that template file quite a lot. There is no reason that this would happen otherwise. Maybe you missed something ?
Could you post the changes you made ?

Please Log in or Create an account to join the conversation.

  • Posts: 20
  • Thank you received: 0
13 years 4 months ago #3672

I'm hiding most of it with CSS (tbody, thead, etc.). I'm only wanting to display portions of tfoot. Sorry about not using BoardCode, it was not displaying a lot of the php.



<?php
/**
* @package HikaShop for Joomla! 1.5
* @version 1.3.6
* @author hikashop.com
* @copyright (C) 2010 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?>
<?php
$this->setLayout('listing_price');
$this->params->set('show_quantity_field', -1);
$desc = $this->params->get('comp_description');
if(empty($desc)){
$this->params->set('comp_description',JText::_('CART_EMPTY'));
}
if(JRequest::getWord('tmpl','')=='component'){
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
header( 'Cache-Control: post-check=0, pre-check=0', false );
header( 'Pragma: no-cache' );
}
?>
<div id="hikashop_cart" class="hikashop_cart">
<?php
if(empty($this->rows)){
echo '<div class="empty_cart">'.$this->params->get('comp_description').'</div>';
}else{
$row_count = 1;
global $Itemid;
$url_itemid='';
if(!empty($Itemid)){
$url_itemid='&Itemid=99';
}
?>
<form action="<?php echo hikashop::completeLink('product&task=updatecart'.$url_itemid,false,true); ?>" method="post" name="hikashop_cart_form">
<table width="100%">
<thead>
<tr>
<th class="hikashop_cart_title">
<?php echo JText::_('CART_PRODUCT_NAME'); ?>
</th>
<?php if($this->params->get('show_cart_quantity',1)){
$row_count++; ?>
<th class="hikashop_cart_title">
<?php echo JText::_('CART_PRODUCT_QUANTITY'); ?>
</th>
<?php }
if($this->params->get('show_cart_price',1)){
$row_count++; ?>
<th class="hikashop_cart_title">
<?php echo JText::_('CART_PRODUCT_PRICE'); ?>
</th>
<?php }
if($this->params->get('show_cart_delete',1)){
$row_count++; ?>
<th class="hikashop_cart_title">
</th>
<?php }
if($row_count<2){ ?>
<th></th>
<?php }?>
</tr>
</thead>
<tbody>
<?php
$k = 0;
foreach($this->rows as $i => $row){
if(empty($row->cart_product_quantity)) continue;
?>
<tr class="<?php echo "row$k"; ?>">
<td>
<a href="<?php echo hikashop::completeLink('product&task=show&cid='.$row->product_id.$url_itemid);?>" ><?php echo $row->product_name; ?></a>
</td>
<?php if($this->params->get('show_cart_quantity',1)){ ?>
<td>
<input id="hikashop_cart_quantity_<?php echo $row->product_id;?>" type="text" name="data[<?php echo $row->product_id;?>]" class="hikashop_product_quantity_field" value="<?php echo $row->cart_product_quantity; ?>" onchange="return hikashopModifyQuantity(<?php echo $row->product_id;?>,this)" />
</td>
<?php }
if($this->params->get('show_cart_price',1)){ ?>
<td>
<?php
$this->row=&$row;
$this->cart_product_price = true;
echo $this->loadTemplate();
?>
</td>
<?php }
if($this->params->get('show_cart_delete',1)){ ?>
<td>
<a href="<?php echo hikashop::completeLink('product&task=updatecart&product_id='.$row->product_id.'&quantity=0&url='.$this->params->get('url')); ?>" onclick="var qty_field = document.getElementById('hikashop_cart_quantity_<?php echo $row->product_id;?>'); qty_field.value=0; return hikashopModifyQuantity(<?php echo $row->product_id;?>,qty_field);" ><img src="<?php echo HIKASHOP_IMAGES . 'delete2.png';?>" border="0" alt="remove product" /></a>
</td>
<?php }
if($row_count<2){ ?>
<td></td>
<?php }?>
</tr>
<?php
$k = 1-$k;
}
?>
</tbody>
<?php if($this->params->get('show_cart_price',1)){ ?>
<tfoot>
<!-- <tr class="tfoot_tr_1">
<td colspan="<?php //echo $row_count;?>">
<hr></hr>
</td>
</tr> -->
<tr>
<?php //if($this->params->get('show_cart_quantity',1)){ ?>
<!-- <td>
</td> -->
<?php //}?>
<!-- <td class="cart_total_label">
<?php //echo JText::_('HIKASHOP_TOTAL'); ?>
</td> -->
<td class="cart_total">
<!-- -->
<a href="#" onclick="document.hikashop_cart_form.submit(); return false" class="hikashop_product_price">
<!-- -->
<?php
$this->row=$this->total;
echo $this->loadTemplate();
?>
<!-- -->
</a>
<!-- -->
</td>
<?php if($this->params->get('show_cart_delete',1)){ ?>
<td>
</td>
<?php }?>
</tr>
</tfoot>
<?php } ?>
</table>
<?php
if($this->params->get('show_cart_quantity',1)){ ?>
<noscript>
<input type="submit" class="button" name="refresh" value="<?php echo JText::_('REFRESH_CART');?>"/>
</noscript>
<?php }
if($this->params->get('show_cart_proceed',1)){
global $Itemid;
echo $this->cart->displayButton(JText::_('PROCEED_TO_CHECKOUT'),'checkout',$this->params,hikashop::completeLink('checkout'.$url_itemid),'');
} ?>
<input type="hidden" name="url" value="<?php echo $this->params->get('url');?>"/>
<input type="hidden" name="ctrl" value="product"/>
<input type="hidden" name="task" value="updatecart"/>
</form>
<?php } ?>
</div>
<?php
if(JRequest::getWord('tmpl','')=='component'){
exit;
}

Last edit: 13 years 4 months ago by onisama.

Please Log in or Create an account to join the conversation.

  • Posts: 81591
  • Thank you received: 13079
  • MODERATOR
13 years 4 months ago #3674

Let's try to use a simpler version. Please change both file components/com_hikashop/views/product/tmpl/cart.php and templates/YOUR_TEMPLATE/html/com_hikashop/product/cart.php with the content below:




<?php
/**
* @package HikaShop for Joomla! 1.5
* @version 1.3.6
* @author hikashop.com
* @copyright (C) 2010 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?>
<?php
$this->setLayout('listing_price');
$this->params->set('show_quantity_field', -1);
$desc = $this->params->get('comp_description');
if(empty($desc)){
$this->params->set('comp_description',JText::_('CART_EMPTY'));
}
if(JRequest::getWord('tmpl','')=='component'){
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
header( 'Cache-Control: post-check=0, pre-check=0', false );
header( 'Pragma: no-cache' );
}
?>
<div id="hikashop_cart" class="hikashop_cart">
<?php
if(empty($this->rows)){
echo '<div class="empty_cart">'.$this->params->get('comp_description').'</div>';
}else{
$row_count = 1;
global $Itemid;
$url_itemid='';
if(!empty($Itemid)){
$url_itemid='&Itemid=99';
}
?>
<form action="<?php echo hikashop::completeLink('product&task=updatecart'.$url_itemid,false,true); ?>" method="post" name="hikashop_cart_form">
<span class="cart_total">
<a href="#" onclick="document.hikashop_cart_form.submit(); return false" class="hikashop_product_price">
<?php
$this->row=$this->total;
echo $this->loadTemplate();
?>
</a>
</span>
<?php
if($this->params->get('show_cart_proceed',1)){
global $Itemid;
echo $this->cart->displayButton(JText::_('PROCEED_TO_CHECKOUT'),'checkout',$this->params,hikashop::completeLink('checkout'.$url_itemid),'');
} ?>
<input type="hidden" name="url" value="<?php echo $this->params->get('url');?>"/>
<input type="hidden" name="ctrl" value="product"/>
<input type="hidden" name="task" value="updatecart"/>
</form>
<?php } ?>
</div>
<?php
if(JRequest::getWord('tmpl','')=='component'){
exit;
}

Please Log in or Create an account to join the conversation.

  • Posts: 20
  • Thank you received: 0
13 years 4 months ago #3678

I'm not using template overrides, I just modify core joomla and extension code.

I made the changes you suggested, but am still having the issue.

I can see similar markup on the product page itself here, www.nezumidesign.com/chris/index.php?opt...0&category_pathway=0

It seems like the cart module is deriving its markup from different tmpl files, not just from components/com_hikashop/views/product/tmpl/cart.php

Thanks,
Shannon

Please Log in or Create an account to join the conversation.

  • Posts: 81591
  • Thank you received: 13079
  • MODERATOR
13 years 4 months ago #3680

If you edited the view via the GUI we provide, then you have an override.
HikaShop automatically save your modifications to a template override so that you don't loose them. Please do the modification in the template override as well.

Please Log in or Create an account to join the conversation.

  • Posts: 20
  • Thank you received: 0
13 years 4 months ago #3686

Beautiful, that worked. That's a pretty nifty way to override. I played with template overrides when 1.5 was in beta and never could get them to work right. I may have to revisit the idea as I hate redoing all my modifications when I upgrade Joomla or any extensions.

Thanks again for you help. I've used different cart CMS's before, but this is my first time trying a cart extension for Joomla and so far I like it.

Thanks,
Shannon

Please Log in or Create an account to join the conversation.

Time to create page: 0.074 seconds
Powered by Kunena Forum