-
AuthorPosts
-
Ch1vpH Friend
Ch1vpH
- Join date:
- February 2016
- Posts:
- 299
- Downloads:
- 21
- Uploads:
- 128
- Thanks:
- 29
- Thanked:
- 1 times in 1 posts
October 9, 2017 at 4:11 pm #1066822Hi there,
I don’t know if you can help me, but I’m at a complete dead end with this elsewhere.
Basically I’ve copy some code from the VM forum in to my product details file default.php and the words in stock’ & ‘out of stock’ appear no problem. see image 1&2
But what I really wanted to do is add the same wording and code into the category/browse view file products.php but from some reason I just cannot get it to work on the browse view.
This is the working code in the details view default.php :
if ($this->product->product_in_stock >=1) { echo '<div class="stock"><span class="bold">'.JText::_('').'</span><i class="green">'.JText::_('IN STOCK').'</i> </div>'; }else { echo '<div class="stock"><span class="bold">'.JText::_('').'</span><i class="red">'.JText::_('OUT OF STOCK').'</i> </div>'; }
And this is the area of code I need to change in the products.php
<div class="vm-product-rating-container"> <?php echo shopFunctionsF::renderVmSubLayout('rating',array('showRating'=>$showRating, 'product'=>$product)); if ( VmConfig::get ('display_stock', 1)) { ?> <span class="vmicon vm2-<?php echo $product->stock->stock_level ?>" title="<?php echo $product->stock->stock_tip ?>"></span> <?php } echo shopFunctionsF::renderVmSubLayout('stockhandle',array('product'=>$product)); ?> </div>
ANY ADVICE IS WELCOME PLEASE as this is literally the last thing I need to do to finish this site!
- Saguaros Moderator
Saguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
October 12, 2017 at 7:41 am #1067462Hi,
You can try opening the file: root/templates/ja_brickstore/html/com_virtuemart/sublayouts/products.php
At approx line 108, add this snippet of code:
<?php if ($product->product_in_stock >=1) { echo '<div class="stock"><span class="bold">'.JText::_('').'</span><i class="green">'.JText::_('IN STOCK').'</i> </div>'; }else { echo '<div class="stock"><span class="bold">'.JText::_('').'</span><i class="red">'.JText::_('OUT OF STOCK').'</i> </div>'; } ?>
AuthorPostsViewing 3 posts - 1 through 3 (of 3 total)This topic contains 2 replies, has 2 voices, and was last updated by Ch1vpH 7 years ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Jump to forum