Post by jonasprotelo » Fri Jan 18, 2013 11:28 pm

Hello everyone,

Is it possible to have a text like "log in to see prices" if prices only are shown for logged on users?

Regards,
Jonas

Newbie

Posts

Joined
Fri Jan 18, 2013 11:25 pm

Post by tulip_craft » Sat Jan 19, 2013 9:00 pm

sure, where you want to put your text.?? home.?? header.??

try this:

Code: Select all

<h4><a href="http://yourstore.com/index.php?route=account/login">Login</a> to see prices</h4>

All about Crochet and Knitting, a Handicraft Store -> http://tulip-craft.com


User avatar
New member

Posts

Joined
Tue Dec 04, 2012 5:54 pm

Post by i2Paq » Sat Jan 19, 2013 9:20 pm

I think he means that when not logged in instead of the price you see: "Please login for prices"

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by ChetanCx » Sat Jan 19, 2013 9:59 pm

For category pages
open catalog/view/theme/your_theme/template/product/category.tpl
find

Code: Select all

<?php if ($product['price']) { ?>
      <div class="price">
        <?php if (!$product['special']) { ?>
        <?php echo $product['price']; ?>
        <?php } else { ?>
        <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
        <?php } ?>
        <?php if ($product['tax']) { ?>
        <br />
        <span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
        <?php } ?>
      </div>
      <?php } ?>
replace it with

Code: Select all

<?php if ($product['price']) { ?>
      <div class="price">
        <?php if (!$product['special']) { ?>
        <?php echo $product['price']; ?>
        <?php } else { ?>
        <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
        <?php } ?>
        <?php if ($product['tax']) { ?>
        <br />
        <span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
        <?php } ?>
      </div>
      <?php } else { ?>
	  <div class="price"><a href="http://yourstore.com/index.php?route=account/login"><?php echo "Login to see Price" ; ?></a></div>
	  <?php } ?>
you need to add "else" . this was for category pages similarly you can do for product page, modules etc

User avatar
Active Member

Posts

Joined
Sat Dec 08, 2012 8:12 pm

Post by thegeekz » Thu Jan 02, 2014 9:16 am

Hi everyone

I am interested to get this Text shown in my theme : Basico, but the theme's Basico/template/product/category.tpl doesn't have :

Code: Select all

      <?php if ($product['tax']) { ?>
        <br />
      <span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
Only has this similar:

Code: Select all

<?php if ($product['price']) { ?>
          <div class="price">
            <?php if (!$product['special']) { ?>
            <?php echo $product['price']; ?>
            <?php } else { ?>
            <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
            <?php } ?>
          </div>
          <?php } ?>


The above code is nestled in this huge chunk where there's also another <div class="price"> further below -- under <div class="product-grid central_products">

Code: Select all

 <div class="product-list">
      <?php foreach ($products as $product) { ?>
      <div class="listp">
        <?php if ($product['thumb']) { ?>
        <a href="<?php echo $product['href']; ?>" class="simple_image img-prod" title=""> <span style="display: none;" class="category_zoom"><img src="catalog/view/theme/Basico/image/ico-zoom.png" alt="Zoom Picture" /></span> <img class="category_images_border" src="catalog/view/javascript/timthumb/timthumb.php?src=<?php echo $product['thumb']; ?>&h=130&w=180&zc=1" alt="<?php echo $product['name']; ?>" /></a>
        <?php } ?>
        <div class="product_info"> <span class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></span>
          <div class="description"><?php echo $product['description']; ?></div>
          <?php if ($product['price']) { ?>
         [b] <div class="price">
            <?php if (!$product['special']) { ?>
            <?php echo $product['price']; ?>
            <?php } else { ?>
            <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
            <?php } ?>
          </div>
          <?php } ?>[/b]
          <div class="category_add"><a onclick="addToCart('<?php echo $product['product_id']; ?>');"><img src="catalog/view/theme/Basico/image/add_icon.png" alt="add icon"/><?php echo $button_cart; ?></a></div>
          <div class="category_details"><a href="<?php echo $product['href']; ?>"><?php echo $button_view; ?></a></div>
        </div>
      </div>
      <?php } ?>
    </div>
    <div class="product-grid central_products">
      <?php 
  $prod_cont = 0;
  foreach ($products as $product) { ?>
      <div class="item">
        <div class="item_up"> <a href="<?php echo $product['href']; ?>" class="ptitle2 product_title1"><?php echo $product['name']; ?></a>
          <?php if ($product['thumb']) { ?>
          <div class="image"><a href="<?php echo $product['href']; ?>" class="simple_image" title=""> <span style="display: none;" class="zoom"><img src="catalog/view/theme/Basico/image/ico-zoom.png" alt="Zoom Picture" /></span> <img class="pimg" src="catalog/view/javascript/timthumb/timthumb.php?src=<?php echo $product['thumb']; ?>&h=143&w=195&zc=1" alt="<?php echo $product['name']; ?>" /></a></div>
          <?php } ?>
          <?php $text =  $product['description'];?>
          <div class="product_text"><?php echo $text; ?></div>
          <?php if (!$product['special']) { ?>
          [b]<div class="price"><?php echo $product['price']; ?></div>
          <?php } ?>
          <?php if ($product['special']) { ?>
          <div class="saleblock"> <span class="price_sale"><?php echo $product['price']; ?></span><span class="price_onsale"><?php echo $product['special']; ?></span> </div>
          <?php } ?>[/b]
        </div>
        <div class="add"><span><img src="catalog/view/theme/Basico/image/add_icon.png" alt="add icon"/><a onclick="addToCart('<?php echo $product['product_id']; ?>');"><?php echo $button_cart; ?></a></span></div>
        <div class="details"><a href="<?php echo $product['href']; ?>"><?php echo $button_view; ?></a></div>
      </div>
      <?php if ($prod_cont==3) { ?>
      <div class="clear"></div>
      <?php } ?>
      <?php } ?>

So which Div Class = "price" coding should I insert the 2 lines under? I believe should be the 1st instance where its similar to the indicated in the replies here?

No more using Apsona, as they are not updated.

  • Every upgrade -- rem. 2 reinstall vqmod & mindful of modules w/ VQmod -- E.g Import / Export Tool by MHC


Active Member

Posts

Joined
Tue Nov 02, 2010 10:24 am
Who is online

Users browsing this forum: No registered users and 2 guests