Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Ch1vpH Friend
    #1066822

    Hi 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!

    • This topic was modified 6 years, 6 months ago by  Ch1vpH.
    • This topic was modified 6 years, 6 months ago by  Ch1vpH.

    1. Screen-Shot-2017-10-08-at-21.37.01
    2. Screen-Shot-2017-10-08-at-21.38.03
    3. trying-to-add-the-words-here
    Saguaros Moderator
    #1067462

    Hi,

    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>';
    }
    ?>
    Ch1vpH Friend
    #1067564

    .

    • This reply was modified 6 years, 6 months ago by  Ch1vpH.
Viewing 3 posts - 1 through 3 (of 3 total)

This topic contains 2 replies, has 2 voices, and was last updated by  Ch1vpH 6 years, 6 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum