Skip to main content

Change quantity position

More
8 years 8 months ago #285726 by verzevoul
-- HikaShop version -- : 3.2.2
-- Joomla version -- : 3.8.3
-- PHP version -- : 7.0

Hello,

how can i change the position of hikashop_product_stock_count?
I can't figure out how to do it from the view "show_dafault"
Code:
<div id="hikashop_product_quantity_main" class="hikashop_product_quantity_main"> <?php $this->row = & $this->element; $this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\'' . $this->row->product_id . '\',field,1' . $form . ',\'cart\'); } else { return false; }'; $this->setLayout('quantity'); echo $this->loadTemplate(); ?> </div>

Thank you

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

More
8 years 8 months ago #285734 by nicolas
Replied by nicolas on topic Change quantity position
Hi,

It depends.
The count is displayed by the same view file than the one displaying the add to cart button ( product / quantity.php ).
So if you move that code from the show_default.php it will move both together.
To move one of them independently from the other, you would have to extract the stock display from the add to cart button display ( delete its code in quantity.php and move it in show_default.php ).
The following user(s) said Thank You: verzevoul

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

More
8 years 8 months ago #285774 by verzevoul
Replied by verzevoul on topic Change quantity position
Hi!

To move one of them independently from the other, you would have to extract the stock display from the add to cart button display ( delete its code in quantity.php and move it in show_default.php ).


which part of the code do i have to move?

Thank you

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

More
8 years 8 months ago #285778 by nicolas
Replied by nicolas on topic Change quantity position
Hi,

You need to copy/paste this:
Code:
$stock = $this->row->product_quantity; if($stock == -1 && !empty($this->element->main) && isset($this->element->main->product_quantity)) $stock = $this->element->main->product_quantity; $in_stock = $stock != 0;
and cut/paste this:
Code:
$stock_class = ($stock != 0) ? "" : " hikashop_product_no_stock"; ?> <span class="hikashop_product_stock_count<?php echo $stock_class; ?>"> <?php if(!empty($this->row->product_stock_message)) echo JText::_($this->row->product_stock_message); elseif($stock > 0) echo (($stock == 1 && JText::_('X_ITEM_IN_STOCK') != 'X_ITEM_IN_STOCK') ? JText::sprintf('X_ITEM_IN_STOCK', $stock) : JText::sprintf('X_ITEMS_IN_STOCK', $stock)); elseif(!$in_stock) echo JText::_('NO_STOCK'); ?> </span> <?php
The following user(s) said Thank You: verzevoul

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

Time to create page: 0.171 seconds
Powered by Kunena Forum