- Posts: 72
- Thank you received: 4
Stock display on product listing
13 years 10 months ago #76663
by Batas
Stock display on product listing was created by Batas
Hi,
is it possible to get STOCK displaying away from product listing but leave it on product page?
Thanx!
is it possible to get STOCK displaying away from product listing but leave it on product page?
Thanx!
Please Log in or Create an account to join the conversation.
13 years 10 months ago - 13 years 10 months ago #76835
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Stock display on product listing
Hi,
You can edit the view "product show" and add find this code at the beginning of the file
And add one line just after, like that:
At this moment, the quantity would be a fake "unlimited" so the stock block won't be displayed.
But there is a side effect : the javascript script which alert the user for the stock won't be added in the page.
Regards,
You can edit the view "product show" and add find this code at the beginning of the file
Code:
if (empty ($this->element)) {
$app->enqueueMessage(JText::_('PRODUCT_NOT_FOUND');
} else {
Code:
if (empty ($this->element)) {
$app->enqueueMessage(JText::_('PRODUCT_NOT_FOUND');
} else {
$this->element->product_quantity = -1;
But there is a side effect : the javascript script which alert the user for the stock won't be added in the page.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 13 years 10 months ago by Jerome. Reason: fix code
Please Log in or Create an account to join the conversation.
13 years 10 months ago #76914
by Batas
Replied by Batas on topic Stock display on product listing
thank you for respons!
I did as you said and got rid of stock on product page. On product listing displays stock as it was before.
I'm sorry to say that, but my wish is vice versa - out from product listing, leave it on product page
I did as you said and got rid of stock on product page. On product listing displays stock as it was before.
I'm sorry to say that, but my wish is vice versa - out from product listing, leave it on product page
Please Log in or Create an account to join the conversation.
13 years 10 months ago - 13 years 10 months ago #76981
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Stock display on product listing
Hi,
Oh sorry, it was the inverse. I misunderstood your request !
Well, the modification is the same but for another file.
First, revert your modification in the "product show" view.
Edit the "product listing" view and add this code.
It would modify the quantity for every product in the current list.
Regards,
Oh sorry, it was the inverse. I misunderstood your request !
Well, the modification is the same but for another file.
First, revert your modification in the "product show" view.
Edit the "product listing" view and add this code.
Code:
if(!empty($this->rows)) {
foreach($this->rows as &$row){
$row->product_quantity = -1;
}
unset($row);
}
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 13 years 10 months ago by Jerome. Reason: fix code
Please Log in or Create an account to join the conversation.
13 years 10 months ago #77044
by Batas

but as beeing amateur I'm not sure where to place this code within file.
I tried to place at many places inside the file but every time I got only broken page... :blush:
can you please advise?
Replied by Batas on topic Stock display on product listing
but as beeing amateur I'm not sure where to place this code within file.
I tried to place at many places inside the file but every time I got only broken page... :blush:
can you please advise?
Please Log in or Create an account to join the conversation.
13 years 10 months ago - 13 years 10 months ago #77109
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Stock display on product listing
Hi,
You should have at the beginning of the file
You can put the PHP code there
Regards,
You should have at the beginning of the file
Code:
<?php
if(hikashop_level(2) && JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task')=='listing' && $this->params->get('show_compare')) {?>
Code:
<?php
if(!empty($this->rows)) {
foreach($this->rows as &$row){
$row->product_quantity = -1;
}
unset($row);
}
if(hikashop_level(2) && JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task')=='listing' && $this->params->get('show_compare')) {?>
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 13 years 10 months ago by Jerome. Reason: fix code
Please Log in or Create an account to join the conversation.
13 years 10 months ago #77131
by Batas
Replied by Batas on topic Stock display on product listing
hmmm, it looks slightly different. The proposed code was placed rigth down here where HERE is written. Unfortunately broken page afterwards.
<?php
HERE
/**
* @package HikaShop for Joomla!
* @version 2.0.0
* @author hikashop.com
* @copyright (C) 2010-2012 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
HERE
if(hikashop_level(2) && JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task')=='listing' && $this->params->get('show_compare')) {?>
HERE
<script type="text/javascript">
<?php
HERE
/**
* @package HikaShop for Joomla!
* @version 2.0.0
* @author hikashop.com
* @copyright (C) 2010-2012 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
HERE
if(hikashop_level(2) && JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task')=='listing' && $this->params->get('show_compare')) {?>
HERE
<script type="text/javascript">
Please Log in or Create an account to join the conversation.
13 years 10 months ago #77136
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Stock display on product listing
Hi,
The second one:
?><?php
HERE
if(hikashop_level(2) && JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task')=='listing' && $this->params->get('show_compare')) {?>
Best regards,
The second one:
?><?php
HERE
if(hikashop_level(2) && JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task')=='listing' && $this->params->get('show_compare')) {?>
Best regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
13 years 10 months ago #77138
by Batas
Replied by Batas on topic Stock display on product listing
with that code:
?><?php
if(!empty($this->rows) {
foreach($this->rows as &$row){
$row->product_quantity = -1;
}
unset($row);
}
if(hikashop_level(2) && JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task')=='listing' && $this->params->get('show_compare')) {?>
I got:
Parse error: syntax error, unexpected '{' in /home/greenros/public_html/templates/bt_bazaar/html/com_hikashop/product/listing.php on line 13
?><?php
if(!empty($this->rows) {
foreach($this->rows as &$row){
$row->product_quantity = -1;
}
unset($row);
}
if(hikashop_level(2) && JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task')=='listing' && $this->params->get('show_compare')) {?>
I got:
Parse error: syntax error, unexpected '{' in /home/greenros/public_html/templates/bt_bazaar/html/com_hikashop/product/listing.php on line 13
Please Log in or Create an account to join the conversation.
13 years 10 months ago #77146
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Stock display on product listing
Sorry, my fault !
There was a missing parentheses:
if(!empty($this->rows)) {
Regards,
There was a missing parentheses:
if(!empty($this->rows)) {
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: Batas
Please Log in or Create an account to join the conversation.
13 years 10 months ago #77147
by Batas
Replied by Batas on topic Stock display on product listing
brilliant support! 
thanks a lot!
thanks a lot!
Please Log in or Create an account to join the conversation.
Time to create page: 0.222 seconds