Author Topic: icon - a new product. how to insert  (Read 11286 times)

kotekmk

  • Beginner
  • *
  • Posts: 27
icon - a new product. how to insert
« on: September 01, 2010, 15:28:26 pm »
how to make icon (new), inserts itself automatically turns off after a week

example
http://images43.fotosik.pl/335/5e29e1740fff487a.png

mark R

  • Jr. Member
  • **
  • Posts: 220
Re: icon - a new product. how to insert
« Reply #1 on: September 06, 2010, 13:09:58 pm »
I am also looking for this solution.
I am having a look at
Code: [Select]
<?php if ((time() - ($cdate)) < (14 86400)) {  ?>
<span class="newprod"><img src="/images/newprod.gif" width="50" height="50" alt="New Product"></span>
<?php ?>
but unfortunatly it isnt calculating the date correctly.

I will let you know if I come across anything.
Seek and ye shall find.........
4 VM sites and counting

mark R

  • Jr. Member
  • **
  • Posts: 220
Re: icon - a new product. how to insert
« Reply #2 on: September 06, 2010, 13:52:06 pm »
I have resolved the issue with the time not calculating, just the CSS to sort out now.
Code: [Select]
<?php if ((time() - strtotime($cdate)) < (14 86400)) {  ?>
<span class="newprod"><img src="/images/newprod.gif" alt="New Product"></span>
<?php ?>

Code: [Select]
.ImageInsideIE1 span.newprod{
        width:75px;
height:75px;
  margin:-150px 26px;
        float:right;
filter:alpha(opacity=99);
-moz-opacity:0.99;
-khtml-opacity: 0.99;
opacity: 0.99;
}

works ok in FF but not in IE ..heeeelpppp
many thanks
Seek and ye shall find.........
4 VM sites and counting

kotekmk

  • Beginner
  • *
  • Posts: 27
Re: icon - a new product. how to insert
« Reply #3 on: September 06, 2010, 23:02:56 pm »
where it is
where to insert

kotekmk

  • Beginner
  • *
  • Posts: 27
Re: icon - a new product. how to insert
« Reply #4 on: September 14, 2010, 22:50:20 pm »
help me!

mark R

  • Jr. Member
  • **
  • Posts: 220
Re: icon - a new product. how to insert
« Reply #5 on: September 15, 2010, 22:31:37 pm »
the above code needs to be put in the browse page used by your VM theme.
Seek and ye shall find.........
4 VM sites and counting

diastasi

  • Jr. Member
  • **
  • Posts: 65
    • e-magazi the greek eshop
Re: icon - a new product. how to insert
« Reply #6 on: September 15, 2010, 23:22:54 pm »
mark R
Can you be a little more specific?
a) Where in browse page u put the code?
b) In which CSS did you add the addition?

kotekmk

  • Beginner
  • *
  • Posts: 27
Re: icon - a new product. how to insert
« Reply #7 on: September 27, 2010, 23:09:10 pm »
does not work

coolissimo

  • Beginner
  • *
  • Posts: 26
Re: icon - a new product. how to insert
« Reply #8 on: November 03, 2010, 14:04:07 pm »
I tried the code but that is not working (firefox and ie).

This what i 've done :

First i've created an icon (newprod.gif) then put into images joomla folder (i tried into image folder of my virtuemart template but nothing change).

I put the css code into this virtuemart file: style.css
And i put the php code into my browse file.

Nothing appears..

its a simple but great addon that would need to be a part of a future virtuemart update.

But i cant waiting for this so could you help please ???

diastasi

  • Jr. Member
  • **
  • Posts: 65
    • e-magazi the greek eshop
Re: icon - a new product. how to insert
« Reply #9 on: November 05, 2010, 12:45:59 pm »
I used this in components/com_virtuemart/themes/your-style/templates/browse/ja_vm_cat_browse.php

At top of page

Code: [Select]
<style>
#watermark_box {
position:relative;
display:block;
}
img.watermark {
position: absolute;
top: 1px;
left: 0px;
}
</style>

before this
Code: [Select]
<a href="<?php echo $product_flypage ?>" title="<?php echo $product_name ?>">
I add

Code: [Select]
<div id="watermark_box">
after this

Code: [Select]
<?php echo ps_product::image_tag$product_thumb_image'class="browseProductImage" border="0" align="left" title="'.$product_name.'" alt="'.$product_name .'"' ?>
I add

Code: [Select]
<?php if ((time() - strtotime($mdate)) < (14 86400)) {  ?>
  <img src="/images/product_new.png" class="watermark" width="39px" height="39px" alt="New Product">
<?php ?>
</div>

14 * 86400 means 14 days

In order to work in Greek I changed in VM's lang file common.php the following

'DATE_FORMAT_LC' => '%d-%m-%Y',

coolissimo

  • Beginner
  • *
  • Posts: 26
Re: icon - a new product. how to insert
« Reply #10 on: November 08, 2010, 11:12:03 am »
thanks for the reply but not working for me (virtuemart 1.1.4)

diastasi

  • Jr. Member
  • **
  • Posts: 65
    • e-magazi the greek eshop
Re: icon - a new product. how to insert
« Reply #11 on: November 15, 2010, 22:24:17 pm »
Did you make the changes in the browse page you are using?
Maybe you are using a wrong page

kotekmk

  • Beginner
  • *
  • Posts: 27
Re: icon - a new product. how to insert
« Reply #12 on: January 08, 2011, 16:26:34 pm »
does not work.
How do I delete a img php elements in the right place but to each product.
the problem is with the collection and calculation date. unless

madisj

  • Beginner
  • *
  • Posts: 16
Re: icon - a new product. how to insert
« Reply #13 on: February 28, 2011, 14:32:46 pm »
My code:

<div class="newproduct">
        <?php if ((time() - strtotime($cdate)) < (14 * 86400)) {  ?>
<img src="components/com_virtuemart/themes/default2/images/new.png" alt="New Product">
   <?php } ?>
</div>

in css:
.newproduct{
   margin: -110px -91px 0px 0px;
}

It works!

madisj

  • Beginner
  • *
  • Posts: 16
Re: icon - a new product. how to insert
« Reply #14 on: February 28, 2011, 14:34:18 pm »
sry, this is my file for illustartion

[attachment cleanup by admin]