-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.3.10
Hi,
I'm using the listing_table to show products in rows. Because it is a long list I also wanted to place the Add to cart-button at the top of the page, instead of only at the bottom.
So i copied the code of the button to the top of listing_table.php. But it seems that occasionally, maybe only the first time someone uses this button, the products are not added to the cart. Everything seems to go right, but if you go to the cart it is empty. People complain this is happening, I only could reproduce it one time. So not sure where to look.
Have any of you got any idea what could be the issue here?
The code I placed at the top of listing_table.php is:
<?php if ($this->config->get('show_quantity_field')>=2) {
$this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form_'.$this->params->get('main_div_name').'\')){ return hikashopModifyQuantity(\'\',field,1,\'hikashop_product_form_'.$this->params->get('main_div_name').'\'); } return false;';
$this->row = null;
$this->row->product_quantity = -1;
$this->row->product_min_per_order = 0;
$this->row->product_max_per_order = -1;
$this->row->product_sale_start = 0;
$this->row->product_sale_end = 0;
$this->row->prices = array('filler');
$this->setLayout('quantity');
echo $this->loadTemplate();
if(!empty($this->ajax) && $this->config->get('redirect_url_after_add_cart','stay_if_cart')=='ask_user'){ ?>
<input type="hidden" name="popup" value="1"/>
<?php } ?>
<input type="hidden" name="hikashop_cart_type_0" id="hikashop_cart_type_0" value="cart"/>
<input type="hidden" name="add" value="1"/>
<input type="hidden" name="ctrl" value="product"/>
<input type="hidden" name="task" value="updatecart"/>
<input type="hidden" name="return_url" value="<?php echo urlencode(base64_encode(urldecode($this->redirect_url)));?>"/>
</form>
<?php }
if(in_array($pagination,array('bottom','both')) && $this->params->get('show_limit') && $this->pageInfo->elements->total){ $this->pagination->form = '_bottom'; ?>
<form action="<?php echo hikashop_currentURL(); ?>" method="post" name="adminForm_<?php echo $this->params->get('main_div_name').$this->category_selected;?>_bottom">
<div class="hikashop_products_pagination hikashop_products_pagination_bottom">
<?php echo $this->pagination->getListFooter($this->params->get('limit')); ?>
<span class="hikashop_results_counter"><?php echo $this->pagination->getResultsCounter(); ?></span>
</div>
<input type="hidden" name="filter_order_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->value; ?>" />
<input type="hidden" name="filter_order_Dir_<?php echo $this->params->get('main_div_name').$this->category_selected;?>" value="<?php echo $this->pageInfo->filter->order->dir; ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php } ?>
Thanks!